content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
'''import math #as m also can be written
a=math.pi #a=m.pi
print(a)
'''
'''
from math import pi #import only pi from math
b=2*pi
print(b)
'''
'''
from math import * #import everything from math
b=2*pi
print(b)
'''
'''
food = 'spam'
if food == 'spam':
print('Ummmm, my favourite!')
print('I feel like saying it 100 times...')
print(100*(food+'!'))
'''
'''
food = 'spam'
if food == 'spam':
print('Ummmm, my favourite!')
else:
print('No!')
'''
'''
import random
a=random.randint(0,45)
str=''
if(a>43):
str='larger'
elif(a>35 and a<=43):
str = 'medium'
elif(a>25 and a<=35):
str='small'
else:
str='not eligible'
print('the value is {} and is {}'.format(a,str))
'''
'''
#for loop
for friend in ['Margot','Kathryn','Prisila']:
invitation = "Hi " + friend + ". Please come to my party on Saturday!"
print(invitation)
'''
'''
name = 'harrison'
guess = input("So I'm thinking of person's name. Try to guess it: ")
pos = 0
while guess!=name and pos<len(name):
print("Nope, that's not it! Hint: letter ",end='')
print(pos+1,'is',name[pos]+".",end='')
guess = input("Guess again: ")
pos = pos + 1
if pos==len(name) and name!=guess:
print("Too bad, you couldn't get it. The name was", name + ".")
else:
print("\nGreat, you got it in ",pos + 1,"guesses!")
'''
'''
for i in [12,16,17,24,29,30]:
if i%2 ==1: #if number is odd
pass #will do nothing
print('this is pass block')
print(i)
print('done')
'''
| """import math #as m also can be written
a=math.pi #a=m.pi
print(a)
"""
'\nfrom math import pi #import only pi from math\nb=2*pi\nprint(b)\n'
'\nfrom math import * #import everything from math\nb=2*pi\nprint(b)\n'
"\nfood = 'spam'\nif food == 'spam':\n print('Ummmm, my favourite!')\nprint('I feel like saying it 100 times...')\nprint(100*(food+'!')) \n"
"\nfood = 'spam'\nif food == 'spam':\n print('Ummmm, my favourite!')\nelse:\n print('No!')\n"
"\nimport random\na=random.randint(0,45)\nstr=''\nif(a>43):\n str='larger'\nelif(a>35 and a<=43):\n str = 'medium'\nelif(a>25 and a<=35):\n str='small'\nelse:\n str='not eligible'\n \nprint('the value is {} and is {}'.format(a,str))\n"
'\n#for loop\n\nfor friend in [\'Margot\',\'Kathryn\',\'Prisila\']:\n invitation = "Hi " + friend + ". Please come to my party on Saturday!"\n print(invitation)\n'
'\nname = \'harrison\'\nguess = input("So I\'m thinking of person\'s name. Try to guess it: ")\npos = 0\nwhile guess!=name and pos<len(name):\n print("Nope, that\'s not it! Hint: letter ",end=\'\')\n print(pos+1,\'is\',name[pos]+".",end=\'\')\n guess = input("Guess again: ")\n pos = pos + 1\nif pos==len(name) and name!=guess:\n print("Too bad, you couldn\'t get it. The name was", name + ".")\nelse:\n print("\nGreat, you got it in ",pos + 1,"guesses!")\n'
"\nfor i in [12,16,17,24,29,30]:\n if i%2 ==1: #if number is odd\n pass #will do nothing\n print('this is pass block') \n print(i)\nprint('done')\n" |
def test_post_order(client, order_payload):
res = client.post("/order", json = order_payload)
assert res.status_code == 200
def test_post_game(client, game_payload):
res = client.post("/order", json = game_payload)
assert res.status_code == 200
def test_get_order(client):
res1 = client.get("/order")
assert res1.json()["mode"] == 0
assert res1.json()["toppings"] == ["onions", "spice"]
res2 = client.get("/order")
assert res2.json()["mode"] == 1
res3 = client.get("/order")
assert res3.json() == {}
| def test_post_order(client, order_payload):
res = client.post('/order', json=order_payload)
assert res.status_code == 200
def test_post_game(client, game_payload):
res = client.post('/order', json=game_payload)
assert res.status_code == 200
def test_get_order(client):
res1 = client.get('/order')
assert res1.json()['mode'] == 0
assert res1.json()['toppings'] == ['onions', 'spice']
res2 = client.get('/order')
assert res2.json()['mode'] == 1
res3 = client.get('/order')
assert res3.json() == {} |
class Solution:
def angleClock(self, hour: int, minutes: int) -> float:
hour_deg = (hour*30)%360 + (0.5)*minutes
minute_deg = ((minutes/5)*30)%360
if(abs(hour_deg-minute_deg)>180):
return 360 - abs(hour_deg-minute_deg)
else:
return abs(hour_deg-minute_deg)
| class Solution:
def angle_clock(self, hour: int, minutes: int) -> float:
hour_deg = hour * 30 % 360 + 0.5 * minutes
minute_deg = minutes / 5 * 30 % 360
if abs(hour_deg - minute_deg) > 180:
return 360 - abs(hour_deg - minute_deg)
else:
return abs(hour_deg - minute_deg) |
class Solution:
def findDuplicate(self, nums: list[int]) -> int:
nums.sort()
for i in range(1, len(nums)):
if nums[i] == nums[i - 1]:
return nums[i]
class Solution:
def findDuplicate(self, nums: list[int]) -> int:
# 'low' and 'high' represent the range of values of the target
low = 1
high = len(nums) - 1
while low <= high:
cur = (low + high) // 2
count = 0
# Count how many numbers are less than or equal to 'cur'
count = sum(num <= cur for num in nums)
if count > cur:
duplicate = cur
high = cur - 1
else:
low = cur + 1
return duplicate
| class Solution:
def find_duplicate(self, nums: list[int]) -> int:
nums.sort()
for i in range(1, len(nums)):
if nums[i] == nums[i - 1]:
return nums[i]
class Solution:
def find_duplicate(self, nums: list[int]) -> int:
low = 1
high = len(nums) - 1
while low <= high:
cur = (low + high) // 2
count = 0
count = sum((num <= cur for num in nums))
if count > cur:
duplicate = cur
high = cur - 1
else:
low = cur + 1
return duplicate |
num = int(input(''))
hours = int(input(''))
value = float(input(''))
print('NUMBER = {:0}\nSALARY = U$ {:.2f}'.format(num, (hours * value))) | num = int(input(''))
hours = int(input(''))
value = float(input(''))
print('NUMBER = {:0}\nSALARY = U$ {:.2f}'.format(num, hours * value)) |
"""
Unit tests for pyDEX project should all go in this module
author: officialcryptomaster@gmail.com
"""
| """
Unit tests for pyDEX project should all go in this module
author: officialcryptomaster@gmail.com
""" |
class Solution(object):
def combinationSum2(self, candidates, target):
ret = []
self.dfs(sorted(candidates), target, 0, [], ret)
return ret
def dfs(self, nums, target, idx, path, ret):
if target <= 0:
if target == 0:
ret.append(path)
return
for i in range(idx, len(nums)):
if i > idx and nums[i] == nums[i-1]:
continue
self.dfs(nums, target-nums[i], i+1, path+[nums[i]], ret) | class Solution(object):
def combination_sum2(self, candidates, target):
ret = []
self.dfs(sorted(candidates), target, 0, [], ret)
return ret
def dfs(self, nums, target, idx, path, ret):
if target <= 0:
if target == 0:
ret.append(path)
return
for i in range(idx, len(nums)):
if i > idx and nums[i] == nums[i - 1]:
continue
self.dfs(nums, target - nums[i], i + 1, path + [nums[i]], ret) |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
class DispersionOnGrid:
def __init__(
self, axes,
polarization_npyarr, energy_npyarr):
self.axes = axes
self.polarization_npyarr = polarization_npyarr
self.energy_npyarr = energy_npyarr
return
pass # end of AbstractDispersion
# version
__id__ = "$Id$"
# End of file
| class Dispersionongrid:
def __init__(self, axes, polarization_npyarr, energy_npyarr):
self.axes = axes
self.polarization_npyarr = polarization_npyarr
self.energy_npyarr = energy_npyarr
return
pass
__id__ = '$Id$' |
str1 = "Udacity"
# LENGTH
print(len(str1)) # 7
# CHANGE CASE
# The `lower()` and `upper` method returns the string in lower case and upper case respectively
print(str1.lower()) # udacity
print(str1.upper()) # UDACITY
# SLICING
# string_var[lower_index : upper_index]
# Note that the upper_index is not inclusive.
print(str1[1:6]) # dacit
print(str1[:6]) # Udacit. A blank index means "all from that end"
print(str1[1:]) # dacity
# A negative index means start slicing from the end-of-string
print(str1[-6:-1]) # dacit
# STRIP
# `strip()` removes any whitespace from the beginning or the end
str2 = " Udacity "
print(str2.strip()) # Udacity
# REPLACE/SUBSTITUTE A CHARACTER IN THE STRING
# The replace() method replaces all occurances a character in a string with another character. The input arguments are case-sensitive
print(str1.replace('y', "B")) #UdacitB
# SPLIT INTO SUB-STRINGS
# The split() method splits a string into substrings based on the separator that we specify as argument
str3 = "Welcome, Constance!"
print(str3.split(",")) # ['Welcome', ' Constance!']
# CONCATENATION
print(str3 + " " + str1) # Welcome, Constance! Udacity
marks = 100
# print(str3 + " You have scored a perfect " + marks) # TypeError: can only concatenate str (not "int") to str
print(str3 + " You have scored a perfect " + format(marks)) # format() method converts the argument as a formatted string
# SORT A STRING
# We can use sorted() method that sort any instance of *iterable*. The characters are compared based on their ascii value
print(sorted(str3)) # [' ', '!', ',', 'C', 'W', 'a', 'c', 'c', 'e', 'e', 'e', 'l', 'm', 'n', 'n', 'o', 'o', 's', 't']
| str1 = 'Udacity'
print(len(str1))
print(str1.lower())
print(str1.upper())
print(str1[1:6])
print(str1[:6])
print(str1[1:])
print(str1[-6:-1])
str2 = ' Udacity '
print(str2.strip())
print(str1.replace('y', 'B'))
str3 = 'Welcome, Constance!'
print(str3.split(','))
print(str3 + ' ' + str1)
marks = 100
print(str3 + ' You have scored a perfect ' + format(marks))
print(sorted(str3)) |
class Line:
def __init__(self,p1,p2):
if (p1[0] > p2[0]):
self.p1 = p2
self.p2 = p1
elif (p1[0] == p2[0] and p1[1] > p2[1]):
self.p1 = p2
self.p2 = p1
else:
self.p1 = p1
self.p2 = p2
print(self.p1)
print(self.p2)
print(self.p2[0]-self.p1[0] )
self.m = None
if (self.p1[0] == self.p2[0]):
self.m = None
else:
self.m = (self.p2[1]-self.p1[1])/(self.p2[0]-self.p1[0])
if (self.m == 1):
self.incremento = 1
if (self.m == -1):
self.incremento = -1
if(self.m == 0):
self.incremento = 0
if (self.m is None):
self.incremento = 1
#print("Pendiente: " + str(self.m) + " Incremento: " + str(self.incremento))
# y = mx - b
#ps = self.calc_points_i()
#print(ps)
#print("-----------------------------------------------------------------------")
def calc_points_i(self):
points = []
points.append(self.p1)
if (self.m is not None):
y = self.p1[1]
for i in range(self.p1[0]+1,self.p2[0]):
y += self.incremento
points.append((i,y))
else:
y = self.p1[1]
for i in range(self.p1[1]+1,self.p2[1]):
y += self.incremento
points.append((self.p1[0],y))
points.append(self.p2)
return (points)
def calc_points(self):
points = []
points.append(self.p1)
points.append(self.p2)
if (self.p1[0] == self.p2[0]):
if (self.p1[1] > self.p2[1]):
begin = self.p2[1]+1
end = self.p1[1]
else:
begin = self.p1[1]+1
end = self.p2[1]
for i in range(begin,end):
points.append((self.p1[0],i))
elif (self.p1[1] == self.p2[1]):
if (self.p1[0] > self.p2[0]):
begin = self.p2[0]+1
end = self.p1[0]
else:
begin = self.p1[0]+1
end = self.p2[0]
for i in range(begin,end):
points.append((i,self.p1[1]))
else:
return []
return (points)
| class Line:
def __init__(self, p1, p2):
if p1[0] > p2[0]:
self.p1 = p2
self.p2 = p1
elif p1[0] == p2[0] and p1[1] > p2[1]:
self.p1 = p2
self.p2 = p1
else:
self.p1 = p1
self.p2 = p2
print(self.p1)
print(self.p2)
print(self.p2[0] - self.p1[0])
self.m = None
if self.p1[0] == self.p2[0]:
self.m = None
else:
self.m = (self.p2[1] - self.p1[1]) / (self.p2[0] - self.p1[0])
if self.m == 1:
self.incremento = 1
if self.m == -1:
self.incremento = -1
if self.m == 0:
self.incremento = 0
if self.m is None:
self.incremento = 1
def calc_points_i(self):
points = []
points.append(self.p1)
if self.m is not None:
y = self.p1[1]
for i in range(self.p1[0] + 1, self.p2[0]):
y += self.incremento
points.append((i, y))
else:
y = self.p1[1]
for i in range(self.p1[1] + 1, self.p2[1]):
y += self.incremento
points.append((self.p1[0], y))
points.append(self.p2)
return points
def calc_points(self):
points = []
points.append(self.p1)
points.append(self.p2)
if self.p1[0] == self.p2[0]:
if self.p1[1] > self.p2[1]:
begin = self.p2[1] + 1
end = self.p1[1]
else:
begin = self.p1[1] + 1
end = self.p2[1]
for i in range(begin, end):
points.append((self.p1[0], i))
elif self.p1[1] == self.p2[1]:
if self.p1[0] > self.p2[0]:
begin = self.p2[0] + 1
end = self.p1[0]
else:
begin = self.p1[0] + 1
end = self.p2[0]
for i in range(begin, end):
points.append((i, self.p1[1]))
else:
return []
return points |
class Node:
pass
class SystemNode(Node):
def __init__(self, equations):
self.equations = equations
class EquationNode(Node):
def __init__(self, differential, expression):
self.differential = differential
self.expression = expression
class DifferentialNode(Node):
def __init__(self, function, parameter):
self.function = function
self.parameter = parameter
class ExpressionNode(Node):
pass
class ParenthesisNode(ExpressionNode):
def __init__(self, expression):
self.expression = expression
class BinaryNode(ExpressionNode):
def __init__(self, left_expression, right_expression):
self.left_expression = left_expression
self.right_expression = right_expression
class PlusNode(BinaryNode):
pass
class MinusNode(BinaryNode):
pass
class FractionNode(BinaryNode):
pass
class StarNode(BinaryNode):
pass
class AtomicNode(ExpressionNode):
def __init__(self, value):
self.value = value
class SymbolNode(AtomicNode):
def __init__(self, value, isGlobal=False):
self.value = value
self.isGlobal = isGlobal
class NumberNode(AtomicNode):
pass
class IdentifierNode(ExpressionNode):
def __init__(self, symbol, subgroup=None, isGlobal=False):
self.symbol = symbol
self.subgroup = subgroup
self.isGlobal = isGlobal
class UnaryNode(ExpressionNode):
pass
class NegNode(UnaryNode):
def __init__(self, expression):
self.expression = expression
class GlobalNode(ExpressionNode):
def __init__(self, value):
self.value = value | class Node:
pass
class Systemnode(Node):
def __init__(self, equations):
self.equations = equations
class Equationnode(Node):
def __init__(self, differential, expression):
self.differential = differential
self.expression = expression
class Differentialnode(Node):
def __init__(self, function, parameter):
self.function = function
self.parameter = parameter
class Expressionnode(Node):
pass
class Parenthesisnode(ExpressionNode):
def __init__(self, expression):
self.expression = expression
class Binarynode(ExpressionNode):
def __init__(self, left_expression, right_expression):
self.left_expression = left_expression
self.right_expression = right_expression
class Plusnode(BinaryNode):
pass
class Minusnode(BinaryNode):
pass
class Fractionnode(BinaryNode):
pass
class Starnode(BinaryNode):
pass
class Atomicnode(ExpressionNode):
def __init__(self, value):
self.value = value
class Symbolnode(AtomicNode):
def __init__(self, value, isGlobal=False):
self.value = value
self.isGlobal = isGlobal
class Numbernode(AtomicNode):
pass
class Identifiernode(ExpressionNode):
def __init__(self, symbol, subgroup=None, isGlobal=False):
self.symbol = symbol
self.subgroup = subgroup
self.isGlobal = isGlobal
class Unarynode(ExpressionNode):
pass
class Negnode(UnaryNode):
def __init__(self, expression):
self.expression = expression
class Globalnode(ExpressionNode):
def __init__(self, value):
self.value = value |
"""Assignment operators
@see: https://www.w3schools.com/python/python_operators.asp
Assignment operators are used to assign values to variables
"""
def test_assignment_operator():
"""Assignment operator """
assert True
# Multiple assignment.
# The variables first_variable and second_variable simultaneously get the new values 0 and 1.
first_variable, second_variable = 0, 1
assert first_variable == 0
assert second_variable == 1
# You may even switch variable values using multiple assignment.
first_variable, second_variable = second_variable, first_variable
assert first_variable == 1
assert second_variable == 0
def test_augmented_assignment_operators():
"""Assignment operator combined with arithmetic and bitwise operators"""
number = 5 + 3
assert number == 8
number = 5 - 3
assert number == 2
number = 5 * 3
assert number == 15
number = 8 / 4
assert number == 2
# Assignment: %=
number = 8
number %= 3
assert number == 2
# Assignment: %=
number = 5
number %= 3
assert number == 2
# Assignment: //=
number = 5
number //= 3
assert number == 1
# Assignment: **=
number = 5
number **= 3
assert number == 125
# Assignment: &=
number = 5 # 0b0101
number &= 3 # 0b0011
assert number == 1 # 0b0001
# Assignment: |=
number = 5 # 0b0101
number |= 3 # 0b0011
assert number == 7 # 0b0111
# Assignment: ^=
number = 5 # 0b0101
number ^= 3 # 0b0011
assert number == 6 # 0b0110
# Assignment: >>=
number = 5
number >>= 3
assert number == 0 # (((5 // 2) // 2) // 2)
# Assignment: <<=
number = 5
number <<= 3
assert number == 40 # 5 * 2 * 2 * 2
| """Assignment operators
@see: https://www.w3schools.com/python/python_operators.asp
Assignment operators are used to assign values to variables
"""
def test_assignment_operator():
"""Assignment operator """
assert True
(first_variable, second_variable) = (0, 1)
assert first_variable == 0
assert second_variable == 1
(first_variable, second_variable) = (second_variable, first_variable)
assert first_variable == 1
assert second_variable == 0
def test_augmented_assignment_operators():
"""Assignment operator combined with arithmetic and bitwise operators"""
number = 5 + 3
assert number == 8
number = 5 - 3
assert number == 2
number = 5 * 3
assert number == 15
number = 8 / 4
assert number == 2
number = 8
number %= 3
assert number == 2
number = 5
number %= 3
assert number == 2
number = 5
number //= 3
assert number == 1
number = 5
number **= 3
assert number == 125
number = 5
number &= 3
assert number == 1
number = 5
number |= 3
assert number == 7
number = 5
number ^= 3
assert number == 6
number = 5
number >>= 3
assert number == 0
number = 5
number <<= 3
assert number == 40 |
#!/usr/bin/env python
"""Tests for `tools_1c` package."""
| """Tests for `tools_1c` package.""" |
"""Generate warnings for Machine statistics"""
def cpu_warning_generator(cpu_tuple):
# Returns boolean value false if used cycles is greater than idle cycles
used_time = cpu_tuple.user + cpu_tuple.nice + cpu_tuple.system
if used_time > cpu_tuple.idle:
return True
else:
return False
def memory_warning_generator(memory_tuple, threshold=524288000):
# Returns boolean value false if memory is less than 500 MB
if memory_tuple.available <= threshold:
return True
return False
def disk_warning_generator(disk_tuple, threshold = 80):
# Returns boolean value false if disk space is less than 1 GB
if disk_tuple.percent > threshold:
return True
else:
return False
| """Generate warnings for Machine statistics"""
def cpu_warning_generator(cpu_tuple):
used_time = cpu_tuple.user + cpu_tuple.nice + cpu_tuple.system
if used_time > cpu_tuple.idle:
return True
else:
return False
def memory_warning_generator(memory_tuple, threshold=524288000):
if memory_tuple.available <= threshold:
return True
return False
def disk_warning_generator(disk_tuple, threshold=80):
if disk_tuple.percent > threshold:
return True
else:
return False |
frase = str(input('Digite uma frase: '))
cont = 1
for c in frase:
if cont % 2 == 0:
print(c.upper(), end='')
else:
print(c.lower(), end='')
cont += 1
| frase = str(input('Digite uma frase: '))
cont = 1
for c in frase:
if cont % 2 == 0:
print(c.upper(), end='')
else:
print(c.lower(), end='')
cont += 1 |
# https://stackoverflow.com/questions/13979714/heap-sort-how-to-sort
swaps = 0
def heapify(arr, n, i):
global swaps
count = 0
largest = i
l = 2 * i + 1
r = 2 * i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
count += 1
arr[i],arr[largest] = arr[largest],arr[i]
swaps += 1
count += heapify(arr, n, largest)
return count
def heapSort(arr):
global swaps
n = len(arr)
count = 0
for i in range(n, -1, -1):
heapify(arr, n, i)
count += heapify(arr, i, 0)
for i in range(n-1, 0, -1):
arr[i], arr[0] = arr[0], arr[i]
swaps += 1
count += heapify(arr, i, 0)
return "HEAP SORT:\nComparisons: " + str(count) + "\nSwaps: " + str(swaps) | swaps = 0
def heapify(arr, n, i):
global swaps
count = 0
largest = i
l = 2 * i + 1
r = 2 * i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
count += 1
(arr[i], arr[largest]) = (arr[largest], arr[i])
swaps += 1
count += heapify(arr, n, largest)
return count
def heap_sort(arr):
global swaps
n = len(arr)
count = 0
for i in range(n, -1, -1):
heapify(arr, n, i)
count += heapify(arr, i, 0)
for i in range(n - 1, 0, -1):
(arr[i], arr[0]) = (arr[0], arr[i])
swaps += 1
count += heapify(arr, i, 0)
return 'HEAP SORT:\nComparisons: ' + str(count) + '\nSwaps: ' + str(swaps) |
class Solution:
def solve(self, words):
groups = defaultdict(list)
for word in words:
for key in groups:
if len(word)==len(key) and any(all(word[j]==key[j-i] for j in range(i,len(word))) and all(word[j]==key[len(word)-i+j] for j in range(i)) for i in range(len(word))):
groups[key].append(word)
break
else:
groups[word].append(word)
return len(groups)
| class Solution:
def solve(self, words):
groups = defaultdict(list)
for word in words:
for key in groups:
if len(word) == len(key) and any((all((word[j] == key[j - i] for j in range(i, len(word)))) and all((word[j] == key[len(word) - i + j] for j in range(i))) for i in range(len(word)))):
groups[key].append(word)
break
else:
groups[word].append(word)
return len(groups) |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Time, obj[3]: Coupon, obj[4]: Coupon_validity, obj[5]: Gender, obj[6]: Age, obj[7]: Maritalstatus, obj[8]: Children, obj[9]: Education, obj[10]: Occupation, obj[11]: Income, obj[12]: Bar, obj[13]: Coffeehouse, obj[14]: Restaurantlessthan20, obj[15]: Restaurant20to50, obj[16]: Direction_same, obj[17]: Distance
# {"feature": "Coupon", "instances": 85, "metric_value": 0.874, "depth": 1}
if obj[3]<=3:
# {"feature": "Occupation", "instances": 58, "metric_value": 0.7355, "depth": 2}
if obj[10]<=20:
# {"feature": "Coffeehouse", "instances": 56, "metric_value": 0.6769, "depth": 3}
if obj[13]>0.0:
# {"feature": "Time", "instances": 45, "metric_value": 0.7642, "depth": 4}
if obj[2]<=3:
# {"feature": "Bar", "instances": 39, "metric_value": 0.8213, "depth": 5}
if obj[12]<=3.0:
# {"feature": "Distance", "instances": 38, "metric_value": 0.7897, "depth": 6}
if obj[17]>1:
# {"feature": "Restaurantlessthan20", "instances": 24, "metric_value": 0.9183, "depth": 7}
if obj[14]<=2.0:
# {"feature": "Age", "instances": 15, "metric_value": 0.9968, "depth": 8}
if obj[6]<=4:
# {"feature": "Restaurant20to50", "instances": 13, "metric_value": 0.9612, "depth": 9}
if obj[15]>-1.0:
# {"feature": "Weather", "instances": 11, "metric_value": 0.994, "depth": 10}
if obj[1]<=1:
# {"feature": "Passanger", "instances": 10, "metric_value": 1.0, "depth": 11}
if obj[0]<=1:
# {"feature": "Maritalstatus", "instances": 6, "metric_value": 0.9183, "depth": 12}
if obj[7]>0:
# {"feature": "Direction_same", "instances": 5, "metric_value": 0.7219, "depth": 13}
if obj[16]<=0:
return 'False'
elif obj[16]>0:
return 'True'
else: return 'True'
elif obj[7]<=0:
return 'True'
else: return 'True'
elif obj[0]>1:
# {"feature": "Coupon_validity", "instances": 4, "metric_value": 0.8113, "depth": 12}
if obj[4]>0:
return 'True'
elif obj[4]<=0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[1]>1:
return 'True'
else: return 'True'
elif obj[15]<=-1.0:
return 'True'
else: return 'True'
elif obj[6]>4:
return 'False'
else: return 'False'
elif obj[14]>2.0:
# {"feature": "Income", "instances": 9, "metric_value": 0.5033, "depth": 8}
if obj[11]<=6:
return 'True'
elif obj[11]>6:
# {"feature": "Passanger", "instances": 3, "metric_value": 0.9183, "depth": 9}
if obj[0]<=1:
return 'True'
elif obj[0]>1:
return 'False'
else: return 'False'
else: return 'True'
else: return 'True'
elif obj[17]<=1:
# {"feature": "Education", "instances": 14, "metric_value": 0.3712, "depth": 7}
if obj[9]<=2:
return 'True'
elif obj[9]>2:
# {"feature": "Age", "instances": 4, "metric_value": 0.8113, "depth": 8}
if obj[6]>1:
return 'True'
elif obj[6]<=1:
return 'False'
else: return 'False'
else: return 'True'
else: return 'True'
elif obj[12]>3.0:
return 'False'
else: return 'False'
elif obj[2]>3:
return 'True'
else: return 'True'
elif obj[13]<=0.0:
return 'True'
else: return 'True'
elif obj[10]>20:
return 'False'
else: return 'False'
elif obj[3]>3:
# {"feature": "Coffeehouse", "instances": 27, "metric_value": 0.999, "depth": 2}
if obj[13]>0.0:
# {"feature": "Bar", "instances": 19, "metric_value": 0.9495, "depth": 3}
if obj[12]>0.0:
# {"feature": "Income", "instances": 14, "metric_value": 1.0, "depth": 4}
if obj[11]<=4:
# {"feature": "Education", "instances": 11, "metric_value": 0.9457, "depth": 5}
if obj[9]<=2:
# {"feature": "Distance", "instances": 7, "metric_value": 0.9852, "depth": 6}
if obj[17]<=1:
return 'True'
elif obj[17]>1:
return 'False'
else: return 'False'
elif obj[9]>2:
return 'False'
else: return 'False'
elif obj[11]>4:
return 'True'
else: return 'True'
elif obj[12]<=0.0:
return 'True'
else: return 'True'
elif obj[13]<=0.0:
# {"feature": "Passanger", "instances": 8, "metric_value": 0.8113, "depth": 3}
if obj[0]>1:
# {"feature": "Education", "instances": 4, "metric_value": 1.0, "depth": 4}
if obj[9]>0:
return 'True'
elif obj[9]<=0:
return 'False'
else: return 'False'
elif obj[0]<=1:
return 'False'
else: return 'False'
else: return 'False'
else: return 'True'
| def find_decision(obj):
if obj[3] <= 3:
if obj[10] <= 20:
if obj[13] > 0.0:
if obj[2] <= 3:
if obj[12] <= 3.0:
if obj[17] > 1:
if obj[14] <= 2.0:
if obj[6] <= 4:
if obj[15] > -1.0:
if obj[1] <= 1:
if obj[0] <= 1:
if obj[7] > 0:
if obj[16] <= 0:
return 'False'
elif obj[16] > 0:
return 'True'
else:
return 'True'
elif obj[7] <= 0:
return 'True'
else:
return 'True'
elif obj[0] > 1:
if obj[4] > 0:
return 'True'
elif obj[4] <= 0:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[1] > 1:
return 'True'
else:
return 'True'
elif obj[15] <= -1.0:
return 'True'
else:
return 'True'
elif obj[6] > 4:
return 'False'
else:
return 'False'
elif obj[14] > 2.0:
if obj[11] <= 6:
return 'True'
elif obj[11] > 6:
if obj[0] <= 1:
return 'True'
elif obj[0] > 1:
return 'False'
else:
return 'False'
else:
return 'True'
else:
return 'True'
elif obj[17] <= 1:
if obj[9] <= 2:
return 'True'
elif obj[9] > 2:
if obj[6] > 1:
return 'True'
elif obj[6] <= 1:
return 'False'
else:
return 'False'
else:
return 'True'
else:
return 'True'
elif obj[12] > 3.0:
return 'False'
else:
return 'False'
elif obj[2] > 3:
return 'True'
else:
return 'True'
elif obj[13] <= 0.0:
return 'True'
else:
return 'True'
elif obj[10] > 20:
return 'False'
else:
return 'False'
elif obj[3] > 3:
if obj[13] > 0.0:
if obj[12] > 0.0:
if obj[11] <= 4:
if obj[9] <= 2:
if obj[17] <= 1:
return 'True'
elif obj[17] > 1:
return 'False'
else:
return 'False'
elif obj[9] > 2:
return 'False'
else:
return 'False'
elif obj[11] > 4:
return 'True'
else:
return 'True'
elif obj[12] <= 0.0:
return 'True'
else:
return 'True'
elif obj[13] <= 0.0:
if obj[0] > 1:
if obj[9] > 0:
return 'True'
elif obj[9] <= 0:
return 'False'
else:
return 'False'
elif obj[0] <= 1:
return 'False'
else:
return 'False'
else:
return 'False'
else:
return 'True' |
#-- gestures supported by Otto
#-- OttDIY Python Project, 2020
OTTOHAPPY = const(0)
OTTOSUPERHAPPY = const(1)
OTTOSAD = const(2)
OTTOSLEEPING = const(3)
OTTOFART = const(4)
OTTOCONFUSED = const(5)
OTTOLOVE = const(6)
OTTOANGRY = const(7)
OTTOFRETFUL = const(8)
OTTOMAGIC = const(9)
OTTOWAVE = const(10)
OTTOVICTORY = const(11)
OTTOFAIL = const(12)
| ottohappy = const(0)
ottosuperhappy = const(1)
ottosad = const(2)
ottosleeping = const(3)
ottofart = const(4)
ottoconfused = const(5)
ottolove = const(6)
ottoangry = const(7)
ottofretful = const(8)
ottomagic = const(9)
ottowave = const(10)
ottovictory = const(11)
ottofail = const(12) |
products = {}
command = input()
while command != "statistics":
command = command.split(": ")
key = command[0]
value = int(command[1])
if key not in products:
products[key] = 0
products[key] += value
command = input()
print("Products in stock:")
for k, v in products.items():
print(f"- {k}: {v}")
print(f"Total Products: {len(products)}")
print(f"Total Quantity: {sum(products.values())}") | products = {}
command = input()
while command != 'statistics':
command = command.split(': ')
key = command[0]
value = int(command[1])
if key not in products:
products[key] = 0
products[key] += value
command = input()
print('Products in stock:')
for (k, v) in products.items():
print(f'- {k}: {v}')
print(f'Total Products: {len(products)}')
print(f'Total Quantity: {sum(products.values())}') |
# Simple function to add values
def aFunction():
a = 1
b = 2
c = a + b
print(c)
return c
# simple loop to count up in a range
def aLoop():
count = 0
# for each item in the range
for item in range(0, 100):
print(count)
count = count + 1
return count
# pass in a value below to aFunc, will fail if not an integer
def aFunc_1(my_num):
result = aFunc_2(my_num)
print(result)
return result
# aFunc_2 will add 1 to var and then return the value of var to aFunc_1
def aFunc_2(var):
var += 1
return var
# If statement in a function. If a_lang is (==) a specific value then it prints a statement
def anIf(a_lang):
if a_lang == "Python":
result = 'cool'
print(result)
elif a_lang == "JAVA":
result = 'not as cool as Python'
print(result)
else:
result = 'You should have picked Python'
print(result)
return result
my_num: int = 10
language = "Python"
if __name__ == "__main__":
# aFunction()
aLoop()
# aFunc_1(my_num)
# anIf(language)
| def a_function():
a = 1
b = 2
c = a + b
print(c)
return c
def a_loop():
count = 0
for item in range(0, 100):
print(count)
count = count + 1
return count
def a_func_1(my_num):
result = a_func_2(my_num)
print(result)
return result
def a_func_2(var):
var += 1
return var
def an_if(a_lang):
if a_lang == 'Python':
result = 'cool'
print(result)
elif a_lang == 'JAVA':
result = 'not as cool as Python'
print(result)
else:
result = 'You should have picked Python'
print(result)
return result
my_num: int = 10
language = 'Python'
if __name__ == '__main__':
a_loop() |
# taxes.tests
# Tax tests
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sat Apr 14 16:36:54 2018 -0400
#
# ID: tests.py [20315d2] benjamin@bengfort.com $
"""
Tax tests
"""
##########################################################################
## Imports
##########################################################################
| """
Tax tests
""" |
#!/usr/bin/python
# 1. Retourner VRAI si N est parfait, faux sinon
# 2. Afficher la liste des nombres parfait compris entre 1 et 10 000
def est_parfait(n):
somme = 0
for i in range(1, n):
if n % i == 0:
somme += i
if somme == n:
return True
else:
return False
for i in range(10000):
if est_parfait(i):
print(i)
| def est_parfait(n):
somme = 0
for i in range(1, n):
if n % i == 0:
somme += i
if somme == n:
return True
else:
return False
for i in range(10000):
if est_parfait(i):
print(i) |
class Credentials(object):
@staticmethod
def refresh(request, **kwargs):
pass
@property
def token(self):
return "PASSWORD"
def default(scopes: list, **kwargs):
return Credentials(), "myproject"
class Request(object):
pass
| class Credentials(object):
@staticmethod
def refresh(request, **kwargs):
pass
@property
def token(self):
return 'PASSWORD'
def default(scopes: list, **kwargs):
return (credentials(), 'myproject')
class Request(object):
pass |
xCoordinate = [1,2,3,4,5,6,7,8,9,10]
xCdt = [1,2,3,4,5,6,7,8,9,10]
def setup():
size(500,500)
smooth()
noStroke()
for i in range(len(xCoordinate)):
xCoordinate[i] = 35*i + 90
for j in range(len(xCdt)):
xCdt[j] = 35*j + 90
def draw():
background(50)
for j in range(len(xCdt)):
fill(200,40)
ellipse( xCdt[j], 340, 150-j*15, 150-j*15)
fill(0)
ellipse(xCdt[j], 340, 3, 3)
for i in range(len(xCoordinate)):
fill(200,40)
ellipse(xCoordinate[i], 250, 15*i, 15*i)
fill(0)
ellipse(xCoordinate[i], 250, 3, 3)
| x_coordinate = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
x_cdt = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def setup():
size(500, 500)
smooth()
no_stroke()
for i in range(len(xCoordinate)):
xCoordinate[i] = 35 * i + 90
for j in range(len(xCdt)):
xCdt[j] = 35 * j + 90
def draw():
background(50)
for j in range(len(xCdt)):
fill(200, 40)
ellipse(xCdt[j], 340, 150 - j * 15, 150 - j * 15)
fill(0)
ellipse(xCdt[j], 340, 3, 3)
for i in range(len(xCoordinate)):
fill(200, 40)
ellipse(xCoordinate[i], 250, 15 * i, 15 * i)
fill(0)
ellipse(xCoordinate[i], 250, 3, 3) |
class LostFocusEventManager(WeakEventManager):
""" Provides a System.Windows.WeakEventManager implementation so that you can use the "weak event listener" pattern to attach listeners for the System.Windows.UIElement.LostFocus or System.Windows.ContentElement.LostFocus events. """
@staticmethod
def AddHandler(source,handler):
""" AddHandler(source: DependencyObject,handler: EventHandler[RoutedEventArgs]) """
pass
@staticmethod
def AddListener(source,listener):
"""
AddListener(source: DependencyObject,listener: IWeakEventListener)
Adds the provided listener to the list of listeners on the provided source.
source: The object with the event.
listener: The object to add as a listener.
"""
pass
@staticmethod
def RemoveHandler(source,handler):
""" RemoveHandler(source: DependencyObject,handler: EventHandler[RoutedEventArgs]) """
pass
@staticmethod
def RemoveListener(source,listener):
"""
RemoveListener(source: DependencyObject,listener: IWeakEventListener)
Removes the specified listener from the list of listeners on the provided
source.
source: The object to remove the listener from.
listener: The listener to remove.
"""
pass
ReadLock=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Establishes a read-lock on the underlying data table,and returns an System.IDisposable.
"""
WriteLock=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Establishes a write-lock on the underlying data table,and returns an System.IDisposable.
"""
| class Lostfocuseventmanager(WeakEventManager):
""" Provides a System.Windows.WeakEventManager implementation so that you can use the "weak event listener" pattern to attach listeners for the System.Windows.UIElement.LostFocus or System.Windows.ContentElement.LostFocus events. """
@staticmethod
def add_handler(source, handler):
""" AddHandler(source: DependencyObject,handler: EventHandler[RoutedEventArgs]) """
pass
@staticmethod
def add_listener(source, listener):
"""
AddListener(source: DependencyObject,listener: IWeakEventListener)
Adds the provided listener to the list of listeners on the provided source.
source: The object with the event.
listener: The object to add as a listener.
"""
pass
@staticmethod
def remove_handler(source, handler):
""" RemoveHandler(source: DependencyObject,handler: EventHandler[RoutedEventArgs]) """
pass
@staticmethod
def remove_listener(source, listener):
"""
RemoveListener(source: DependencyObject,listener: IWeakEventListener)
Removes the specified listener from the list of listeners on the provided
source.
source: The object to remove the listener from.
listener: The listener to remove.
"""
pass
read_lock = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Establishes a read-lock on the underlying data table,and returns an System.IDisposable.\n\n\n\n'
write_lock = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Establishes a write-lock on the underlying data table,and returns an System.IDisposable.\n\n\n\n' |
#TeamLeague
class Team:
def __init__(self, owner, value, id1, name):
self.owner = owner
self.value = value
self.id1 = id1
self.name = name
class League:
def __init__(self, team_list, league):
self.league = league
self.team_list = team_list
def find_minimum_team_by_Id(self):
minim = 999999
obj = None
for each in self.team_list:
if each.id1 < minim:
minim = each.id1
obj = each
return obj
def sort_by_team_Id(self):
l = []
for each in self.team_list:
l.append(each.id1)
return sorted(l) if len(l)!=0 else None
n = int(input())
l = []
for i in range(n):
own = input()
value = float(input())
id = int(input())
name = input()
l.append(Team(own,value,id,name))
obj = League(l,"league")
x = obj.find_minimum_team_by_Id()
y = obj.sort_by_team_Id()
if x == None:
print("No Data Found")
else:
print(x.owner)
print(x.value)
print(x.id1)
print(x.name)
if y == None:
print("No Data Found")
else:
for i in y:
print(i)
| class Team:
def __init__(self, owner, value, id1, name):
self.owner = owner
self.value = value
self.id1 = id1
self.name = name
class League:
def __init__(self, team_list, league):
self.league = league
self.team_list = team_list
def find_minimum_team_by__id(self):
minim = 999999
obj = None
for each in self.team_list:
if each.id1 < minim:
minim = each.id1
obj = each
return obj
def sort_by_team__id(self):
l = []
for each in self.team_list:
l.append(each.id1)
return sorted(l) if len(l) != 0 else None
n = int(input())
l = []
for i in range(n):
own = input()
value = float(input())
id = int(input())
name = input()
l.append(team(own, value, id, name))
obj = league(l, 'league')
x = obj.find_minimum_team_by_Id()
y = obj.sort_by_team_Id()
if x == None:
print('No Data Found')
else:
print(x.owner)
print(x.value)
print(x.id1)
print(x.name)
if y == None:
print('No Data Found')
else:
for i in y:
print(i) |
## Solution Challenge 10
def data_url(country):
'''
Function to build url for data retrieval
'''
BASE_URL = "http://berkeleyearth.lbl.gov/auto/Regional/TAVG/Text/"
SUFFIX_URL = "-TAVG-Trend.txt"
return(BASE_URL + country + SUFFIX_URL) | def data_url(country):
"""
Function to build url for data retrieval
"""
base_url = 'http://berkeleyearth.lbl.gov/auto/Regional/TAVG/Text/'
suffix_url = '-TAVG-Trend.txt'
return BASE_URL + country + SUFFIX_URL |
"""
The hyperexponentiation of a number
"""
def pow_mod_recursive(a, x, mod):
if x == 0 or x == 1:
return a ** x % mod
elif x % 2 == 0:
return pow_mod_recursive(a, x//2, mod) ** 2 % mod
else:
return a* pow_mod_recursive(a, x//2, mod)** 2 % mod
def pow_mod(a, x, mod):
pow_value = 1
while x > 0:
if x & 1 == 1:
pow_value = pow_value *a % mod
a = a ** 2 % mod
x >>= 1
return pow_value
if __name__ == '__main__':
result = 1
for i in range(1855):
result = pow_mod(1777, result, 100**8)
print(result) | """
The hyperexponentiation of a number
"""
def pow_mod_recursive(a, x, mod):
if x == 0 or x == 1:
return a ** x % mod
elif x % 2 == 0:
return pow_mod_recursive(a, x // 2, mod) ** 2 % mod
else:
return a * pow_mod_recursive(a, x // 2, mod) ** 2 % mod
def pow_mod(a, x, mod):
pow_value = 1
while x > 0:
if x & 1 == 1:
pow_value = pow_value * a % mod
a = a ** 2 % mod
x >>= 1
return pow_value
if __name__ == '__main__':
result = 1
for i in range(1855):
result = pow_mod(1777, result, 100 ** 8)
print(result) |
"""
ensemble module
"""
class BaseEnsembler:
def __init__(self, *args, **kwargs):
super().__init__()
def fit(self, predictions, label, identifiers, feval, *args, **kwargs):
pass
def ensemble(self, predictions, identifiers, *args, **kwargs):
pass
@classmethod
def build_ensembler_from_args(cls, args):
"""Build a new ensembler instance."""
raise NotImplementedError(
"Ensembler must implement the build_ensembler_from_args method"
)
| """
ensemble module
"""
class Baseensembler:
def __init__(self, *args, **kwargs):
super().__init__()
def fit(self, predictions, label, identifiers, feval, *args, **kwargs):
pass
def ensemble(self, predictions, identifiers, *args, **kwargs):
pass
@classmethod
def build_ensembler_from_args(cls, args):
"""Build a new ensembler instance."""
raise not_implemented_error('Ensembler must implement the build_ensembler_from_args method') |
class Solution(object):
def hammingDistance(self, x, y):
cnt = 0
n=x^y
while n>0:
cnt += 1
n = n&(n-1)
return cnt
class Solution(object):
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
return bin(x^y).count('1')
| class Solution(object):
def hamming_distance(self, x, y):
cnt = 0
n = x ^ y
while n > 0:
cnt += 1
n = n & n - 1
return cnt
class Solution(object):
def hamming_distance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
return bin(x ^ y).count('1') |
#
# PySNMP MIB module RFC1382-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/RFC1382-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:26:33 2016
# On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose
# Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52)
#
( OctetString, ObjectIdentifier, Integer, ) = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
( PositiveInteger, ) = mibBuilder.importSymbols("RFC1253-MIB", "PositiveInteger")
( EntryStatus, ) = mibBuilder.importSymbols("RFC1271-MIB", "EntryStatus")
( IfIndexType, ) = mibBuilder.importSymbols("RFC1381-MIB", "IfIndexType")
( ModuleCompliance, NotificationGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
( IpAddress, iso, ObjectIdentity, MibIdentifier, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Counter32, NotificationType, transmission, Bits, TimeTicks, Integer32, Gauge32, Counter64, Unsigned32, ) = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "iso", "ObjectIdentity", "MibIdentifier", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Counter32", "NotificationType", "transmission", "Bits", "TimeTicks", "Integer32", "Gauge32", "Counter64", "Unsigned32")
( TextualConvention, DisplayString, ) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
x25 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5))
class X121Address(OctetString):
subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,17)
x25AdmnTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 1), )
if mibBuilder.loadTexts: x25AdmnTable.setDescription('This table contains the administratively\n set configuration parameters for an X.25\n Packet Level Entity (PLE).\n\n Most of the objects in this table have\n corresponding objects in the x25OperTable.\n This table contains the values as last set\n by the administrator. The x25OperTable\n contains the values actually in use by an\n X.25 PLE.\n\n Changing an administrative value may or may\n not change a current operating value. The\n operating value may not change until the\n interface is restarted. Some\n implementations may change the values\n immediately upon changing the administrative\n table. All implementations are required to\n load the values from the administrative\n table when initializing a PLE.')
x25AdmnEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 1, 1), ).setIndexNames((0, "RFC1382-MIB", "x25AdmnIndex"))
if mibBuilder.loadTexts: x25AdmnEntry.setDescription('Entries of x25AdmnTable.')
x25AdmnIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 1), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25AdmnIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25AdmnInterfaceMode = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("dte", 1), ("dce", 2), ("dxe", 3),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnInterfaceMode.setDescription('Identifies DCE/DTE mode in which the\n interface operates. A value of dxe\n indicates the mode will be determined by XID\n negotiation.')
x25AdmnMaxActiveCircuits = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnMaxActiveCircuits.setDescription('The maximum number of circuits this PLE can\n support; including PVCs.')
x25AdmnPacketSequencing = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("modulo8", 1), ("modulo128", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnPacketSequencing.setDescription('The modulus of the packet sequence number\n space.')
x25AdmnRestartTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 5), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRestartTimer.setDescription('The T20 restart timer in milliseconds.')
x25AdmnCallTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 6), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnCallTimer.setDescription('The T21 Call timer in milliseconds.')
x25AdmnResetTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 7), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnResetTimer.setDescription('The T22 Reset timer in milliseconds.')
x25AdmnClearTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 8), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnClearTimer.setDescription('The T23 Clear timer in milliseconds.')
x25AdmnWindowTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 9), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnWindowTimer.setDescription('The T24 window status transmission timer in\n milliseconds. A value of 2147483647\n indicates no window timer in use.')
x25AdmnDataRxmtTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 10), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnDataRxmtTimer.setDescription('The T25 data retransmission timer in\n\n\n milliseconds. A value of 2147483647\n indicates no data retransmission timer in\n use.')
x25AdmnInterruptTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 11), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnInterruptTimer.setDescription('The T26 interrupt timer in milliseconds. A\n value of 2147483647 indicates no interrupt\n timer in use.')
x25AdmnRejectTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 12), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRejectTimer.setDescription('The T27 Reject retransmission timer in\n milliseconds. A value of 2147483647\n indicates no reject timer in use.')
x25AdmnRegistrationRequestTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 13), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRegistrationRequestTimer.setDescription('The T28 registration timer in milliseconds.\n A value of 2147483647 indicates no\n registration timer in use.')
x25AdmnMinimumRecallTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 14), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnMinimumRecallTimer.setDescription('Minimum time interval between unsuccessful\n call attempts in milliseconds.')
x25AdmnRestartCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRestartCount.setDescription('The R20 restart retransmission count.')
x25AdmnResetCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnResetCount.setDescription('The r22 Reset retransmission count.')
x25AdmnClearCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnClearCount.setDescription('The r23 Clear retransmission count.')
x25AdmnDataRxmtCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnDataRxmtCount.setDescription('The R25 Data retransmission count. This\n value is irrelevant if the\n x25AdmnDataRxmtTimer indicates no timer in\n use.')
x25AdmnRejectCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRejectCount.setDescription('The R27 reject retransmission count. This\n value is irrelevant if the\n x25AdmnRejectTimer indicates no timer in\n use.')
x25AdmnRegistrationRequestCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnRegistrationRequestCount.setDescription('The R28 Registration retransmission Count.\n This value is irrelevant if the\n x25AdmnRegistrationRequestTimer indicates no\n timer in use.')
x25AdmnNumberPVCs = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnNumberPVCs.setDescription('The number of PVC configured for this PLE.\n The PVCs use channel numbers from 1 to this\n number.')
x25AdmnDefCallParamId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 22), ObjectIdentifier()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnDefCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable which contains the default\n call parameters for this PLE.')
x25AdmnLocalAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 23), X121Address()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnLocalAddress.setDescription('The local address for this PLE subnetwork.\n A zero length address maybe returned by PLEs\n that only support PVCs.')
x25AdmnProtocolVersionSupported = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 24), ObjectIdentifier()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25AdmnProtocolVersionSupported.setDescription('Identifies the version of the X.25 protocol\n this interface should support. Object\n identifiers for common versions are defined\n below in the x25ProtocolVersion subtree.')
x25OperTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 2), )
if mibBuilder.loadTexts: x25OperTable.setDescription('The operation parameters in use by the X.25\n PLE.')
x25OperEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 2, 1), ).setIndexNames((0, "RFC1382-MIB", "x25OperIndex"))
if mibBuilder.loadTexts: x25OperEntry.setDescription('Entries of x25OperTable.')
x25OperIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 1), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperIndex.setDescription('The ifIndex value for the X.25 interface.')
x25OperInterfaceMode = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("dte", 1), ("dce", 2), ("dxe", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperInterfaceMode.setDescription('Identifies DCE/DTE mode in which the\n interface operates. A value of dxe\n indicates the role will be determined by XID\n negotiation at the Link Layer and that\n negotiation has not yet taken place.')
x25OperMaxActiveCircuits = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperMaxActiveCircuits.setDescription('Maximum number of circuits this PLE can\n support.')
x25OperPacketSequencing = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("modulo8", 1), ("modulo128", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperPacketSequencing.setDescription('The modulus of the packet sequence number\n space.')
x25OperRestartTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 5), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRestartTimer.setDescription('The T20 restart timer in milliseconds.')
x25OperCallTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 6), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperCallTimer.setDescription('The T21 Call timer in milliseconds.')
x25OperResetTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 7), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperResetTimer.setDescription('The T22 Reset timer in milliseconds.')
x25OperClearTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 8), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperClearTimer.setDescription('The T23 Clear timer in milliseconds.')
x25OperWindowTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 9), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperWindowTimer.setDescription('The T24 window status transmission timer\n\n\n milliseconds. A value of 2147483647\n indicates no window timer in use.')
x25OperDataRxmtTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 10), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperDataRxmtTimer.setDescription('The T25 Data Retransmission timer in\n milliseconds. A value of 2147483647\n indicates no data retransmission timer in\n use.')
x25OperInterruptTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 11), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperInterruptTimer.setDescription('The T26 Interrupt timer in milliseconds. A\n value of 2147483647 indicates interrupts are\n not being used.')
x25OperRejectTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 12), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRejectTimer.setDescription('The T27 Reject retransmission timer in\n milliseconds. A value of 2147483647\n indicates no reject timer in use.')
x25OperRegistrationRequestTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 13), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRegistrationRequestTimer.setDescription('The T28 registration timer in milliseconds.\n A value of 2147483647 indicates no\n registration timer in use.')
x25OperMinimumRecallTimer = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 14), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperMinimumRecallTimer.setDescription('Minimum time interval between unsuccessful\n call attempts in milliseconds.')
x25OperRestartCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRestartCount.setDescription('The R20 restart retransmission count.')
x25OperResetCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperResetCount.setDescription('The r22 Reset retransmission count.')
x25OperClearCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperClearCount.setDescription('The r23 Clear retransmission count.')
x25OperDataRxmtCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperDataRxmtCount.setDescription('The R25 Data retransmission count. This\n value is undefined if the\n x25OperDataRxmtTimer indicates no timer in\n use.')
x25OperRejectCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRejectCount.setDescription('The R27 reject retransmission count. This\n value is undefined if the x25OperRejectTimer\n indicates no timer in use.')
x25OperRegistrationRequestCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperRegistrationRequestCount.setDescription('The R28 Registration retransmission Count.\n This value is undefined if the\n x25OperREgistrationRequestTimer indicates no\n timer in use.')
x25OperNumberPVCs = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperNumberPVCs.setDescription('The number of PVC configured for this PLE.\n The PVCs use channel numbers from 1 to this\n number.')
x25OperDefCallParamId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 22), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperDefCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable that contains the default\n call parameters for this PLE.')
x25OperLocalAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 23), X121Address()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperLocalAddress.setDescription('The local address for this PLE subnetwork.\n A zero length address maybe returned by PLEs\n that only support PVCs.')
x25OperDataLinkId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 24), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperDataLinkId.setDescription('This identifies the instance of the index\n object in the first table of the most device\n specific MIB for the interface used by this\n PLE.')
x25OperProtocolVersionSupported = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 25), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25OperProtocolVersionSupported.setDescription('Identifies the version of the X.25 protocol\n this interface supports. Object identifiers\n for common versions are defined below in the\n x25ProtocolVersion subtree.')
x25StatTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 3), )
if mibBuilder.loadTexts: x25StatTable.setDescription('Statistics information about this X.25\n PLE.')
x25StatEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 3, 1), ).setIndexNames((0, "RFC1382-MIB", "x25StatIndex"))
if mibBuilder.loadTexts: x25StatEntry.setDescription('Entries of the x25StatTable.')
x25StatIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 1), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatIndex.setDescription('The ifIndex value for the X.25 interface.')
x25StatInCalls = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInCalls.setDescription('The number of incoming calls received.')
x25StatInCallRefusals = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInCallRefusals.setDescription('The number of incoming calls refused. This\n includes calls refused by the PLE and by\n higher layers. This also includes calls\n cleared because of restricted fast select.')
x25StatInProviderInitiatedClears = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInProviderInitiatedClears.setDescription('The number of clear requests with a cause\n code other than DTE initiated.')
x25StatInRemotelyInitiatedResets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInRemotelyInitiatedResets.setDescription('The number of reset requests received with\n\n\n cause code DTE initiated.')
x25StatInProviderInitiatedResets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInProviderInitiatedResets.setDescription('The number of reset requests received with\n cause code other than DTE initiated.')
x25StatInRestarts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInRestarts.setDescription('The number of remotely initiated (including\n provider initiated) restarts experienced by\n the PLE excluding the restart associated\n with bringing up the PLE interface. This\n only counts restarts received when the PLE\n already has an established connection with\n the remove PLE.')
x25StatInDataPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInDataPackets.setDescription('The number of data packets received.')
x25StatInAccusedOfProtocolErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInAccusedOfProtocolErrors.setDescription('The number of packets received containing a\n procedure error cause code. These include\n clear, reset, restart, or diagnostic\n packets.')
x25StatInInterrupts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInInterrupts.setDescription('The number of interrupt packets received by\n the PLE or over the PVC/VC.')
x25StatOutCallAttempts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatOutCallAttempts.setDescription('The number of calls attempted.')
x25StatOutCallFailures = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatOutCallFailures.setDescription('The number of call attempts which failed.\n This includes calls that were cleared\n because of restrictive fast select.')
x25StatOutInterrupts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatOutInterrupts.setDescription('The number of interrupt packets send by the\n PLE or over the PVC/VC.')
x25StatOutDataPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatOutDataPackets.setDescription('The number of data packets sent by this\n PLE.')
x25StatOutgoingCircuits = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 15), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatOutgoingCircuits.setDescription('The number of active outgoing circuits.\n This includes call requests sent but not yet\n confirmed. This does not count PVCs.')
x25StatIncomingCircuits = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 16), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatIncomingCircuits.setDescription('The number of active Incoming Circuits.\n This includes call indications received but\n not yet acknowledged. This does not count\n PVCs.')
x25StatTwowayCircuits = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 17), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatTwowayCircuits.setDescription('The number of active two-way Circuits.\n This includes call requests sent but not yet\n confirmed. This does not count PVCs.')
x25StatRestartTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatRestartTimeouts.setDescription('The number of times the T20 restart timer\n expired.')
x25StatCallTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatCallTimeouts.setDescription('The number of times the T21 call timer\n expired.')
x25StatResetTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatResetTimeouts.setDescription('The number of times the T22 reset timer\n expired.')
x25StatClearTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatClearTimeouts.setDescription('The number of times the T23 clear timer\n expired.')
x25StatDataRxmtTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatDataRxmtTimeouts.setDescription('The number of times the T25 data timer\n expired.')
x25StatInterruptTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatInterruptTimeouts.setDescription('The number of times the T26 interrupt timer\n expired.')
x25StatRetryCountExceededs = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatRetryCountExceededs.setDescription('The number of times a retry counter was\n exhausted.')
x25StatClearCountExceededs = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 25), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25StatClearCountExceededs.setDescription('The number of times the R23 clear count was\n exceeded.')
x25ChannelTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 4), )
if mibBuilder.loadTexts: x25ChannelTable.setDescription('These objects contain information about the\n channel number configuration in an X.25 PLE.\n These values are the configured values.\n changes in these values after the interfaces\n has started may not be reflected in the\n operating PLE.')
x25ChannelEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 4, 1), ).setIndexNames((0, "RFC1382-MIB", "x25ChannelIndex"))
if mibBuilder.loadTexts: x25ChannelEntry.setDescription('Entries of x25ChannelTable.')
x25ChannelIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 1), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ChannelIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25ChannelLIC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelLIC.setDescription('Lowest Incoming channel.')
x25ChannelHIC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelHIC.setDescription('Highest Incoming channel. A value of zero\n indicates no channels in this range.')
x25ChannelLTC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelLTC.setDescription('Lowest Two-way channel.')
x25ChannelHTC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelHTC.setDescription('Highest Two-way channel. A value of zero\n indicates no channels in this range.')
x25ChannelLOC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelLOC.setDescription('Lowest outgoing channel.')
x25ChannelHOC = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ChannelHOC.setDescription('Highest outgoing channel. A value of zero\n\n\n indicates no channels in this range.')
x25CircuitTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 5), )
if mibBuilder.loadTexts: x25CircuitTable.setDescription('These objects contain general information\n about a specific circuit of an X.25 PLE.')
x25CircuitEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 5, 1), ).setIndexNames((0, "RFC1382-MIB", "x25CircuitIndex"), (0, "RFC1382-MIB", "x25CircuitChannel"))
if mibBuilder.loadTexts: x25CircuitEntry.setDescription('Entries of x25CircuitTable.')
x25CircuitIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 1), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25CircuitChannel = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitChannel.setDescription('The channel number for this circuit.')
x25CircuitStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,))).clone(namedValues=NamedValues(("invalid", 1), ("closed", 2), ("calling", 3), ("open", 4), ("clearing", 5), ("pvc", 6), ("pvcResetting", 7), ("startClear", 8), ("startPvcResetting", 9), ("other", 10),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitStatus.setDescription("This object reports the current status of\n the circuit.\n\n An existing instance of this object can only\n be set to startClear, startPvcResetting, or\n invalid. An instance with the value calling\n or open can only be set to startClear and\n that action will start clearing the circuit.\n An instance with the value PVC can only be\n set to startPvcResetting or invalid and that\n action resets the PVC or deletes the circuit\n respectively. The values startClear or\n startPvcResetting will never be returned by\n an agent. An attempt to set the status of\n an existing instance to a value other than\n one of these values will result in an error.\n\n A non-existing instance can be set to PVC to\n create a PVC if the implementation supports\n dynamic creation of PVCs. Some\n implementations may only allow creation and\n deletion of PVCs if the interface is down.\n Since the instance identifier will supply\n the PLE index and the channel number,\n setting this object alone supplies\n sufficient information to create the\n instance. All the DEFVAL clauses for the\n other objects of this table are appropriate\n for creating a PVC; PLEs creating entries\n for placed or accepted calls will use values\n appropriate for the call rather than the\n value of the DEFVAL clause. Two managers\n trying to create the same PVC can determine\n from the return code which manager succeeded\n and which failed (the failing manager fails\n because it can not set a value of PVC for an\n existing object).\n\n\n An entry in the closed or invalid state may\n be deleted or reused at the agent's\n convence. If the entry is kept in the\n closed state, the values of the parameters\n associated with the entry must be correct.\n Closed implies the values in the circuit\n table are correct.\n\n The value of invalid indicates the other\n values in the table are invalid. Many\n agents may never return a value of invalid\n because they dynamically allocate and free\n unused table entries. An agent for a\n statically configured systems can return\n invalid to indicate the entry has not yet\n been used so the counters contain no\n information.")
x25CircuitEstablishTime = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 4), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitEstablishTime.setDescription('The value of sysUpTime when the channel was\n associated with this circuit. For outgoing\n SVCs, this is the time the first call packet\n was sent. For incoming SVCs, this is the\n time the call indication was received. For\n PVCs this is the time the PVC was able to\n pass data to a higher layer entity without\n loss of data.')
x25CircuitDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("pvc", 3),)).clone('pvc')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitDirection.setDescription('The direction of the call that established\n this circuit.')
x25CircuitInOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInOctets.setDescription('The number of octets of user data delivered\n to upper layer.')
x25CircuitInPdus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInPdus.setDescription('The number of PDUs received for this\n circuit.')
x25CircuitInRemotelyInitiatedResets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInRemotelyInitiatedResets.setDescription('The number of Resets received for this\n circuit with cause code of DTE initiated.')
x25CircuitInProviderInitiatedResets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInProviderInitiatedResets.setDescription('The number of Resets received for this\n circuit with cause code other than DTE\n initiated.')
x25CircuitInInterrupts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInInterrupts.setDescription('The number of interrupt packets received\n for this circuit.')
x25CircuitOutOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitOutOctets.setDescription('The number of octets of user data sent for\n this circuit.')
x25CircuitOutPdus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitOutPdus.setDescription('The number of PDUs sent for this circuit.')
x25CircuitOutInterrupts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitOutInterrupts.setDescription('The number of interrupt packets sent on\n this circuit.')
x25CircuitDataRetransmissionTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitDataRetransmissionTimeouts.setDescription('The number of times the T25 data\n retransmission timer expired for this\n circuit.')
x25CircuitResetTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitResetTimeouts.setDescription('The number of times the T22 reset timer\n expired for this circuit.')
x25CircuitInterruptTimeouts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CircuitInterruptTimeouts.setDescription('The number of times the T26 Interrupt timer\n expired for this circuit.')
x25CircuitCallParamId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 17), ObjectIdentifier()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable which contains the call\n parameters in use with this circuit. The\n entry referenced must contain the values\n that are currently in use by the circuit\n rather than proposed values. A value of\n NULL indicates the circuit is a PVC or is\n using all the default parameters.')
x25CircuitCalledDteAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 18), X121Address().clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitCalledDteAddress.setDescription('For incoming calls, this is the called\n address from the call indication packet.\n For outgoing calls, this is the called\n\n\n address from the call confirmation packet.\n This will be zero length for PVCs.')
x25CircuitCallingDteAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 19), X121Address().clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitCallingDteAddress.setDescription('For incoming calls, this is the calling\n address from the call indication packet.\n For outgoing calls, this is the calling\n address from the call confirmation packet.\n This will be zero length for PVCs.')
x25CircuitOriginallyCalledAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 20), X121Address().clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitOriginallyCalledAddress.setDescription('For incoming calls, this is the address in\n the call Redirection or Call Deflection\n Notification facility if the call was\n deflected or redirected, otherwise it will\n be called address from the call indication\n packet. For outgoing calls, this is the\n address from the call request packet. This\n will be zero length for PVCs.')
x25CircuitDescr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,255)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CircuitDescr.setDescription("A descriptive string associated with this\n circuit. This provides a place for the\n agent to supply any descriptive information\n it knows about the use or owner of the\n circuit. The agent may return the process\n identifier and user name for the process\n\n\n using the circuit. Alternative the agent\n may return the name of the configuration\n entry that caused a bridge to establish the\n circuit. A zero length value indicates the\n agent doesn't have any additional\n information.")
x25ClearedCircuitEntriesRequested = MibScalar((1, 3, 6, 1, 2, 1, 10, 5, 6), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25ClearedCircuitEntriesRequested.setDescription('The requested number of entries for the\n agent to keep in the x25ClearedCircuit\n table.')
x25ClearedCircuitEntriesGranted = MibScalar((1, 3, 6, 1, 2, 1, 10, 5, 7), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitEntriesGranted.setDescription('The actual number of entries the agent will\n keep in the x25ClearedCircuit Table.')
x25ClearedCircuitTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 8), )
if mibBuilder.loadTexts: x25ClearedCircuitTable.setDescription('A table of entries about closed circuits.\n Entries must be made in this table whenever\n circuits are closed and the close request or\n close indication packet contains a clearing\n cause other than DTE Originated or a\n Diagnostic code field other than Higher\n Layer Initiated disconnection-normal. An\n agent may optionally make entries for normal\n closes (to record closing facilities or\n\n\n other information).\n\n Agents will delete the oldest entry in the\n table when adding a new entry would exceed\n agent resources. Agents are required to\n keep the last entry put in the table and may\n keep more entries. The object\n x25OperClearEntriesGranted returns the\n maximum number of entries kept in the\n table.')
x25ClearedCircuitEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 8, 1), ).setIndexNames((0, "RFC1382-MIB", "x25ClearedCircuitIndex"))
if mibBuilder.loadTexts: x25ClearedCircuitEntry.setDescription('Information about a cleared circuit.')
x25ClearedCircuitIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 1), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitIndex.setDescription('An index that uniquely distinguishes one\n entry in the clearedCircuitTable from\n another. This index will start at\n 2147483647 and will decrease by one for each\n new entry added to the table. Upon reaching\n one, the index will reset to 2147483647.\n Because the index starts at 2147483647 and\n decreases, a manager may do a getnext on\n entry zero and obtain the most recent entry.\n When the index has the value of 1, the next\n entry will delete all entries in the table\n and that entry will be numbered 2147483647.')
x25ClearedCircuitPleIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 2), IfIndexType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitPleIndex.setDescription('The value of ifIndex for the PLE which\n cleared the circuit that created the entry.')
x25ClearedCircuitTimeEstablished = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 3), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitTimeEstablished.setDescription('The value of sysUpTime when the circuit was\n established. This will be the same value\n that was in the x25CircuitEstablishTime for\n the circuit.')
x25ClearedCircuitTimeCleared = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 4), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitTimeCleared.setDescription('The value of sysUpTime when the circuit was\n cleared. For locally initiated clears, this\n\n\n will be the time when the clear confirmation\n was received. For remotely initiated\n clears, this will be the time when the clear\n indication was received.')
x25ClearedCircuitChannel = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4095))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitChannel.setDescription('The channel number for the circuit that was\n cleared.')
x25ClearedCircuitClearingCause = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitClearingCause.setDescription('The Clearing Cause from the clear request\n or clear indication packet that cleared the\n circuit.')
x25ClearedCircuitDiagnosticCode = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitDiagnosticCode.setDescription('The Diagnostic Code from the clear request\n or clear indication packet that cleared the\n circuit.')
x25ClearedCircuitInPdus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitInPdus.setDescription('The number of PDUs received on the\n circuit.')
x25ClearedCircuitOutPdus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitOutPdus.setDescription('The number of PDUs transmitted on the\n circuit.')
x25ClearedCircuitCalledAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 10), X121Address()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitCalledAddress.setDescription('The called address from the cleared\n circuit.')
x25ClearedCircuitCallingAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 11), X121Address()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitCallingAddress.setDescription('The calling address from the cleared\n circuit.')
x25ClearedCircuitClearFacilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,109))).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25ClearedCircuitClearFacilities.setDescription('The facilities field from the clear request\n or clear indication packet that cleared the\n circuit. A size of zero indicates no\n facilities were present.')
x25CallParmTable = MibTable((1, 3, 6, 1, 2, 1, 10, 5, 9), )
if mibBuilder.loadTexts: x25CallParmTable.setDescription('These objects contain the parameters that\n can be varied between X.25 calls. The\n entries in this table are independent of the\n PLE. There exists only one of these tables\n for the entire system. The indexes for the\n entries are independent of any PLE or any\n circuit. Other tables reference entries in\n this table. Entries in this table can be\n used for default PLE parameters, for\n parameters to use to place/answer a call,\n for the parameters currently in use for a\n circuit, or parameters that were used by a\n circuit.\n\n The number of references to a given set of\n parameters can be found in the\n x25CallParmRefCount object sharing the same\n instance identifier with the parameters.\n The value of this reference count also\n affects the access of the objects in this\n table. An object in this table with the\n same instance identifier as the instance\n identifier of an x25CallParmRefCount must be\n consider associated with that reference\n count. An object with an associated\n reference count of zero can be written (if\n its ACCESS clause allows it). An object\n with an associated reference count greater\n than zero can not be written (regardless of\n the ACCESS clause). This ensures that a set\n of call parameters being referenced from\n another table can not be modified or changed\n in a ways inappropriate for continued use by\n that table.')
x25CallParmEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 5, 9, 1), ).setIndexNames((0, "RFC1382-MIB", "x25CallParmIndex"))
if mibBuilder.loadTexts: x25CallParmEntry.setDescription('Entries of x25CallParmTable.')
x25CallParmIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 1), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CallParmIndex.setDescription('A value that distinguishes this entry from\n another entry. Entries in this table are\n referenced from other objects which identify\n call parameters.\n\n It is impossible to know which other objects\n in the MIB reference entries in the table by\n looking at this table. Because of this,\n changes to parameters must be accomplished\n by creating a new entry in this table and\n then changing the referencing table to\n identify the new entry.\n\n Note that an agent will only use the values\n in this table when another table is changed\n to reference those values. The number of\n other tables that reference an index object\n in this table can be found in\n x25CallParmRefCount. The value of the\n reference count will affect the writability\n of the objects as explained above.\n\n Entries in this table which have a reference\n count of zero maybe deleted at the convence\n of the agent. Care should be taken by the\n agent to give the NMS sufficient time to\n create a reference to newly created entries.\n\n Should a Management Station not find a free\n index with which to create a new entry, it\n may feel free to delete entries with a\n\n\n reference count of zero. However in doing\n so the Management Station much realize it\n may impact other Management Stations.')
x25CallParmStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 2), EntryStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmStatus.setDescription('The status of this call parameter entry.\n See RFC 1271 for details of usage.')
x25CallParmRefCount = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 3), PositiveInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: x25CallParmRefCount.setDescription('The number of references know by a\n management station to exist to this set of\n call parameters. This is the number of\n other objects that have returned a value of,\n and will return a value of, the index for\n this set of call parameters. Examples of\n such objects are the x25AdmnDefCallParamId,\n x25OperDataLinkId, or x25AdmnDefCallParamId\n objects defined above.')
x25CallParmInPacketSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096)).clone(128)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmInPacketSize.setDescription('The maximum receive packet size in octets\n for a circuit. A size of zero for a circuit\n means use the PLE default size. A size of\n zero for the PLE means use a default size of\n 128.')
x25CallParmOutPacketSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,4096)).clone(128)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmOutPacketSize.setDescription('The maximum transmit packet size in octets\n for a circuit. A size of zero for a circuit\n means use the PLE default size. A size of\n zero for the PLE default means use a default\n size of 128.')
x25CallParmInWindowSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,127)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmInWindowSize.setDescription('The receive window size for a circuit. A\n size of zero for a circuit means use the PLE\n default size. A size of zero for the PLE\n default means use 2.')
x25CallParmOutWindowSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,127)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmOutWindowSize.setDescription('The transmit window size for a circuit. A\n size of zero for a circuit means use the PLE\n default size. A size of zero for the PLE\n default means use 2.')
x25CallParmAcceptReverseCharging = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("default", 1), ("accept", 2), ("refuse", 3), ("neverAccept", 4),)).clone('refuse')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmAcceptReverseCharging.setDescription('An enumeration defining if the PLE will\n accept or refuse charges. A value of\n default for a circuit means use the PLE\n default value. A value of neverAccept is\n only used for the PLE default and indicates\n the PLE will never accept reverse charging.\n A value of default for a PLE default means\n refuse.')
x25CallParmProposeReverseCharging = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("default", 1), ("reverse", 2), ("local", 3),)).clone('local')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmProposeReverseCharging.setDescription('An enumeration defining if the PLE should\n propose reverse or local charging. The\n value of default for a circuit means use the\n PLE default. The value of default for the\n PLE default means use local.')
x25CallParmFastSelect = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("default", 1), ("notSpecified", 2), ("fastSelect", 3), ("restrictedFastResponse", 4), ("noFastSelect", 5), ("noRestrictedFastResponse", 6),)).clone('noFastSelect')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmFastSelect.setDescription('Expresses preference for use of fast select\n facility. The value of default for a\n circuit is the PLE default. A value of\n\n\n default for the PLE means noFastSelect. A\n value of noFastSelect or\n noRestrictedFastResponse indicates a circuit\n may not use fast select or restricted fast\n response.')
x25CallParmInThruPutClasSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,))).clone(namedValues=NamedValues(("tcReserved1", 1), ("tcReserved2", 2), ("tc75", 3), ("tc150", 4), ("tc300", 5), ("tc600", 6), ("tc1200", 7), ("tc2400", 8), ("tc4800", 9), ("tc9600", 10), ("tc19200", 11), ("tc48000", 12), ("tc64000", 13), ("tcReserved14", 14), ("tcReserved15", 15), ("tcReserved0", 16), ("tcNone", 17), ("tcDefault", 18),)).clone('tcNone')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmInThruPutClasSize.setDescription('The incoming throughput class to negotiate.\n A value of tcDefault for a circuit means use\n the PLE default. A value of tcDefault for\n the PLE default means tcNone. A value of\n tcNone means do not negotiate throughtput\n class.')
x25CallParmOutThruPutClasSize = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,))).clone(namedValues=NamedValues(("tcReserved1", 1), ("tcReserved2", 2), ("tc75", 3), ("tc150", 4), ("tc300", 5), ("tc600", 6), ("tc1200", 7), ("tc2400", 8), ("tc4800", 9), ("tc9600", 10), ("tc19200", 11), ("tc48000", 12), ("tc64000", 13), ("tcReserved14", 14), ("tcReserved15", 15), ("tcReserved0", 16), ("tcNone", 17), ("tcDefault", 18),)).clone('tcNone')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmOutThruPutClasSize.setDescription('The outgoing throughput class to negotiate.\n A value of tcDefault for a circuit means use\n the PLE default. A value of tcDefault for\n the PLE default means use tcNone. A value\n of tcNone means do not negotiate throughtput\n class.')
x25CallParmCug = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,4)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCug.setDescription('The Closed User Group to specify. This\n consists of two or four octets containing\n the characters 0 through 9. A zero length\n string indicates no facility requested. A\n string length of three containing the\n characters DEF for a circuit means use the\n PLE default, (the PLE default parameter may\n not reference an entry of DEF.)')
x25CallParmCugoa = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,4)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCugoa.setDescription('The Closed User Group with Outgoing Access\n to specify. This consists of two or four\n octets containing the characters 0 through\n 9. A string length of three containing the\n characters DEF for a circuit means use the\n PLE default (the PLE default parameters may\n not reference an entry of DEF). A zero\n length string indicates no facility\n requested.')
x25CallParmBcug = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,3)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmBcug.setDescription('The Bilateral Closed User Group to specify.\n This consists of two octets containing the\n characters 0 through 9. A string length of\n three containing the characters DEF for a\n circuit means use the PLE default (the PLE\n default parameter may not reference an entry\n of DEF). A zero length string indicates no\n facility requested.')
x25CallParmNui = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,108)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmNui.setDescription('The Network User Identifier facility. This\n is binary value to be included immediately\n after the length field. The PLE will supply\n the length octet. A zero length string\n indicates no facility requested. This value\n is ignored for the PLE default parameters\n entry.')
x25CallParmChargingInfo = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("default", 1), ("noFacility", 2), ("noChargingInfo", 3), ("chargingInfo", 4),)).clone('noFacility')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmChargingInfo.setDescription('The charging Information facility. A value\n of default for a circuit means use the PLE\n default. The value of default for the\n default PLE parameters means use noFacility.\n The value of noFacility means do not include\n a facility.')
x25CallParmRpoa = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,108)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmRpoa.setDescription('The RPOA facility. The octet string\n contains n * 4 sequences of the characters\n 0-9 to specify a facility with n entries.\n The octet string containing the 3 characters\n DEF for a circuit specifies use of the PLE\n default (the entry for the PLE default may\n not contain DEF). A zero length string\n indicates no facility requested.')
x25CallParmTrnstDly = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65537)).clone(65536)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmTrnstDly.setDescription('The Transit Delay Selection and Indication\n value. A value of 65536 indicates no\n facility requested. A value of 65537 for a\n circuit means use the PLE default (the PLE\n\n\n default parameters entry may not use the\n value 65537). The value 65535 may only be\n used to indicate the value in use by a\n circuit.')
x25CallParmCallingExt = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 20), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,40)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCallingExt.setDescription('The Calling Extension facility. This\n contains one of the following:\n\n A sequence of hex digits with the value to\n be put in the facility. These digits will be\n converted to binary by the agent and put in\n the facility. These octets do not include\n the length octet.\n\n A value containing the three character DEF\n for a circuit means use the PLE default,\n (the entry for the PLE default parameters\n may not use the value DEF).\n\n A zero length string indicates no facility\n requested.')
x25CallParmCalledExt = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,40)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCalledExt.setDescription('The Called Extension facility. This\n contains one of the following:\n\n A sequence of hex digits with the value to\n be put in the facility. These digits will be\n converted to binary by the agent and put in\n the facility. These octets do not include\n\n\n the length octet.\n\n A value containing the three character DEF\n for a circuit means use the PLE default,\n (the entry for the PLE default parameters\n may not use the value DEF).\n\n A zero length string indicates no facility\n requested.')
x25CallParmInMinThuPutCls = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,17)).clone(17)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmInMinThuPutCls.setDescription('The minimum input throughput Class. A\n value of 16 for a circuit means use the PLE\n default (the PLE parameters entry may not\n use this value). A value of 17 indicates no\n facility requested.')
x25CallParmOutMinThuPutCls = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,17)).clone(17)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmOutMinThuPutCls.setDescription('The minimum output throughput Class. A\n value of 16 for a circuit means use the PLE\n default (the PLE parameters entry may not\n use this value). A value of 17 indicates no\n facility requested.')
x25CallParmEndTrnsDly = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 24), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,6)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmEndTrnsDly.setDescription('The End-to-End Transit Delay to negotiate.\n An octet string of length 2, 4, or 6\n\n\n contains the facility encoded as specified\n in ISO/IEC 8208 section 15.3.2.4. An octet\n string of length 3 containing the three\n character DEF for a circuit means use the\n PLE default (the entry for the PLE default\n can not contain the characters DEF). A zero\n length string indicates no facility\n requested.')
x25CallParmPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 25), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,6)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmPriority.setDescription('The priority facility to negotiate. The\n octet string encoded as specified in ISO/IEC\n 8208 section 15.3.2.5. A zero length string\n indicates no facility requested. The entry\n for the PLE default parameters must be zero\n length.')
x25CallParmProtection = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 26), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,108)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmProtection.setDescription('A string contains the following:\n A hex string containing the value for the\n protection facility. This will be converted\n from hex to the octets actually in the\n packet by the agent. The agent will supply\n the length field and the length octet is not\n contained in this string.\n\n An string containing the 3 characters DEF\n for a circuit means use the PLE default (the\n entry for the PLE default parameters may not\n use the value DEF).\n\n A zero length string mean no facility\n requested.')
x25CallParmExptData = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("default", 1), ("noExpeditedData", 2), ("expeditedData", 3),)).clone('noExpeditedData')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmExptData.setDescription('The Expedited Data facility to negotiate.\n A value of default for a circuit means use\n the PLE default value. The entry for the\n PLE default parameters may not have the\n value default.')
x25CallParmUserData = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 28), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,128)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmUserData.setDescription('The call user data as placed in the packet.\n A zero length string indicates no call user\n data. If both the circuit call parameters\n and the PLE default have call user data\n defined, the data from the circuit call\n parameters will be used. If only the PLE\n has data defined, the PLE entry will be\n used. If neither the circuit call\n parameters or the PLE default entry has a\n value, no call user data will be sent.')
x25CallParmCallingNetworkFacilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 29), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,108)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCallingNetworkFacilities.setDescription('The calling network facilities. The\n facilities are encoded here exactly as\n encoded in the call packet. These\n\n\n facilities do not include the marker\n facility code.\n\n A zero length string in the entry for the\n parameter to use when establishing a circuit\n means use the PLE default. A zero length\n string in the entry for PLE default\n parameters indicates no default facilities.')
x25CallParmCalledNetworkFacilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 30), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,108)).clone(hexValue="")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: x25CallParmCalledNetworkFacilities.setDescription('The called network facilities. The\n facilities are encoded here exactly as\n encoded in the call packet. These\n facilities do not include the marker\n facility code.\n\n A zero length string in the entry for the\n parameter to use when establishing a circuit\n means use the PLE default. A zero length\n string in the entry for PLE default\n parameters indicates no default facilities.')
x25Restart = NotificationType((1, 3, 6, 1, 2, 1, 10, 5) + (0,1)).setObjects(*(("RFC1382-MIB", "x25OperIndex"),))
if mibBuilder.loadTexts: x25Restart.setDescription('This trap means the X.25 PLE sent or\n received a restart packet. The restart that\n brings up the link should not send a\n x25Restart trap so the interface should send\n a linkUp trap. Sending this trap means the\n agent does not send a linkDown and linkUp\n trap.')
x25Reset = NotificationType((1, 3, 6, 1, 2, 1, 10, 5) + (0,2)).setObjects(*(("RFC1382-MIB", "x25CircuitIndex"), ("RFC1382-MIB", "x25CircuitChannel"),))
if mibBuilder.loadTexts: x25Reset.setDescription('If the PLE sends or receives a reset, the\n agent should send an x25Reset trap.')
x25ProtocolVersion = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10))
x25protocolCcittV1976 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 1))
x25protocolCcittV1980 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 2))
x25protocolCcittV1984 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 3))
x25protocolCcittV1988 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 4))
x25protocolIso8208V1987 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 5))
x25protocolIso8208V1989 = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 6))
mibBuilder.exportSymbols("RFC1382-MIB", x25CallParmAcceptReverseCharging=x25CallParmAcceptReverseCharging, x25StatRetryCountExceededs=x25StatRetryCountExceededs, x25StatEntry=x25StatEntry, x25StatOutInterrupts=x25StatOutInterrupts, x25StatInCalls=x25StatInCalls, x25StatInRestarts=x25StatInRestarts, x25ClearedCircuitIndex=x25ClearedCircuitIndex, x25CallParmFastSelect=x25CallParmFastSelect, x25CircuitOutOctets=x25CircuitOutOctets, x25AdmnRestartCount=x25AdmnRestartCount, x25OperRejectTimer=x25OperRejectTimer, x25ChannelLIC=x25ChannelLIC, x25ChannelTable=x25ChannelTable, x25AdmnPacketSequencing=x25AdmnPacketSequencing, x25StatIndex=x25StatIndex, x25OperLocalAddress=x25OperLocalAddress, x25AdmnMinimumRecallTimer=x25AdmnMinimumRecallTimer, x25ChannelHTC=x25ChannelHTC, x25StatOutCallFailures=x25StatOutCallFailures, x25Reset=x25Reset, x25StatResetTimeouts=x25StatResetTimeouts, x25CircuitEstablishTime=x25CircuitEstablishTime, x25CallParmInPacketSize=x25CallParmInPacketSize, x25protocolCcittV1976=x25protocolCcittV1976, x25=x25, x25OperDataLinkId=x25OperDataLinkId, x25StatCallTimeouts=x25StatCallTimeouts, x25OperClearCount=x25OperClearCount, x25ClearedCircuitInPdus=x25ClearedCircuitInPdus, x25OperDataRxmtTimer=x25OperDataRxmtTimer, X121Address=X121Address, x25OperResetTimer=x25OperResetTimer, x25StatDataRxmtTimeouts=x25StatDataRxmtTimeouts, x25CallParmCallingExt=x25CallParmCallingExt, x25CallParmCalledNetworkFacilities=x25CallParmCalledNetworkFacilities, x25ClearedCircuitCallingAddress=x25ClearedCircuitCallingAddress, x25AdmnLocalAddress=x25AdmnLocalAddress, x25AdmnMaxActiveCircuits=x25AdmnMaxActiveCircuits, x25CallParmOutMinThuPutCls=x25CallParmOutMinThuPutCls, x25CircuitOutPdus=x25CircuitOutPdus, x25ProtocolVersion=x25ProtocolVersion, x25CircuitOutInterrupts=x25CircuitOutInterrupts, x25CircuitCallParamId=x25CircuitCallParamId, x25OperPacketSequencing=x25OperPacketSequencing, x25AdmnDefCallParamId=x25AdmnDefCallParamId, x25CallParmRefCount=x25CallParmRefCount, x25AdmnResetTimer=x25AdmnResetTimer, x25AdmnRegistrationRequestCount=x25AdmnRegistrationRequestCount, x25CircuitInOctets=x25CircuitInOctets, x25CallParmOutPacketSize=x25CallParmOutPacketSize, x25ClearedCircuitClearingCause=x25ClearedCircuitClearingCause, x25AdmnInterfaceMode=x25AdmnInterfaceMode, x25CircuitInPdus=x25CircuitInPdus, x25CallParmOutThruPutClasSize=x25CallParmOutThruPutClasSize, x25CallParmProtection=x25CallParmProtection, x25OperCallTimer=x25OperCallTimer, x25AdmnRejectCount=x25AdmnRejectCount, x25OperNumberPVCs=x25OperNumberPVCs, x25CircuitOriginallyCalledAddress=x25CircuitOriginallyCalledAddress, x25ClearedCircuitTimeEstablished=x25ClearedCircuitTimeEstablished, x25AdmnIndex=x25AdmnIndex, x25OperTable=x25OperTable, x25CallParmStatus=x25CallParmStatus, x25AdmnClearTimer=x25AdmnClearTimer, x25CallParmCalledExt=x25CallParmCalledExt, x25CallParmEntry=x25CallParmEntry, x25CircuitChannel=x25CircuitChannel, x25StatOutDataPackets=x25StatOutDataPackets, x25OperInterfaceMode=x25OperInterfaceMode, x25AdmnResetCount=x25AdmnResetCount, x25StatOutgoingCircuits=x25StatOutgoingCircuits, x25CircuitCalledDteAddress=x25CircuitCalledDteAddress, x25AdmnCallTimer=x25AdmnCallTimer, x25ChannelHOC=x25ChannelHOC, x25CallParmExptData=x25CallParmExptData, x25CallParmProposeReverseCharging=x25CallParmProposeReverseCharging, x25CircuitDescr=x25CircuitDescr, x25CallParmInMinThuPutCls=x25CallParmInMinThuPutCls, x25ClearedCircuitClearFacilities=x25ClearedCircuitClearFacilities, x25CallParmTrnstDly=x25CallParmTrnstDly, x25CallParmNui=x25CallParmNui, x25StatInProviderInitiatedResets=x25StatInProviderInitiatedResets, x25CallParmChargingInfo=x25CallParmChargingInfo, x25StatRestartTimeouts=x25StatRestartTimeouts, x25protocolCcittV1984=x25protocolCcittV1984, x25protocolIso8208V1987=x25protocolIso8208V1987, x25CircuitIndex=x25CircuitIndex, x25OperRestartTimer=x25OperRestartTimer, x25ClearedCircuitPleIndex=x25ClearedCircuitPleIndex, x25OperInterruptTimer=x25OperInterruptTimer, x25CallParmCug=x25CallParmCug, x25StatTwowayCircuits=x25StatTwowayCircuits, x25AdmnWindowTimer=x25AdmnWindowTimer, x25ClearedCircuitCalledAddress=x25ClearedCircuitCalledAddress, x25ClearedCircuitTimeCleared=x25ClearedCircuitTimeCleared, x25CallParmPriority=x25CallParmPriority, x25OperRegistrationRequestTimer=x25OperRegistrationRequestTimer, x25AdmnClearCount=x25AdmnClearCount, x25protocolCcittV1980=x25protocolCcittV1980, x25protocolCcittV1988=x25protocolCcittV1988, x25ClearedCircuitEntriesGranted=x25ClearedCircuitEntriesGranted, x25CallParmInWindowSize=x25CallParmInWindowSize, x25ChannelLOC=x25ChannelLOC, x25CircuitDataRetransmissionTimeouts=x25CircuitDataRetransmissionTimeouts, x25OperClearTimer=x25OperClearTimer, x25StatOutCallAttempts=x25StatOutCallAttempts, x25CallParmRpoa=x25CallParmRpoa, x25CallParmInThruPutClasSize=x25CallParmInThruPutClasSize, x25ClearedCircuitEntriesRequested=x25ClearedCircuitEntriesRequested, x25StatInterruptTimeouts=x25StatInterruptTimeouts, x25OperIndex=x25OperIndex, x25CallParmUserData=x25CallParmUserData, x25AdmnRejectTimer=x25AdmnRejectTimer, x25ClearedCircuitEntry=x25ClearedCircuitEntry, x25ClearedCircuitTable=x25ClearedCircuitTable, x25protocolIso8208V1989=x25protocolIso8208V1989, x25StatClearCountExceededs=x25StatClearCountExceededs, x25OperMaxActiveCircuits=x25OperMaxActiveCircuits, x25StatInCallRefusals=x25StatInCallRefusals, x25CircuitInRemotelyInitiatedResets=x25CircuitInRemotelyInitiatedResets, x25OperRestartCount=x25OperRestartCount, x25OperProtocolVersionSupported=x25OperProtocolVersionSupported, x25CallParmOutWindowSize=x25CallParmOutWindowSize, x25OperRejectCount=x25OperRejectCount, x25StatIncomingCircuits=x25StatIncomingCircuits, x25ClearedCircuitChannel=x25ClearedCircuitChannel, x25StatInAccusedOfProtocolErrors=x25StatInAccusedOfProtocolErrors, x25CircuitInterruptTimeouts=x25CircuitInterruptTimeouts, x25AdmnNumberPVCs=x25AdmnNumberPVCs, x25OperDefCallParamId=x25OperDefCallParamId, x25AdmnInterruptTimer=x25AdmnInterruptTimer, x25CircuitInProviderInitiatedResets=x25CircuitInProviderInitiatedResets, x25StatInRemotelyInitiatedResets=x25StatInRemotelyInitiatedResets, x25OperResetCount=x25OperResetCount, x25ChannelIndex=x25ChannelIndex, x25ChannelLTC=x25ChannelLTC, x25CallParmTable=x25CallParmTable, x25CallParmCugoa=x25CallParmCugoa, x25AdmnDataRxmtTimer=x25AdmnDataRxmtTimer, x25ChannelEntry=x25ChannelEntry, x25ChannelHIC=x25ChannelHIC, x25CircuitInInterrupts=x25CircuitInInterrupts, x25StatInProviderInitiatedClears=x25StatInProviderInitiatedClears, x25AdmnTable=x25AdmnTable, x25AdmnDataRxmtCount=x25AdmnDataRxmtCount, x25AdmnEntry=x25AdmnEntry, x25ClearedCircuitDiagnosticCode=x25ClearedCircuitDiagnosticCode, x25CircuitResetTimeouts=x25CircuitResetTimeouts, x25Restart=x25Restart, x25CallParmEndTrnsDly=x25CallParmEndTrnsDly, x25CallParmIndex=x25CallParmIndex, x25OperMinimumRecallTimer=x25OperMinimumRecallTimer, x25OperWindowTimer=x25OperWindowTimer, x25AdmnRestartTimer=x25AdmnRestartTimer, x25OperEntry=x25OperEntry, x25CircuitCallingDteAddress=x25CircuitCallingDteAddress, x25CircuitDirection=x25CircuitDirection, x25ClearedCircuitOutPdus=x25ClearedCircuitOutPdus, x25CallParmBcug=x25CallParmBcug, x25StatInInterrupts=x25StatInInterrupts, x25AdmnRegistrationRequestTimer=x25AdmnRegistrationRequestTimer, x25StatTable=x25StatTable, x25AdmnProtocolVersionSupported=x25AdmnProtocolVersionSupported, x25OperRegistrationRequestCount=x25OperRegistrationRequestCount, x25CallParmCallingNetworkFacilities=x25CallParmCallingNetworkFacilities, x25OperDataRxmtCount=x25OperDataRxmtCount, x25CircuitStatus=x25CircuitStatus, x25CircuitTable=x25CircuitTable, x25CircuitEntry=x25CircuitEntry, x25StatInDataPackets=x25StatInDataPackets, x25StatClearTimeouts=x25StatClearTimeouts)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_size_constraint, single_value_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection')
(positive_integer,) = mibBuilder.importSymbols('RFC1253-MIB', 'PositiveInteger')
(entry_status,) = mibBuilder.importSymbols('RFC1271-MIB', 'EntryStatus')
(if_index_type,) = mibBuilder.importSymbols('RFC1381-MIB', 'IfIndexType')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(ip_address, iso, object_identity, mib_identifier, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, counter32, notification_type, transmission, bits, time_ticks, integer32, gauge32, counter64, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'iso', 'ObjectIdentity', 'MibIdentifier', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'Counter32', 'NotificationType', 'transmission', 'Bits', 'TimeTicks', 'Integer32', 'Gauge32', 'Counter64', 'Unsigned32')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
x25 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5))
class X121Address(OctetString):
subtype_spec = OctetString.subtypeSpec + value_size_constraint(0, 17)
x25_admn_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 1))
if mibBuilder.loadTexts:
x25AdmnTable.setDescription('This table contains the administratively\n set configuration parameters for an X.25\n Packet Level Entity (PLE).\n\n Most of the objects in this table have\n corresponding objects in the x25OperTable.\n This table contains the values as last set\n by the administrator. The x25OperTable\n contains the values actually in use by an\n X.25 PLE.\n\n Changing an administrative value may or may\n not change a current operating value. The\n operating value may not change until the\n interface is restarted. Some\n implementations may change the values\n immediately upon changing the administrative\n table. All implementations are required to\n load the values from the administrative\n table when initializing a PLE.')
x25_admn_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 1, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25AdmnIndex'))
if mibBuilder.loadTexts:
x25AdmnEntry.setDescription('Entries of x25AdmnTable.')
x25_admn_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 1), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25AdmnIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25_admn_interface_mode = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('dte', 1), ('dce', 2), ('dxe', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnInterfaceMode.setDescription('Identifies DCE/DTE mode in which the\n interface operates. A value of dxe\n indicates the mode will be determined by XID\n negotiation.')
x25_admn_max_active_circuits = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnMaxActiveCircuits.setDescription('The maximum number of circuits this PLE can\n support; including PVCs.')
x25_admn_packet_sequencing = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('modulo8', 1), ('modulo128', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnPacketSequencing.setDescription('The modulus of the packet sequence number\n space.')
x25_admn_restart_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 5), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRestartTimer.setDescription('The T20 restart timer in milliseconds.')
x25_admn_call_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 6), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnCallTimer.setDescription('The T21 Call timer in milliseconds.')
x25_admn_reset_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 7), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnResetTimer.setDescription('The T22 Reset timer in milliseconds.')
x25_admn_clear_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 8), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnClearTimer.setDescription('The T23 Clear timer in milliseconds.')
x25_admn_window_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 9), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnWindowTimer.setDescription('The T24 window status transmission timer in\n milliseconds. A value of 2147483647\n indicates no window timer in use.')
x25_admn_data_rxmt_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 10), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnDataRxmtTimer.setDescription('The T25 data retransmission timer in\n\n\n milliseconds. A value of 2147483647\n indicates no data retransmission timer in\n use.')
x25_admn_interrupt_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 11), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnInterruptTimer.setDescription('The T26 interrupt timer in milliseconds. A\n value of 2147483647 indicates no interrupt\n timer in use.')
x25_admn_reject_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 12), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRejectTimer.setDescription('The T27 Reject retransmission timer in\n milliseconds. A value of 2147483647\n indicates no reject timer in use.')
x25_admn_registration_request_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 13), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRegistrationRequestTimer.setDescription('The T28 registration timer in milliseconds.\n A value of 2147483647 indicates no\n registration timer in use.')
x25_admn_minimum_recall_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 14), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnMinimumRecallTimer.setDescription('Minimum time interval between unsuccessful\n call attempts in milliseconds.')
x25_admn_restart_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRestartCount.setDescription('The R20 restart retransmission count.')
x25_admn_reset_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnResetCount.setDescription('The r22 Reset retransmission count.')
x25_admn_clear_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnClearCount.setDescription('The r23 Clear retransmission count.')
x25_admn_data_rxmt_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnDataRxmtCount.setDescription('The R25 Data retransmission count. This\n value is irrelevant if the\n x25AdmnDataRxmtTimer indicates no timer in\n use.')
x25_admn_reject_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRejectCount.setDescription('The R27 reject retransmission count. This\n value is irrelevant if the\n x25AdmnRejectTimer indicates no timer in\n use.')
x25_admn_registration_request_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnRegistrationRequestCount.setDescription('The R28 Registration retransmission Count.\n This value is irrelevant if the\n x25AdmnRegistrationRequestTimer indicates no\n timer in use.')
x25_admn_number_pv_cs = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnNumberPVCs.setDescription('The number of PVC configured for this PLE.\n The PVCs use channel numbers from 1 to this\n number.')
x25_admn_def_call_param_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 22), object_identifier()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnDefCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable which contains the default\n call parameters for this PLE.')
x25_admn_local_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 23), x121_address()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnLocalAddress.setDescription('The local address for this PLE subnetwork.\n A zero length address maybe returned by PLEs\n that only support PVCs.')
x25_admn_protocol_version_supported = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 1, 1, 24), object_identifier()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25AdmnProtocolVersionSupported.setDescription('Identifies the version of the X.25 protocol\n this interface should support. Object\n identifiers for common versions are defined\n below in the x25ProtocolVersion subtree.')
x25_oper_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 2))
if mibBuilder.loadTexts:
x25OperTable.setDescription('The operation parameters in use by the X.25\n PLE.')
x25_oper_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 2, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25OperIndex'))
if mibBuilder.loadTexts:
x25OperEntry.setDescription('Entries of x25OperTable.')
x25_oper_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 1), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperIndex.setDescription('The ifIndex value for the X.25 interface.')
x25_oper_interface_mode = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('dte', 1), ('dce', 2), ('dxe', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperInterfaceMode.setDescription('Identifies DCE/DTE mode in which the\n interface operates. A value of dxe\n indicates the role will be determined by XID\n negotiation at the Link Layer and that\n negotiation has not yet taken place.')
x25_oper_max_active_circuits = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperMaxActiveCircuits.setDescription('Maximum number of circuits this PLE can\n support.')
x25_oper_packet_sequencing = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('modulo8', 1), ('modulo128', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperPacketSequencing.setDescription('The modulus of the packet sequence number\n space.')
x25_oper_restart_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 5), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRestartTimer.setDescription('The T20 restart timer in milliseconds.')
x25_oper_call_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 6), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperCallTimer.setDescription('The T21 Call timer in milliseconds.')
x25_oper_reset_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 7), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperResetTimer.setDescription('The T22 Reset timer in milliseconds.')
x25_oper_clear_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 8), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperClearTimer.setDescription('The T23 Clear timer in milliseconds.')
x25_oper_window_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 9), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperWindowTimer.setDescription('The T24 window status transmission timer\n\n\n milliseconds. A value of 2147483647\n indicates no window timer in use.')
x25_oper_data_rxmt_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 10), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperDataRxmtTimer.setDescription('The T25 Data Retransmission timer in\n milliseconds. A value of 2147483647\n indicates no data retransmission timer in\n use.')
x25_oper_interrupt_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 11), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperInterruptTimer.setDescription('The T26 Interrupt timer in milliseconds. A\n value of 2147483647 indicates interrupts are\n not being used.')
x25_oper_reject_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 12), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRejectTimer.setDescription('The T27 Reject retransmission timer in\n milliseconds. A value of 2147483647\n indicates no reject timer in use.')
x25_oper_registration_request_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 13), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRegistrationRequestTimer.setDescription('The T28 registration timer in milliseconds.\n A value of 2147483647 indicates no\n registration timer in use.')
x25_oper_minimum_recall_timer = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 14), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperMinimumRecallTimer.setDescription('Minimum time interval between unsuccessful\n call attempts in milliseconds.')
x25_oper_restart_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRestartCount.setDescription('The R20 restart retransmission count.')
x25_oper_reset_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperResetCount.setDescription('The r22 Reset retransmission count.')
x25_oper_clear_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperClearCount.setDescription('The r23 Clear retransmission count.')
x25_oper_data_rxmt_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperDataRxmtCount.setDescription('The R25 Data retransmission count. This\n value is undefined if the\n x25OperDataRxmtTimer indicates no timer in\n use.')
x25_oper_reject_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRejectCount.setDescription('The R27 reject retransmission count. This\n value is undefined if the x25OperRejectTimer\n indicates no timer in use.')
x25_oper_registration_request_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperRegistrationRequestCount.setDescription('The R28 Registration retransmission Count.\n This value is undefined if the\n x25OperREgistrationRequestTimer indicates no\n timer in use.')
x25_oper_number_pv_cs = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperNumberPVCs.setDescription('The number of PVC configured for this PLE.\n The PVCs use channel numbers from 1 to this\n number.')
x25_oper_def_call_param_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 22), object_identifier()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperDefCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable that contains the default\n call parameters for this PLE.')
x25_oper_local_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 23), x121_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperLocalAddress.setDescription('The local address for this PLE subnetwork.\n A zero length address maybe returned by PLEs\n that only support PVCs.')
x25_oper_data_link_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 24), object_identifier()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperDataLinkId.setDescription('This identifies the instance of the index\n object in the first table of the most device\n specific MIB for the interface used by this\n PLE.')
x25_oper_protocol_version_supported = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 2, 1, 25), object_identifier()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25OperProtocolVersionSupported.setDescription('Identifies the version of the X.25 protocol\n this interface supports. Object identifiers\n for common versions are defined below in the\n x25ProtocolVersion subtree.')
x25_stat_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 3))
if mibBuilder.loadTexts:
x25StatTable.setDescription('Statistics information about this X.25\n PLE.')
x25_stat_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 3, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25StatIndex'))
if mibBuilder.loadTexts:
x25StatEntry.setDescription('Entries of the x25StatTable.')
x25_stat_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 1), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatIndex.setDescription('The ifIndex value for the X.25 interface.')
x25_stat_in_calls = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInCalls.setDescription('The number of incoming calls received.')
x25_stat_in_call_refusals = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInCallRefusals.setDescription('The number of incoming calls refused. This\n includes calls refused by the PLE and by\n higher layers. This also includes calls\n cleared because of restricted fast select.')
x25_stat_in_provider_initiated_clears = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInProviderInitiatedClears.setDescription('The number of clear requests with a cause\n code other than DTE initiated.')
x25_stat_in_remotely_initiated_resets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInRemotelyInitiatedResets.setDescription('The number of reset requests received with\n\n\n cause code DTE initiated.')
x25_stat_in_provider_initiated_resets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInProviderInitiatedResets.setDescription('The number of reset requests received with\n cause code other than DTE initiated.')
x25_stat_in_restarts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInRestarts.setDescription('The number of remotely initiated (including\n provider initiated) restarts experienced by\n the PLE excluding the restart associated\n with bringing up the PLE interface. This\n only counts restarts received when the PLE\n already has an established connection with\n the remove PLE.')
x25_stat_in_data_packets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInDataPackets.setDescription('The number of data packets received.')
x25_stat_in_accused_of_protocol_errors = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInAccusedOfProtocolErrors.setDescription('The number of packets received containing a\n procedure error cause code. These include\n clear, reset, restart, or diagnostic\n packets.')
x25_stat_in_interrupts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInInterrupts.setDescription('The number of interrupt packets received by\n the PLE or over the PVC/VC.')
x25_stat_out_call_attempts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatOutCallAttempts.setDescription('The number of calls attempted.')
x25_stat_out_call_failures = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatOutCallFailures.setDescription('The number of call attempts which failed.\n This includes calls that were cleared\n because of restrictive fast select.')
x25_stat_out_interrupts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 13), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatOutInterrupts.setDescription('The number of interrupt packets send by the\n PLE or over the PVC/VC.')
x25_stat_out_data_packets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatOutDataPackets.setDescription('The number of data packets sent by this\n PLE.')
x25_stat_outgoing_circuits = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 15), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatOutgoingCircuits.setDescription('The number of active outgoing circuits.\n This includes call requests sent but not yet\n confirmed. This does not count PVCs.')
x25_stat_incoming_circuits = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 16), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatIncomingCircuits.setDescription('The number of active Incoming Circuits.\n This includes call indications received but\n not yet acknowledged. This does not count\n PVCs.')
x25_stat_twoway_circuits = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 17), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatTwowayCircuits.setDescription('The number of active two-way Circuits.\n This includes call requests sent but not yet\n confirmed. This does not count PVCs.')
x25_stat_restart_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 18), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatRestartTimeouts.setDescription('The number of times the T20 restart timer\n expired.')
x25_stat_call_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 19), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatCallTimeouts.setDescription('The number of times the T21 call timer\n expired.')
x25_stat_reset_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 20), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatResetTimeouts.setDescription('The number of times the T22 reset timer\n expired.')
x25_stat_clear_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 21), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatClearTimeouts.setDescription('The number of times the T23 clear timer\n expired.')
x25_stat_data_rxmt_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 22), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatDataRxmtTimeouts.setDescription('The number of times the T25 data timer\n expired.')
x25_stat_interrupt_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 23), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatInterruptTimeouts.setDescription('The number of times the T26 interrupt timer\n expired.')
x25_stat_retry_count_exceededs = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 24), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatRetryCountExceededs.setDescription('The number of times a retry counter was\n exhausted.')
x25_stat_clear_count_exceededs = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 3, 1, 25), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25StatClearCountExceededs.setDescription('The number of times the R23 clear count was\n exceeded.')
x25_channel_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 4))
if mibBuilder.loadTexts:
x25ChannelTable.setDescription('These objects contain information about the\n channel number configuration in an X.25 PLE.\n These values are the configured values.\n changes in these values after the interfaces\n has started may not be reflected in the\n operating PLE.')
x25_channel_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 4, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25ChannelIndex'))
if mibBuilder.loadTexts:
x25ChannelEntry.setDescription('Entries of x25ChannelTable.')
x25_channel_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 1), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ChannelIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25_channel_lic = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelLIC.setDescription('Lowest Incoming channel.')
x25_channel_hic = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelHIC.setDescription('Highest Incoming channel. A value of zero\n indicates no channels in this range.')
x25_channel_ltc = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelLTC.setDescription('Lowest Two-way channel.')
x25_channel_htc = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelHTC.setDescription('Highest Two-way channel. A value of zero\n indicates no channels in this range.')
x25_channel_loc = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelLOC.setDescription('Lowest outgoing channel.')
x25_channel_hoc = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 4, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ChannelHOC.setDescription('Highest outgoing channel. A value of zero\n\n\n indicates no channels in this range.')
x25_circuit_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 5))
if mibBuilder.loadTexts:
x25CircuitTable.setDescription('These objects contain general information\n about a specific circuit of an X.25 PLE.')
x25_circuit_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 5, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25CircuitIndex'), (0, 'RFC1382-MIB', 'x25CircuitChannel'))
if mibBuilder.loadTexts:
x25CircuitEntry.setDescription('Entries of x25CircuitTable.')
x25_circuit_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 1), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitIndex.setDescription('The ifIndex value for the X.25 Interface.')
x25_circuit_channel = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitChannel.setDescription('The channel number for this circuit.')
x25_circuit_status = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('invalid', 1), ('closed', 2), ('calling', 3), ('open', 4), ('clearing', 5), ('pvc', 6), ('pvcResetting', 7), ('startClear', 8), ('startPvcResetting', 9), ('other', 10)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitStatus.setDescription("This object reports the current status of\n the circuit.\n\n An existing instance of this object can only\n be set to startClear, startPvcResetting, or\n invalid. An instance with the value calling\n or open can only be set to startClear and\n that action will start clearing the circuit.\n An instance with the value PVC can only be\n set to startPvcResetting or invalid and that\n action resets the PVC or deletes the circuit\n respectively. The values startClear or\n startPvcResetting will never be returned by\n an agent. An attempt to set the status of\n an existing instance to a value other than\n one of these values will result in an error.\n\n A non-existing instance can be set to PVC to\n create a PVC if the implementation supports\n dynamic creation of PVCs. Some\n implementations may only allow creation and\n deletion of PVCs if the interface is down.\n Since the instance identifier will supply\n the PLE index and the channel number,\n setting this object alone supplies\n sufficient information to create the\n instance. All the DEFVAL clauses for the\n other objects of this table are appropriate\n for creating a PVC; PLEs creating entries\n for placed or accepted calls will use values\n appropriate for the call rather than the\n value of the DEFVAL clause. Two managers\n trying to create the same PVC can determine\n from the return code which manager succeeded\n and which failed (the failing manager fails\n because it can not set a value of PVC for an\n existing object).\n\n\n An entry in the closed or invalid state may\n be deleted or reused at the agent's\n convence. If the entry is kept in the\n closed state, the values of the parameters\n associated with the entry must be correct.\n Closed implies the values in the circuit\n table are correct.\n\n The value of invalid indicates the other\n values in the table are invalid. Many\n agents may never return a value of invalid\n because they dynamically allocate and free\n unused table entries. An agent for a\n statically configured systems can return\n invalid to indicate the entry has not yet\n been used so the counters contain no\n information.")
x25_circuit_establish_time = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 4), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitEstablishTime.setDescription('The value of sysUpTime when the channel was\n associated with this circuit. For outgoing\n SVCs, this is the time the first call packet\n was sent. For incoming SVCs, this is the\n time the call indication was received. For\n PVCs this is the time the PVC was able to\n pass data to a higher layer entity without\n loss of data.')
x25_circuit_direction = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incoming', 1), ('outgoing', 2), ('pvc', 3))).clone('pvc')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitDirection.setDescription('The direction of the call that established\n this circuit.')
x25_circuit_in_octets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInOctets.setDescription('The number of octets of user data delivered\n to upper layer.')
x25_circuit_in_pdus = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInPdus.setDescription('The number of PDUs received for this\n circuit.')
x25_circuit_in_remotely_initiated_resets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInRemotelyInitiatedResets.setDescription('The number of Resets received for this\n circuit with cause code of DTE initiated.')
x25_circuit_in_provider_initiated_resets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInProviderInitiatedResets.setDescription('The number of Resets received for this\n circuit with cause code other than DTE\n initiated.')
x25_circuit_in_interrupts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInInterrupts.setDescription('The number of interrupt packets received\n for this circuit.')
x25_circuit_out_octets = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitOutOctets.setDescription('The number of octets of user data sent for\n this circuit.')
x25_circuit_out_pdus = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitOutPdus.setDescription('The number of PDUs sent for this circuit.')
x25_circuit_out_interrupts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 13), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitOutInterrupts.setDescription('The number of interrupt packets sent on\n this circuit.')
x25_circuit_data_retransmission_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitDataRetransmissionTimeouts.setDescription('The number of times the T25 data\n retransmission timer expired for this\n circuit.')
x25_circuit_reset_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 15), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitResetTimeouts.setDescription('The number of times the T22 reset timer\n expired for this circuit.')
x25_circuit_interrupt_timeouts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 16), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CircuitInterruptTimeouts.setDescription('The number of times the T26 Interrupt timer\n expired for this circuit.')
x25_circuit_call_param_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 17), object_identifier()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitCallParamId.setDescription('This identifies the instance of the\n x25CallParmIndex for the entry in the\n x25CallParmTable which contains the call\n parameters in use with this circuit. The\n entry referenced must contain the values\n that are currently in use by the circuit\n rather than proposed values. A value of\n NULL indicates the circuit is a PVC or is\n using all the default parameters.')
x25_circuit_called_dte_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 18), x121_address().clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitCalledDteAddress.setDescription('For incoming calls, this is the called\n address from the call indication packet.\n For outgoing calls, this is the called\n\n\n address from the call confirmation packet.\n This will be zero length for PVCs.')
x25_circuit_calling_dte_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 19), x121_address().clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitCallingDteAddress.setDescription('For incoming calls, this is the calling\n address from the call indication packet.\n For outgoing calls, this is the calling\n address from the call confirmation packet.\n This will be zero length for PVCs.')
x25_circuit_originally_called_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 20), x121_address().clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitOriginallyCalledAddress.setDescription('For incoming calls, this is the address in\n the call Redirection or Call Deflection\n Notification facility if the call was\n deflected or redirected, otherwise it will\n be called address from the call indication\n packet. For outgoing calls, this is the\n address from the call request packet. This\n will be zero length for PVCs.')
x25_circuit_descr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 5, 1, 21), display_string().subtype(subtypeSpec=value_size_constraint(0, 255)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CircuitDescr.setDescription("A descriptive string associated with this\n circuit. This provides a place for the\n agent to supply any descriptive information\n it knows about the use or owner of the\n circuit. The agent may return the process\n identifier and user name for the process\n\n\n using the circuit. Alternative the agent\n may return the name of the configuration\n entry that caused a bridge to establish the\n circuit. A zero length value indicates the\n agent doesn't have any additional\n information.")
x25_cleared_circuit_entries_requested = mib_scalar((1, 3, 6, 1, 2, 1, 10, 5, 6), positive_integer()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25ClearedCircuitEntriesRequested.setDescription('The requested number of entries for the\n agent to keep in the x25ClearedCircuit\n table.')
x25_cleared_circuit_entries_granted = mib_scalar((1, 3, 6, 1, 2, 1, 10, 5, 7), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitEntriesGranted.setDescription('The actual number of entries the agent will\n keep in the x25ClearedCircuit Table.')
x25_cleared_circuit_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 8))
if mibBuilder.loadTexts:
x25ClearedCircuitTable.setDescription('A table of entries about closed circuits.\n Entries must be made in this table whenever\n circuits are closed and the close request or\n close indication packet contains a clearing\n cause other than DTE Originated or a\n Diagnostic code field other than Higher\n Layer Initiated disconnection-normal. An\n agent may optionally make entries for normal\n closes (to record closing facilities or\n\n\n other information).\n\n Agents will delete the oldest entry in the\n table when adding a new entry would exceed\n agent resources. Agents are required to\n keep the last entry put in the table and may\n keep more entries. The object\n x25OperClearEntriesGranted returns the\n maximum number of entries kept in the\n table.')
x25_cleared_circuit_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 8, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25ClearedCircuitIndex'))
if mibBuilder.loadTexts:
x25ClearedCircuitEntry.setDescription('Information about a cleared circuit.')
x25_cleared_circuit_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 1), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitIndex.setDescription('An index that uniquely distinguishes one\n entry in the clearedCircuitTable from\n another. This index will start at\n 2147483647 and will decrease by one for each\n new entry added to the table. Upon reaching\n one, the index will reset to 2147483647.\n Because the index starts at 2147483647 and\n decreases, a manager may do a getnext on\n entry zero and obtain the most recent entry.\n When the index has the value of 1, the next\n entry will delete all entries in the table\n and that entry will be numbered 2147483647.')
x25_cleared_circuit_ple_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 2), if_index_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitPleIndex.setDescription('The value of ifIndex for the PLE which\n cleared the circuit that created the entry.')
x25_cleared_circuit_time_established = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 3), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitTimeEstablished.setDescription('The value of sysUpTime when the circuit was\n established. This will be the same value\n that was in the x25CircuitEstablishTime for\n the circuit.')
x25_cleared_circuit_time_cleared = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 4), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitTimeCleared.setDescription('The value of sysUpTime when the circuit was\n cleared. For locally initiated clears, this\n\n\n will be the time when the clear confirmation\n was received. For remotely initiated\n clears, this will be the time when the clear\n indication was received.')
x25_cleared_circuit_channel = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitChannel.setDescription('The channel number for the circuit that was\n cleared.')
x25_cleared_circuit_clearing_cause = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitClearingCause.setDescription('The Clearing Cause from the clear request\n or clear indication packet that cleared the\n circuit.')
x25_cleared_circuit_diagnostic_code = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitDiagnosticCode.setDescription('The Diagnostic Code from the clear request\n or clear indication packet that cleared the\n circuit.')
x25_cleared_circuit_in_pdus = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitInPdus.setDescription('The number of PDUs received on the\n circuit.')
x25_cleared_circuit_out_pdus = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitOutPdus.setDescription('The number of PDUs transmitted on the\n circuit.')
x25_cleared_circuit_called_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 10), x121_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitCalledAddress.setDescription('The called address from the cleared\n circuit.')
x25_cleared_circuit_calling_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 11), x121_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitCallingAddress.setDescription('The calling address from the cleared\n circuit.')
x25_cleared_circuit_clear_facilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 8, 1, 12), octet_string().subtype(subtypeSpec=value_size_constraint(0, 109))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25ClearedCircuitClearFacilities.setDescription('The facilities field from the clear request\n or clear indication packet that cleared the\n circuit. A size of zero indicates no\n facilities were present.')
x25_call_parm_table = mib_table((1, 3, 6, 1, 2, 1, 10, 5, 9))
if mibBuilder.loadTexts:
x25CallParmTable.setDescription('These objects contain the parameters that\n can be varied between X.25 calls. The\n entries in this table are independent of the\n PLE. There exists only one of these tables\n for the entire system. The indexes for the\n entries are independent of any PLE or any\n circuit. Other tables reference entries in\n this table. Entries in this table can be\n used for default PLE parameters, for\n parameters to use to place/answer a call,\n for the parameters currently in use for a\n circuit, or parameters that were used by a\n circuit.\n\n The number of references to a given set of\n parameters can be found in the\n x25CallParmRefCount object sharing the same\n instance identifier with the parameters.\n The value of this reference count also\n affects the access of the objects in this\n table. An object in this table with the\n same instance identifier as the instance\n identifier of an x25CallParmRefCount must be\n consider associated with that reference\n count. An object with an associated\n reference count of zero can be written (if\n its ACCESS clause allows it). An object\n with an associated reference count greater\n than zero can not be written (regardless of\n the ACCESS clause). This ensures that a set\n of call parameters being referenced from\n another table can not be modified or changed\n in a ways inappropriate for continued use by\n that table.')
x25_call_parm_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 5, 9, 1)).setIndexNames((0, 'RFC1382-MIB', 'x25CallParmIndex'))
if mibBuilder.loadTexts:
x25CallParmEntry.setDescription('Entries of x25CallParmTable.')
x25_call_parm_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 1), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CallParmIndex.setDescription('A value that distinguishes this entry from\n another entry. Entries in this table are\n referenced from other objects which identify\n call parameters.\n\n It is impossible to know which other objects\n in the MIB reference entries in the table by\n looking at this table. Because of this,\n changes to parameters must be accomplished\n by creating a new entry in this table and\n then changing the referencing table to\n identify the new entry.\n\n Note that an agent will only use the values\n in this table when another table is changed\n to reference those values. The number of\n other tables that reference an index object\n in this table can be found in\n x25CallParmRefCount. The value of the\n reference count will affect the writability\n of the objects as explained above.\n\n Entries in this table which have a reference\n count of zero maybe deleted at the convence\n of the agent. Care should be taken by the\n agent to give the NMS sufficient time to\n create a reference to newly created entries.\n\n Should a Management Station not find a free\n index with which to create a new entry, it\n may feel free to delete entries with a\n\n\n reference count of zero. However in doing\n so the Management Station much realize it\n may impact other Management Stations.')
x25_call_parm_status = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 2), entry_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmStatus.setDescription('The status of this call parameter entry.\n See RFC 1271 for details of usage.')
x25_call_parm_ref_count = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 3), positive_integer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
x25CallParmRefCount.setDescription('The number of references know by a\n management station to exist to this set of\n call parameters. This is the number of\n other objects that have returned a value of,\n and will return a value of, the index for\n this set of call parameters. Examples of\n such objects are the x25AdmnDefCallParamId,\n x25OperDataLinkId, or x25AdmnDefCallParamId\n objects defined above.')
x25_call_parm_in_packet_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096)).clone(128)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmInPacketSize.setDescription('The maximum receive packet size in octets\n for a circuit. A size of zero for a circuit\n means use the PLE default size. A size of\n zero for the PLE means use a default size of\n 128.')
x25_call_parm_out_packet_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096)).clone(128)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmOutPacketSize.setDescription('The maximum transmit packet size in octets\n for a circuit. A size of zero for a circuit\n means use the PLE default size. A size of\n zero for the PLE default means use a default\n size of 128.')
x25_call_parm_in_window_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 127)).clone(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmInWindowSize.setDescription('The receive window size for a circuit. A\n size of zero for a circuit means use the PLE\n default size. A size of zero for the PLE\n default means use 2.')
x25_call_parm_out_window_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 127)).clone(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmOutWindowSize.setDescription('The transmit window size for a circuit. A\n size of zero for a circuit means use the PLE\n default size. A size of zero for the PLE\n default means use 2.')
x25_call_parm_accept_reverse_charging = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('default', 1), ('accept', 2), ('refuse', 3), ('neverAccept', 4))).clone('refuse')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmAcceptReverseCharging.setDescription('An enumeration defining if the PLE will\n accept or refuse charges. A value of\n default for a circuit means use the PLE\n default value. A value of neverAccept is\n only used for the PLE default and indicates\n the PLE will never accept reverse charging.\n A value of default for a PLE default means\n refuse.')
x25_call_parm_propose_reverse_charging = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('default', 1), ('reverse', 2), ('local', 3))).clone('local')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmProposeReverseCharging.setDescription('An enumeration defining if the PLE should\n propose reverse or local charging. The\n value of default for a circuit means use the\n PLE default. The value of default for the\n PLE default means use local.')
x25_call_parm_fast_select = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('default', 1), ('notSpecified', 2), ('fastSelect', 3), ('restrictedFastResponse', 4), ('noFastSelect', 5), ('noRestrictedFastResponse', 6))).clone('noFastSelect')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmFastSelect.setDescription('Expresses preference for use of fast select\n facility. The value of default for a\n circuit is the PLE default. A value of\n\n\n default for the PLE means noFastSelect. A\n value of noFastSelect or\n noRestrictedFastResponse indicates a circuit\n may not use fast select or restricted fast\n response.')
x25_call_parm_in_thru_put_clas_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18))).clone(namedValues=named_values(('tcReserved1', 1), ('tcReserved2', 2), ('tc75', 3), ('tc150', 4), ('tc300', 5), ('tc600', 6), ('tc1200', 7), ('tc2400', 8), ('tc4800', 9), ('tc9600', 10), ('tc19200', 11), ('tc48000', 12), ('tc64000', 13), ('tcReserved14', 14), ('tcReserved15', 15), ('tcReserved0', 16), ('tcNone', 17), ('tcDefault', 18))).clone('tcNone')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmInThruPutClasSize.setDescription('The incoming throughput class to negotiate.\n A value of tcDefault for a circuit means use\n the PLE default. A value of tcDefault for\n the PLE default means tcNone. A value of\n tcNone means do not negotiate throughtput\n class.')
x25_call_parm_out_thru_put_clas_size = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18))).clone(namedValues=named_values(('tcReserved1', 1), ('tcReserved2', 2), ('tc75', 3), ('tc150', 4), ('tc300', 5), ('tc600', 6), ('tc1200', 7), ('tc2400', 8), ('tc4800', 9), ('tc9600', 10), ('tc19200', 11), ('tc48000', 12), ('tc64000', 13), ('tcReserved14', 14), ('tcReserved15', 15), ('tcReserved0', 16), ('tcNone', 17), ('tcDefault', 18))).clone('tcNone')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmOutThruPutClasSize.setDescription('The outgoing throughput class to negotiate.\n A value of tcDefault for a circuit means use\n the PLE default. A value of tcDefault for\n the PLE default means use tcNone. A value\n of tcNone means do not negotiate throughtput\n class.')
x25_call_parm_cug = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 13), display_string().subtype(subtypeSpec=value_size_constraint(0, 4)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCug.setDescription('The Closed User Group to specify. This\n consists of two or four octets containing\n the characters 0 through 9. A zero length\n string indicates no facility requested. A\n string length of three containing the\n characters DEF for a circuit means use the\n PLE default, (the PLE default parameter may\n not reference an entry of DEF.)')
x25_call_parm_cugoa = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 14), display_string().subtype(subtypeSpec=value_size_constraint(0, 4)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCugoa.setDescription('The Closed User Group with Outgoing Access\n to specify. This consists of two or four\n octets containing the characters 0 through\n 9. A string length of three containing the\n characters DEF for a circuit means use the\n PLE default (the PLE default parameters may\n not reference an entry of DEF). A zero\n length string indicates no facility\n requested.')
x25_call_parm_bcug = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 15), display_string().subtype(subtypeSpec=value_size_constraint(0, 3)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmBcug.setDescription('The Bilateral Closed User Group to specify.\n This consists of two octets containing the\n characters 0 through 9. A string length of\n three containing the characters DEF for a\n circuit means use the PLE default (the PLE\n default parameter may not reference an entry\n of DEF). A zero length string indicates no\n facility requested.')
x25_call_parm_nui = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 16), octet_string().subtype(subtypeSpec=value_size_constraint(0, 108)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmNui.setDescription('The Network User Identifier facility. This\n is binary value to be included immediately\n after the length field. The PLE will supply\n the length octet. A zero length string\n indicates no facility requested. This value\n is ignored for the PLE default parameters\n entry.')
x25_call_parm_charging_info = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('default', 1), ('noFacility', 2), ('noChargingInfo', 3), ('chargingInfo', 4))).clone('noFacility')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmChargingInfo.setDescription('The charging Information facility. A value\n of default for a circuit means use the PLE\n default. The value of default for the\n default PLE parameters means use noFacility.\n The value of noFacility means do not include\n a facility.')
x25_call_parm_rpoa = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 18), display_string().subtype(subtypeSpec=value_size_constraint(0, 108)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmRpoa.setDescription('The RPOA facility. The octet string\n contains n * 4 sequences of the characters\n 0-9 to specify a facility with n entries.\n The octet string containing the 3 characters\n DEF for a circuit specifies use of the PLE\n default (the entry for the PLE default may\n not contain DEF). A zero length string\n indicates no facility requested.')
x25_call_parm_trnst_dly = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 65537)).clone(65536)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmTrnstDly.setDescription('The Transit Delay Selection and Indication\n value. A value of 65536 indicates no\n facility requested. A value of 65537 for a\n circuit means use the PLE default (the PLE\n\n\n default parameters entry may not use the\n value 65537). The value 65535 may only be\n used to indicate the value in use by a\n circuit.')
x25_call_parm_calling_ext = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 20), display_string().subtype(subtypeSpec=value_size_constraint(0, 40)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCallingExt.setDescription('The Calling Extension facility. This\n contains one of the following:\n\n A sequence of hex digits with the value to\n be put in the facility. These digits will be\n converted to binary by the agent and put in\n the facility. These octets do not include\n the length octet.\n\n A value containing the three character DEF\n for a circuit means use the PLE default,\n (the entry for the PLE default parameters\n may not use the value DEF).\n\n A zero length string indicates no facility\n requested.')
x25_call_parm_called_ext = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 21), display_string().subtype(subtypeSpec=value_size_constraint(0, 40)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCalledExt.setDescription('The Called Extension facility. This\n contains one of the following:\n\n A sequence of hex digits with the value to\n be put in the facility. These digits will be\n converted to binary by the agent and put in\n the facility. These octets do not include\n\n\n the length octet.\n\n A value containing the three character DEF\n for a circuit means use the PLE default,\n (the entry for the PLE default parameters\n may not use the value DEF).\n\n A zero length string indicates no facility\n requested.')
x25_call_parm_in_min_thu_put_cls = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 22), integer32().subtype(subtypeSpec=value_range_constraint(0, 17)).clone(17)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmInMinThuPutCls.setDescription('The minimum input throughput Class. A\n value of 16 for a circuit means use the PLE\n default (the PLE parameters entry may not\n use this value). A value of 17 indicates no\n facility requested.')
x25_call_parm_out_min_thu_put_cls = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 23), integer32().subtype(subtypeSpec=value_range_constraint(0, 17)).clone(17)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmOutMinThuPutCls.setDescription('The minimum output throughput Class. A\n value of 16 for a circuit means use the PLE\n default (the PLE parameters entry may not\n use this value). A value of 17 indicates no\n facility requested.')
x25_call_parm_end_trns_dly = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 24), octet_string().subtype(subtypeSpec=value_size_constraint(0, 6)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmEndTrnsDly.setDescription('The End-to-End Transit Delay to negotiate.\n An octet string of length 2, 4, or 6\n\n\n contains the facility encoded as specified\n in ISO/IEC 8208 section 15.3.2.4. An octet\n string of length 3 containing the three\n character DEF for a circuit means use the\n PLE default (the entry for the PLE default\n can not contain the characters DEF). A zero\n length string indicates no facility\n requested.')
x25_call_parm_priority = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 25), octet_string().subtype(subtypeSpec=value_size_constraint(0, 6)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmPriority.setDescription('The priority facility to negotiate. The\n octet string encoded as specified in ISO/IEC\n 8208 section 15.3.2.5. A zero length string\n indicates no facility requested. The entry\n for the PLE default parameters must be zero\n length.')
x25_call_parm_protection = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 26), display_string().subtype(subtypeSpec=value_size_constraint(0, 108)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmProtection.setDescription('A string contains the following:\n A hex string containing the value for the\n protection facility. This will be converted\n from hex to the octets actually in the\n packet by the agent. The agent will supply\n the length field and the length octet is not\n contained in this string.\n\n An string containing the 3 characters DEF\n for a circuit means use the PLE default (the\n entry for the PLE default parameters may not\n use the value DEF).\n\n A zero length string mean no facility\n requested.')
x25_call_parm_expt_data = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 27), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('default', 1), ('noExpeditedData', 2), ('expeditedData', 3))).clone('noExpeditedData')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmExptData.setDescription('The Expedited Data facility to negotiate.\n A value of default for a circuit means use\n the PLE default value. The entry for the\n PLE default parameters may not have the\n value default.')
x25_call_parm_user_data = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 28), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmUserData.setDescription('The call user data as placed in the packet.\n A zero length string indicates no call user\n data. If both the circuit call parameters\n and the PLE default have call user data\n defined, the data from the circuit call\n parameters will be used. If only the PLE\n has data defined, the PLE entry will be\n used. If neither the circuit call\n parameters or the PLE default entry has a\n value, no call user data will be sent.')
x25_call_parm_calling_network_facilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 29), octet_string().subtype(subtypeSpec=value_size_constraint(0, 108)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCallingNetworkFacilities.setDescription('The calling network facilities. The\n facilities are encoded here exactly as\n encoded in the call packet. These\n\n\n facilities do not include the marker\n facility code.\n\n A zero length string in the entry for the\n parameter to use when establishing a circuit\n means use the PLE default. A zero length\n string in the entry for PLE default\n parameters indicates no default facilities.')
x25_call_parm_called_network_facilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 5, 9, 1, 30), octet_string().subtype(subtypeSpec=value_size_constraint(0, 108)).clone(hexValue='')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
x25CallParmCalledNetworkFacilities.setDescription('The called network facilities. The\n facilities are encoded here exactly as\n encoded in the call packet. These\n facilities do not include the marker\n facility code.\n\n A zero length string in the entry for the\n parameter to use when establishing a circuit\n means use the PLE default. A zero length\n string in the entry for PLE default\n parameters indicates no default facilities.')
x25_restart = notification_type((1, 3, 6, 1, 2, 1, 10, 5) + (0, 1)).setObjects(*(('RFC1382-MIB', 'x25OperIndex'),))
if mibBuilder.loadTexts:
x25Restart.setDescription('This trap means the X.25 PLE sent or\n received a restart packet. The restart that\n brings up the link should not send a\n x25Restart trap so the interface should send\n a linkUp trap. Sending this trap means the\n agent does not send a linkDown and linkUp\n trap.')
x25_reset = notification_type((1, 3, 6, 1, 2, 1, 10, 5) + (0, 2)).setObjects(*(('RFC1382-MIB', 'x25CircuitIndex'), ('RFC1382-MIB', 'x25CircuitChannel')))
if mibBuilder.loadTexts:
x25Reset.setDescription('If the PLE sends or receives a reset, the\n agent should send an x25Reset trap.')
x25_protocol_version = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10))
x25protocol_ccitt_v1976 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 1))
x25protocol_ccitt_v1980 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 2))
x25protocol_ccitt_v1984 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 3))
x25protocol_ccitt_v1988 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 4))
x25protocol_iso8208_v1987 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 5))
x25protocol_iso8208_v1989 = mib_identifier((1, 3, 6, 1, 2, 1, 10, 5, 10, 6))
mibBuilder.exportSymbols('RFC1382-MIB', x25CallParmAcceptReverseCharging=x25CallParmAcceptReverseCharging, x25StatRetryCountExceededs=x25StatRetryCountExceededs, x25StatEntry=x25StatEntry, x25StatOutInterrupts=x25StatOutInterrupts, x25StatInCalls=x25StatInCalls, x25StatInRestarts=x25StatInRestarts, x25ClearedCircuitIndex=x25ClearedCircuitIndex, x25CallParmFastSelect=x25CallParmFastSelect, x25CircuitOutOctets=x25CircuitOutOctets, x25AdmnRestartCount=x25AdmnRestartCount, x25OperRejectTimer=x25OperRejectTimer, x25ChannelLIC=x25ChannelLIC, x25ChannelTable=x25ChannelTable, x25AdmnPacketSequencing=x25AdmnPacketSequencing, x25StatIndex=x25StatIndex, x25OperLocalAddress=x25OperLocalAddress, x25AdmnMinimumRecallTimer=x25AdmnMinimumRecallTimer, x25ChannelHTC=x25ChannelHTC, x25StatOutCallFailures=x25StatOutCallFailures, x25Reset=x25Reset, x25StatResetTimeouts=x25StatResetTimeouts, x25CircuitEstablishTime=x25CircuitEstablishTime, x25CallParmInPacketSize=x25CallParmInPacketSize, x25protocolCcittV1976=x25protocolCcittV1976, x25=x25, x25OperDataLinkId=x25OperDataLinkId, x25StatCallTimeouts=x25StatCallTimeouts, x25OperClearCount=x25OperClearCount, x25ClearedCircuitInPdus=x25ClearedCircuitInPdus, x25OperDataRxmtTimer=x25OperDataRxmtTimer, X121Address=X121Address, x25OperResetTimer=x25OperResetTimer, x25StatDataRxmtTimeouts=x25StatDataRxmtTimeouts, x25CallParmCallingExt=x25CallParmCallingExt, x25CallParmCalledNetworkFacilities=x25CallParmCalledNetworkFacilities, x25ClearedCircuitCallingAddress=x25ClearedCircuitCallingAddress, x25AdmnLocalAddress=x25AdmnLocalAddress, x25AdmnMaxActiveCircuits=x25AdmnMaxActiveCircuits, x25CallParmOutMinThuPutCls=x25CallParmOutMinThuPutCls, x25CircuitOutPdus=x25CircuitOutPdus, x25ProtocolVersion=x25ProtocolVersion, x25CircuitOutInterrupts=x25CircuitOutInterrupts, x25CircuitCallParamId=x25CircuitCallParamId, x25OperPacketSequencing=x25OperPacketSequencing, x25AdmnDefCallParamId=x25AdmnDefCallParamId, x25CallParmRefCount=x25CallParmRefCount, x25AdmnResetTimer=x25AdmnResetTimer, x25AdmnRegistrationRequestCount=x25AdmnRegistrationRequestCount, x25CircuitInOctets=x25CircuitInOctets, x25CallParmOutPacketSize=x25CallParmOutPacketSize, x25ClearedCircuitClearingCause=x25ClearedCircuitClearingCause, x25AdmnInterfaceMode=x25AdmnInterfaceMode, x25CircuitInPdus=x25CircuitInPdus, x25CallParmOutThruPutClasSize=x25CallParmOutThruPutClasSize, x25CallParmProtection=x25CallParmProtection, x25OperCallTimer=x25OperCallTimer, x25AdmnRejectCount=x25AdmnRejectCount, x25OperNumberPVCs=x25OperNumberPVCs, x25CircuitOriginallyCalledAddress=x25CircuitOriginallyCalledAddress, x25ClearedCircuitTimeEstablished=x25ClearedCircuitTimeEstablished, x25AdmnIndex=x25AdmnIndex, x25OperTable=x25OperTable, x25CallParmStatus=x25CallParmStatus, x25AdmnClearTimer=x25AdmnClearTimer, x25CallParmCalledExt=x25CallParmCalledExt, x25CallParmEntry=x25CallParmEntry, x25CircuitChannel=x25CircuitChannel, x25StatOutDataPackets=x25StatOutDataPackets, x25OperInterfaceMode=x25OperInterfaceMode, x25AdmnResetCount=x25AdmnResetCount, x25StatOutgoingCircuits=x25StatOutgoingCircuits, x25CircuitCalledDteAddress=x25CircuitCalledDteAddress, x25AdmnCallTimer=x25AdmnCallTimer, x25ChannelHOC=x25ChannelHOC, x25CallParmExptData=x25CallParmExptData, x25CallParmProposeReverseCharging=x25CallParmProposeReverseCharging, x25CircuitDescr=x25CircuitDescr, x25CallParmInMinThuPutCls=x25CallParmInMinThuPutCls, x25ClearedCircuitClearFacilities=x25ClearedCircuitClearFacilities, x25CallParmTrnstDly=x25CallParmTrnstDly, x25CallParmNui=x25CallParmNui, x25StatInProviderInitiatedResets=x25StatInProviderInitiatedResets, x25CallParmChargingInfo=x25CallParmChargingInfo, x25StatRestartTimeouts=x25StatRestartTimeouts, x25protocolCcittV1984=x25protocolCcittV1984, x25protocolIso8208V1987=x25protocolIso8208V1987, x25CircuitIndex=x25CircuitIndex, x25OperRestartTimer=x25OperRestartTimer, x25ClearedCircuitPleIndex=x25ClearedCircuitPleIndex, x25OperInterruptTimer=x25OperInterruptTimer, x25CallParmCug=x25CallParmCug, x25StatTwowayCircuits=x25StatTwowayCircuits, x25AdmnWindowTimer=x25AdmnWindowTimer, x25ClearedCircuitCalledAddress=x25ClearedCircuitCalledAddress, x25ClearedCircuitTimeCleared=x25ClearedCircuitTimeCleared, x25CallParmPriority=x25CallParmPriority, x25OperRegistrationRequestTimer=x25OperRegistrationRequestTimer, x25AdmnClearCount=x25AdmnClearCount, x25protocolCcittV1980=x25protocolCcittV1980, x25protocolCcittV1988=x25protocolCcittV1988, x25ClearedCircuitEntriesGranted=x25ClearedCircuitEntriesGranted, x25CallParmInWindowSize=x25CallParmInWindowSize, x25ChannelLOC=x25ChannelLOC, x25CircuitDataRetransmissionTimeouts=x25CircuitDataRetransmissionTimeouts, x25OperClearTimer=x25OperClearTimer, x25StatOutCallAttempts=x25StatOutCallAttempts, x25CallParmRpoa=x25CallParmRpoa, x25CallParmInThruPutClasSize=x25CallParmInThruPutClasSize, x25ClearedCircuitEntriesRequested=x25ClearedCircuitEntriesRequested, x25StatInterruptTimeouts=x25StatInterruptTimeouts, x25OperIndex=x25OperIndex, x25CallParmUserData=x25CallParmUserData, x25AdmnRejectTimer=x25AdmnRejectTimer, x25ClearedCircuitEntry=x25ClearedCircuitEntry, x25ClearedCircuitTable=x25ClearedCircuitTable, x25protocolIso8208V1989=x25protocolIso8208V1989, x25StatClearCountExceededs=x25StatClearCountExceededs, x25OperMaxActiveCircuits=x25OperMaxActiveCircuits, x25StatInCallRefusals=x25StatInCallRefusals, x25CircuitInRemotelyInitiatedResets=x25CircuitInRemotelyInitiatedResets, x25OperRestartCount=x25OperRestartCount, x25OperProtocolVersionSupported=x25OperProtocolVersionSupported, x25CallParmOutWindowSize=x25CallParmOutWindowSize, x25OperRejectCount=x25OperRejectCount, x25StatIncomingCircuits=x25StatIncomingCircuits, x25ClearedCircuitChannel=x25ClearedCircuitChannel, x25StatInAccusedOfProtocolErrors=x25StatInAccusedOfProtocolErrors, x25CircuitInterruptTimeouts=x25CircuitInterruptTimeouts, x25AdmnNumberPVCs=x25AdmnNumberPVCs, x25OperDefCallParamId=x25OperDefCallParamId, x25AdmnInterruptTimer=x25AdmnInterruptTimer, x25CircuitInProviderInitiatedResets=x25CircuitInProviderInitiatedResets, x25StatInRemotelyInitiatedResets=x25StatInRemotelyInitiatedResets, x25OperResetCount=x25OperResetCount, x25ChannelIndex=x25ChannelIndex, x25ChannelLTC=x25ChannelLTC, x25CallParmTable=x25CallParmTable, x25CallParmCugoa=x25CallParmCugoa, x25AdmnDataRxmtTimer=x25AdmnDataRxmtTimer, x25ChannelEntry=x25ChannelEntry, x25ChannelHIC=x25ChannelHIC, x25CircuitInInterrupts=x25CircuitInInterrupts, x25StatInProviderInitiatedClears=x25StatInProviderInitiatedClears, x25AdmnTable=x25AdmnTable, x25AdmnDataRxmtCount=x25AdmnDataRxmtCount, x25AdmnEntry=x25AdmnEntry, x25ClearedCircuitDiagnosticCode=x25ClearedCircuitDiagnosticCode, x25CircuitResetTimeouts=x25CircuitResetTimeouts, x25Restart=x25Restart, x25CallParmEndTrnsDly=x25CallParmEndTrnsDly, x25CallParmIndex=x25CallParmIndex, x25OperMinimumRecallTimer=x25OperMinimumRecallTimer, x25OperWindowTimer=x25OperWindowTimer, x25AdmnRestartTimer=x25AdmnRestartTimer, x25OperEntry=x25OperEntry, x25CircuitCallingDteAddress=x25CircuitCallingDteAddress, x25CircuitDirection=x25CircuitDirection, x25ClearedCircuitOutPdus=x25ClearedCircuitOutPdus, x25CallParmBcug=x25CallParmBcug, x25StatInInterrupts=x25StatInInterrupts, x25AdmnRegistrationRequestTimer=x25AdmnRegistrationRequestTimer, x25StatTable=x25StatTable, x25AdmnProtocolVersionSupported=x25AdmnProtocolVersionSupported, x25OperRegistrationRequestCount=x25OperRegistrationRequestCount, x25CallParmCallingNetworkFacilities=x25CallParmCallingNetworkFacilities, x25OperDataRxmtCount=x25OperDataRxmtCount, x25CircuitStatus=x25CircuitStatus, x25CircuitTable=x25CircuitTable, x25CircuitEntry=x25CircuitEntry, x25StatInDataPackets=x25StatInDataPackets, x25StatClearTimeouts=x25StatClearTimeouts) |
def main(filepath):
with open(filepath) as file:
rows = [int(x.strip()) for x in file.readlines()]
rows.append(0)
rows.sort()
rows.append(rows[-1]+3)
current_volts = 0
one_volts = 0
three_volts = 0
for i in range(len(rows)):
if rows[i] - current_volts == 0:
continue
if rows[i] - current_volts == 1:
current_volts = rows[i]
one_volts += 1
continue
if rows[i] - current_volts == 2:
current_volts = rows[i]
continue
if rows[i] - current_volts == 3:
current_volts = rows[i]
three_volts += 1
continue
print("Part a solution: "+ str(three_volts*one_volts))
rows.reverse()
memo = {}
memo[rows[0]] = 1
for i in range(1,len(rows)):
memo[rows[i]] = memo.get(rows[i] + 1, 0) + memo.get(rows[i] + 2, 0) + memo.get(rows[i] + 3, 0)
print("Part b solution: "+ str(memo[0]))
| def main(filepath):
with open(filepath) as file:
rows = [int(x.strip()) for x in file.readlines()]
rows.append(0)
rows.sort()
rows.append(rows[-1] + 3)
current_volts = 0
one_volts = 0
three_volts = 0
for i in range(len(rows)):
if rows[i] - current_volts == 0:
continue
if rows[i] - current_volts == 1:
current_volts = rows[i]
one_volts += 1
continue
if rows[i] - current_volts == 2:
current_volts = rows[i]
continue
if rows[i] - current_volts == 3:
current_volts = rows[i]
three_volts += 1
continue
print('Part a solution: ' + str(three_volts * one_volts))
rows.reverse()
memo = {}
memo[rows[0]] = 1
for i in range(1, len(rows)):
memo[rows[i]] = memo.get(rows[i] + 1, 0) + memo.get(rows[i] + 2, 0) + memo.get(rows[i] + 3, 0)
print('Part b solution: ' + str(memo[0])) |
def find_min_max(nums):
if nums[0]<nums[1]:
min = nums[0]
max = nums[1]
else:
min = nums[1]
max = nums[0]
for i in range(len(nums)-2):
if nums[i+2] < min:
min = nums[i+2]
elif nums[i+2] > max:
max = nums[i+2]
return (min, max)
def main():
print(find_min_max([3, 5, 1, 2, 4, 8]))
if __name__== "__main__":
main() | def find_min_max(nums):
if nums[0] < nums[1]:
min = nums[0]
max = nums[1]
else:
min = nums[1]
max = nums[0]
for i in range(len(nums) - 2):
if nums[i + 2] < min:
min = nums[i + 2]
elif nums[i + 2] > max:
max = nums[i + 2]
return (min, max)
def main():
print(find_min_max([3, 5, 1, 2, 4, 8]))
if __name__ == '__main__':
main() |
def daily_sleeping_hours(hours=7):
return hours
print(daily_sleeping_hours(10))
print(daily_sleeping_hours()) | def daily_sleeping_hours(hours=7):
return hours
print(daily_sleeping_hours(10))
print(daily_sleeping_hours()) |
x=1
grenais = 0
inter = 0
gremio = 0
empate = 0
while x == 1:
y = input().split()
a,b=y
a=int(a)
b=int(b)
grenais = grenais + 1
if a > b:
inter = inter + 1
if a < b:
gremio = gremio + 1
if a == b:
empate = empate + 1
while True:
x = int(input('Novo grenal (1-sim 2-nao)'))
if x == 2 or x == 1:
break
print('{} grenais'.format(grenais))
print('Inter:{}'.format(inter))
print('Gremio:{}'.format(gremio))
print('Empates:{}'.format(empate))
if inter > gremio:
print('Inter venceu mais')
if gremio > inter:
print('Gremio venceu mais')
if gremio == inter:
print('Nao houve vencedor')
| x = 1
grenais = 0
inter = 0
gremio = 0
empate = 0
while x == 1:
y = input().split()
(a, b) = y
a = int(a)
b = int(b)
grenais = grenais + 1
if a > b:
inter = inter + 1
if a < b:
gremio = gremio + 1
if a == b:
empate = empate + 1
while True:
x = int(input('Novo grenal (1-sim 2-nao)'))
if x == 2 or x == 1:
break
print('{} grenais'.format(grenais))
print('Inter:{}'.format(inter))
print('Gremio:{}'.format(gremio))
print('Empates:{}'.format(empate))
if inter > gremio:
print('Inter venceu mais')
if gremio > inter:
print('Gremio venceu mais')
if gremio == inter:
print('Nao houve vencedor') |
#
# PySNMP MIB module SNR-ERD-PRO-Mini (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SNR-ERD-PRO-Mini
# Produced by pysmi-0.3.4 at Mon Apr 29 21:00:58 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ModuleIdentity, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Bits, Unsigned32, MibIdentifier, ObjectIdentity, Counter32, iso, TimeTicks, Counter64, enterprises, IpAddress, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Bits", "Unsigned32", "MibIdentifier", "ObjectIdentity", "Counter32", "iso", "TimeTicks", "Counter64", "enterprises", "IpAddress", "Gauge32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
snr = ModuleIdentity((1, 3, 6, 1, 4, 1, 40418))
snr.setRevisions(('2015-04-29 12:00',))
if mibBuilder.loadTexts: snr.setLastUpdated('201504291200Z')
if mibBuilder.loadTexts: snr.setOrganization('NAG ')
snr_erd = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2)).setLabel("snr-erd")
snr_erd_pro_mini = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5)).setLabel("snr-erd-pro-mini")
measurements = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1))
sensesstate = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2))
management = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3))
counters = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8))
options = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 10))
snrSensors = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1))
temperatureSensors = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1))
powerSensors = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2))
alarmSensCnts = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2))
erdproMiniTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0))
voltageSensor = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageSensor.setStatus('current')
serialS1 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS1.setStatus('current')
serialS2 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS2.setStatus('current')
serialS3 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 12), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS3.setStatus('current')
serialS4 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 13), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS4.setStatus('current')
serialS5 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 14), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS5.setStatus('current')
serialS6 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 15), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS6.setStatus('current')
serialS7 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 16), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS7.setStatus('current')
serialS8 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 17), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS8.setStatus('current')
serialS9 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 18), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS9.setStatus('current')
serialS10 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 19), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialS10.setStatus('current')
temperatureS1 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS1.setStatus('current')
temperatureS2 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS2.setStatus('current')
temperatureS3 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS3.setStatus('current')
temperatureS4 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS4.setStatus('current')
temperatureS5 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS5.setStatus('current')
temperatureS6 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS6.setStatus('current')
temperatureS7 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS7.setStatus('current')
temperatureS8 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS8.setStatus('current')
temperatureS9 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS9.setStatus('current')
temperatureS10 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: temperatureS10.setStatus('current')
voltageS1 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS1.setStatus('current')
currentS1 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS1.setStatus('current')
voltageS2 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS2.setStatus('current')
currentS2 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS2.setStatus('current')
voltageS3 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS3.setStatus('current')
currentS3 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS3.setStatus('current')
voltageS4 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS4.setStatus('current')
currentS4 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS4.setStatus('current')
voltageS5 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS5.setStatus('current')
currentS5 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS5.setStatus('current')
voltageS6 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS6.setStatus('current')
currentS6 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS6.setStatus('current')
voltageS7 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS7.setStatus('current')
currentS7 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS7.setStatus('current')
voltageS8 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS8.setStatus('current')
currentS8 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS8.setStatus('current')
voltageS9 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS9.setStatus('current')
currentS9 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 26), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS9.setStatus('current')
voltageS10 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 28), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: voltageS10.setStatus('current')
currentS10 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 29), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentS10.setStatus('current')
alarmSensor1 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0))).clone(namedValues=NamedValues(("high", 1), ("low", 0)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmSensor1.setStatus('current')
alarmSensor2 = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0))).clone(namedValues=NamedValues(("high", 1), ("low", 0)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmSensor2.setStatus('current')
uSensor = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0))).clone(namedValues=NamedValues(("no", 1), ("yes", 0)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: uSensor.setStatus('current')
smart1State = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 0), ("reset", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: smart1State.setStatus('current')
smart2State = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 0), ("reset", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: smart2State.setStatus('current')
smart1ResetTime = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: smart1ResetTime.setStatus('current')
smart2ResetTime = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: smart2ResetTime.setStatus('current')
alarmSensor1cnt = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2, 1), Counter32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alarmSensor1cnt.setStatus('current')
alarmSensor2cnt = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2, 2), Counter32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alarmSensor2cnt.setStatus('current')
dataType = MibScalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 10, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("integer", 0), ("float", 1), ("ufloat", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dataType.setStatus('current')
aSense1Alarm = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 1))
if mibBuilder.loadTexts: aSense1Alarm.setStatus('current')
aSense1Release = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 2))
if mibBuilder.loadTexts: aSense1Release.setStatus('current')
aSense2Alarm = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 3))
if mibBuilder.loadTexts: aSense2Alarm.setStatus('current')
aSense2Release = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 4))
if mibBuilder.loadTexts: aSense2Release.setStatus('current')
uSenseAlarm = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 9))
if mibBuilder.loadTexts: uSenseAlarm.setStatus('current')
uSenseRelease = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 10))
if mibBuilder.loadTexts: uSenseRelease.setStatus('current')
smart1ThermoOn = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 13))
if mibBuilder.loadTexts: smart1ThermoOn.setStatus('current')
smart1ThermoOff = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 14))
if mibBuilder.loadTexts: smart1ThermoOff.setStatus('current')
smart2ThermoOn = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 15))
if mibBuilder.loadTexts: smart2ThermoOn.setStatus('current')
smart2ThermoOff = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 16))
if mibBuilder.loadTexts: smart2ThermoOff.setStatus('current')
tempSensorAlarm = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 29))
if mibBuilder.loadTexts: tempSensorAlarm.setStatus('current')
tempSensorRelease = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 30))
if mibBuilder.loadTexts: tempSensorRelease.setStatus('current')
voltSensorAlarm = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 31))
if mibBuilder.loadTexts: voltSensorAlarm.setStatus('current')
voltSensorRelease = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 32))
if mibBuilder.loadTexts: voltSensorRelease.setStatus('current')
task1Done = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 36))
if mibBuilder.loadTexts: task1Done.setStatus('current')
task2Done = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 37))
if mibBuilder.loadTexts: task2Done.setStatus('current')
task3Done = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 38))
if mibBuilder.loadTexts: task3Done.setStatus('current')
task4Done = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 39))
if mibBuilder.loadTexts: task4Done.setStatus('current')
pingLost = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 45))
if mibBuilder.loadTexts: pingLost.setStatus('current')
batteryChargeLow = NotificationType((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 47))
if mibBuilder.loadTexts: batteryChargeLow.setStatus('current')
erdProMiniTrapGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 40418, 2, 5, 99)).setObjects(("SNR-ERD-PRO-Mini", "aSense1Alarm"), ("SNR-ERD-PRO-Mini", "aSense1Release"), ("SNR-ERD-PRO-Mini", "aSense2Alarm"), ("SNR-ERD-PRO-Mini", "aSense2Release"), ("SNR-ERD-PRO-Mini", "uSenseAlarm"), ("SNR-ERD-PRO-Mini", "uSenseRelease"), ("SNR-ERD-PRO-Mini", "smart1ThermoOn"), ("SNR-ERD-PRO-Mini", "smart1ThermoOff"), ("SNR-ERD-PRO-Mini", "smart2ThermoOn"), ("SNR-ERD-PRO-Mini", "smart2ThermoOff"), ("SNR-ERD-PRO-Mini", "tempSensorAlarm"), ("SNR-ERD-PRO-Mini", "tempSensorRelease"), ("SNR-ERD-PRO-Mini", "voltSensorAlarm"), ("SNR-ERD-PRO-Mini", "voltSensorRelease"), ("SNR-ERD-PRO-Mini", "task1Done"), ("SNR-ERD-PRO-Mini", "task2Done"), ("SNR-ERD-PRO-Mini", "task3Done"), ("SNR-ERD-PRO-Mini", "task4Done"), ("SNR-ERD-PRO-Mini", "pingLost"), ("SNR-ERD-PRO-Mini", "batteryChargeLow"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
erdProMiniTrapGroup = erdProMiniTrapGroup.setStatus('current')
mibBuilder.exportSymbols("SNR-ERD-PRO-Mini", temperatureS2=temperatureS2, voltageS10=voltageS10, snr=snr, temperatureS8=temperatureS8, smart2ThermoOff=smart2ThermoOff, options=options, temperatureS6=temperatureS6, serialS5=serialS5, pingLost=pingLost, smart1ThermoOff=smart1ThermoOff, alarmSensor1=alarmSensor1, temperatureS9=temperatureS9, currentS2=currentS2, currentS6=currentS6, currentS9=currentS9, serialS6=serialS6, temperatureS4=temperatureS4, currentS10=currentS10, sensesstate=sensesstate, task2Done=task2Done, aSense1Alarm=aSense1Alarm, smart1ThermoOn=smart1ThermoOn, voltageS6=voltageS6, serialS1=serialS1, smart1ResetTime=smart1ResetTime, voltageS9=voltageS9, aSense2Release=aSense2Release, alarmSensor2cnt=alarmSensor2cnt, temperatureS1=temperatureS1, uSensor=uSensor, alarmSensor2=alarmSensor2, currentS3=currentS3, voltSensorRelease=voltSensorRelease, batteryChargeLow=batteryChargeLow, voltageS1=voltageS1, smart2State=smart2State, voltageSensor=voltageSensor, serialS2=serialS2, powerSensors=powerSensors, task1Done=task1Done, tempSensorRelease=tempSensorRelease, erdProMiniTrapGroup=erdProMiniTrapGroup, measurements=measurements, smart2ResetTime=smart2ResetTime, tempSensorAlarm=tempSensorAlarm, voltageS2=voltageS2, serialS8=serialS8, currentS1=currentS1, task4Done=task4Done, snrSensors=snrSensors, voltageS5=voltageS5, temperatureS3=temperatureS3, currentS8=currentS8, counters=counters, voltageS8=voltageS8, serialS10=serialS10, temperatureSensors=temperatureSensors, management=management, snr_erd_pro_mini=snr_erd_pro_mini, alarmSensor1cnt=alarmSensor1cnt, PYSNMP_MODULE_ID=snr, snr_erd=snr_erd, aSense2Alarm=aSense2Alarm, serialS4=serialS4, smart2ThermoOn=smart2ThermoOn, alarmSensCnts=alarmSensCnts, voltSensorAlarm=voltSensorAlarm, currentS7=currentS7, voltageS4=voltageS4, serialS3=serialS3, temperatureS7=temperatureS7, temperatureS10=temperatureS10, serialS7=serialS7, currentS5=currentS5, smart1State=smart1State, currentS4=currentS4, aSense1Release=aSense1Release, uSenseRelease=uSenseRelease, voltageS7=voltageS7, temperatureS5=temperatureS5, voltageS3=voltageS3, task3Done=task3Done, uSenseAlarm=uSenseAlarm, erdproMiniTraps=erdproMiniTraps, dataType=dataType, serialS9=serialS9)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, constraints_union, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(module_identity, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, bits, unsigned32, mib_identifier, object_identity, counter32, iso, time_ticks, counter64, enterprises, ip_address, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'Bits', 'Unsigned32', 'MibIdentifier', 'ObjectIdentity', 'Counter32', 'iso', 'TimeTicks', 'Counter64', 'enterprises', 'IpAddress', 'Gauge32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
snr = module_identity((1, 3, 6, 1, 4, 1, 40418))
snr.setRevisions(('2015-04-29 12:00',))
if mibBuilder.loadTexts:
snr.setLastUpdated('201504291200Z')
if mibBuilder.loadTexts:
snr.setOrganization('NAG ')
snr_erd = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2)).setLabel('snr-erd')
snr_erd_pro_mini = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5)).setLabel('snr-erd-pro-mini')
measurements = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1))
sensesstate = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2))
management = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3))
counters = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8))
options = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 10))
snr_sensors = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1))
temperature_sensors = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1))
power_sensors = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2))
alarm_sens_cnts = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2))
erdpro_mini_traps = mib_identifier((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0))
voltage_sensor = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageSensor.setStatus('current')
serial_s1 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 10), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS1.setStatus('current')
serial_s2 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 11), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS2.setStatus('current')
serial_s3 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 12), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS3.setStatus('current')
serial_s4 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 13), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS4.setStatus('current')
serial_s5 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 14), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS5.setStatus('current')
serial_s6 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 15), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS6.setStatus('current')
serial_s7 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 16), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS7.setStatus('current')
serial_s8 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 17), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS8.setStatus('current')
serial_s9 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 18), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS9.setStatus('current')
serial_s10 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 19), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
serialS10.setStatus('current')
temperature_s1 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS1.setStatus('current')
temperature_s2 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS2.setStatus('current')
temperature_s3 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS3.setStatus('current')
temperature_s4 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS4.setStatus('current')
temperature_s5 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS5.setStatus('current')
temperature_s6 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS6.setStatus('current')
temperature_s7 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS7.setStatus('current')
temperature_s8 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS8.setStatus('current')
temperature_s9 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS9.setStatus('current')
temperature_s10 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
temperatureS10.setStatus('current')
voltage_s1 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS1.setStatus('current')
current_s1 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS1.setStatus('current')
voltage_s2 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS2.setStatus('current')
current_s2 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS2.setStatus('current')
voltage_s3 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS3.setStatus('current')
current_s3 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS3.setStatus('current')
voltage_s4 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS4.setStatus('current')
current_s4 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS4.setStatus('current')
voltage_s5 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS5.setStatus('current')
current_s5 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS5.setStatus('current')
voltage_s6 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS6.setStatus('current')
current_s6 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS6.setStatus('current')
voltage_s7 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS7.setStatus('current')
current_s7 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 20), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS7.setStatus('current')
voltage_s8 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 22), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS8.setStatus('current')
current_s8 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 23), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS8.setStatus('current')
voltage_s9 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 25), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS9.setStatus('current')
current_s9 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 26), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS9.setStatus('current')
voltage_s10 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 28), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
voltageS10.setStatus('current')
current_s10 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 1, 1, 2, 29), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentS10.setStatus('current')
alarm_sensor1 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 0))).clone(namedValues=named_values(('high', 1), ('low', 0)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alarmSensor1.setStatus('current')
alarm_sensor2 = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 0))).clone(namedValues=named_values(('high', 1), ('low', 0)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alarmSensor2.setStatus('current')
u_sensor = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 2, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 0))).clone(namedValues=named_values(('no', 1), ('yes', 0)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
uSensor.setStatus('current')
smart1_state = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 0, 2))).clone(namedValues=named_values(('on', 1), ('off', 0), ('reset', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
smart1State.setStatus('current')
smart2_state = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 0, 2))).clone(namedValues=named_values(('on', 1), ('off', 0), ('reset', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
smart2State.setStatus('current')
smart1_reset_time = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 5), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
smart1ResetTime.setStatus('current')
smart2_reset_time = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 3, 6), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
smart2ResetTime.setStatus('current')
alarm_sensor1cnt = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2, 1), counter32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alarmSensor1cnt.setStatus('current')
alarm_sensor2cnt = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 8, 2, 2), counter32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alarmSensor2cnt.setStatus('current')
data_type = mib_scalar((1, 3, 6, 1, 4, 1, 40418, 2, 5, 10, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('integer', 0), ('float', 1), ('ufloat', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
dataType.setStatus('current')
a_sense1_alarm = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 1))
if mibBuilder.loadTexts:
aSense1Alarm.setStatus('current')
a_sense1_release = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 2))
if mibBuilder.loadTexts:
aSense1Release.setStatus('current')
a_sense2_alarm = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 3))
if mibBuilder.loadTexts:
aSense2Alarm.setStatus('current')
a_sense2_release = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 4))
if mibBuilder.loadTexts:
aSense2Release.setStatus('current')
u_sense_alarm = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 9))
if mibBuilder.loadTexts:
uSenseAlarm.setStatus('current')
u_sense_release = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 10))
if mibBuilder.loadTexts:
uSenseRelease.setStatus('current')
smart1_thermo_on = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 13))
if mibBuilder.loadTexts:
smart1ThermoOn.setStatus('current')
smart1_thermo_off = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 14))
if mibBuilder.loadTexts:
smart1ThermoOff.setStatus('current')
smart2_thermo_on = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 15))
if mibBuilder.loadTexts:
smart2ThermoOn.setStatus('current')
smart2_thermo_off = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 16))
if mibBuilder.loadTexts:
smart2ThermoOff.setStatus('current')
temp_sensor_alarm = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 29))
if mibBuilder.loadTexts:
tempSensorAlarm.setStatus('current')
temp_sensor_release = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 30))
if mibBuilder.loadTexts:
tempSensorRelease.setStatus('current')
volt_sensor_alarm = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 31))
if mibBuilder.loadTexts:
voltSensorAlarm.setStatus('current')
volt_sensor_release = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 32))
if mibBuilder.loadTexts:
voltSensorRelease.setStatus('current')
task1_done = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 36))
if mibBuilder.loadTexts:
task1Done.setStatus('current')
task2_done = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 37))
if mibBuilder.loadTexts:
task2Done.setStatus('current')
task3_done = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 38))
if mibBuilder.loadTexts:
task3Done.setStatus('current')
task4_done = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 39))
if mibBuilder.loadTexts:
task4Done.setStatus('current')
ping_lost = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 45))
if mibBuilder.loadTexts:
pingLost.setStatus('current')
battery_charge_low = notification_type((1, 3, 6, 1, 4, 1, 40418, 2, 5, 0, 47))
if mibBuilder.loadTexts:
batteryChargeLow.setStatus('current')
erd_pro_mini_trap_group = notification_group((1, 3, 6, 1, 4, 1, 40418, 2, 5, 99)).setObjects(('SNR-ERD-PRO-Mini', 'aSense1Alarm'), ('SNR-ERD-PRO-Mini', 'aSense1Release'), ('SNR-ERD-PRO-Mini', 'aSense2Alarm'), ('SNR-ERD-PRO-Mini', 'aSense2Release'), ('SNR-ERD-PRO-Mini', 'uSenseAlarm'), ('SNR-ERD-PRO-Mini', 'uSenseRelease'), ('SNR-ERD-PRO-Mini', 'smart1ThermoOn'), ('SNR-ERD-PRO-Mini', 'smart1ThermoOff'), ('SNR-ERD-PRO-Mini', 'smart2ThermoOn'), ('SNR-ERD-PRO-Mini', 'smart2ThermoOff'), ('SNR-ERD-PRO-Mini', 'tempSensorAlarm'), ('SNR-ERD-PRO-Mini', 'tempSensorRelease'), ('SNR-ERD-PRO-Mini', 'voltSensorAlarm'), ('SNR-ERD-PRO-Mini', 'voltSensorRelease'), ('SNR-ERD-PRO-Mini', 'task1Done'), ('SNR-ERD-PRO-Mini', 'task2Done'), ('SNR-ERD-PRO-Mini', 'task3Done'), ('SNR-ERD-PRO-Mini', 'task4Done'), ('SNR-ERD-PRO-Mini', 'pingLost'), ('SNR-ERD-PRO-Mini', 'batteryChargeLow'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
erd_pro_mini_trap_group = erdProMiniTrapGroup.setStatus('current')
mibBuilder.exportSymbols('SNR-ERD-PRO-Mini', temperatureS2=temperatureS2, voltageS10=voltageS10, snr=snr, temperatureS8=temperatureS8, smart2ThermoOff=smart2ThermoOff, options=options, temperatureS6=temperatureS6, serialS5=serialS5, pingLost=pingLost, smart1ThermoOff=smart1ThermoOff, alarmSensor1=alarmSensor1, temperatureS9=temperatureS9, currentS2=currentS2, currentS6=currentS6, currentS9=currentS9, serialS6=serialS6, temperatureS4=temperatureS4, currentS10=currentS10, sensesstate=sensesstate, task2Done=task2Done, aSense1Alarm=aSense1Alarm, smart1ThermoOn=smart1ThermoOn, voltageS6=voltageS6, serialS1=serialS1, smart1ResetTime=smart1ResetTime, voltageS9=voltageS9, aSense2Release=aSense2Release, alarmSensor2cnt=alarmSensor2cnt, temperatureS1=temperatureS1, uSensor=uSensor, alarmSensor2=alarmSensor2, currentS3=currentS3, voltSensorRelease=voltSensorRelease, batteryChargeLow=batteryChargeLow, voltageS1=voltageS1, smart2State=smart2State, voltageSensor=voltageSensor, serialS2=serialS2, powerSensors=powerSensors, task1Done=task1Done, tempSensorRelease=tempSensorRelease, erdProMiniTrapGroup=erdProMiniTrapGroup, measurements=measurements, smart2ResetTime=smart2ResetTime, tempSensorAlarm=tempSensorAlarm, voltageS2=voltageS2, serialS8=serialS8, currentS1=currentS1, task4Done=task4Done, snrSensors=snrSensors, voltageS5=voltageS5, temperatureS3=temperatureS3, currentS8=currentS8, counters=counters, voltageS8=voltageS8, serialS10=serialS10, temperatureSensors=temperatureSensors, management=management, snr_erd_pro_mini=snr_erd_pro_mini, alarmSensor1cnt=alarmSensor1cnt, PYSNMP_MODULE_ID=snr, snr_erd=snr_erd, aSense2Alarm=aSense2Alarm, serialS4=serialS4, smart2ThermoOn=smart2ThermoOn, alarmSensCnts=alarmSensCnts, voltSensorAlarm=voltSensorAlarm, currentS7=currentS7, voltageS4=voltageS4, serialS3=serialS3, temperatureS7=temperatureS7, temperatureS10=temperatureS10, serialS7=serialS7, currentS5=currentS5, smart1State=smart1State, currentS4=currentS4, aSense1Release=aSense1Release, uSenseRelease=uSenseRelease, voltageS7=voltageS7, temperatureS5=temperatureS5, voltageS3=voltageS3, task3Done=task3Done, uSenseAlarm=uSenseAlarm, erdproMiniTraps=erdproMiniTraps, dataType=dataType, serialS9=serialS9) |
class ComputeRank(object):
def __init__(self, var_name):
self.var_name = var_name
def __call__(self, documents):
for i, document in enumerate(documents, 1):
document[self.var_name] = i
return documents
def test_rank():
plugin = ComputeRank("rank")
docs = [{}, {}]
result = plugin(docs)
doc1, doc2 = result
assert doc1["rank"] == 1
assert doc2["rank"] == 2 | class Computerank(object):
def __init__(self, var_name):
self.var_name = var_name
def __call__(self, documents):
for (i, document) in enumerate(documents, 1):
document[self.var_name] = i
return documents
def test_rank():
plugin = compute_rank('rank')
docs = [{}, {}]
result = plugin(docs)
(doc1, doc2) = result
assert doc1['rank'] == 1
assert doc2['rank'] == 2 |
'''
You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers
in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order.
However, you are not allowed to reorder the integers in each array pieces[i].
Return true if it is possible to form the array arr from pieces. Otherwise, return false.
Ex. Input - arr : [91,4,64,78], pieces : [[78],[4,64],[91]]
Output - true
Explanation - Concatenate [91] then [4,64] then [78]
Input - arr : [49,18,16], pieces : [[16,18,49]]
Output - false
Explanation - Even though the numbers match, we cannot reorder pieces[0].
Constraints -
1 <= pieces.length <= arr.length <= 100
sum(pieces[i].length) == arr.length
1 <= pieces[i].length <= arr.length
1 <= arr[i], pieces[i][j] <= 100
Solution Complexity -
Time : O(m + n); m = pieces.length, n = arr.length
Space : O(m)
'''
def canFormArray(arr, pieces):
indexing = {}
for i in pieces:
indexing[i[0]] = i
i = 0
while i < len(arr):
try:
tmp = indexing[arr[i]]
for ele in tmp:
if ele == arr[i]:
i += 1
else:
return False
except KeyError:
return False
return True
if __name__ == '__main__':
size = input().split()
arr = input().split()
pieces = []
for _ in range(int(size[1])):
pieces.append(input().split())
print(canFormArray(arr, pieces))
| """
You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers
in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order.
However, you are not allowed to reorder the integers in each array pieces[i].
Return true if it is possible to form the array arr from pieces. Otherwise, return false.
Ex. Input - arr : [91,4,64,78], pieces : [[78],[4,64],[91]]
Output - true
Explanation - Concatenate [91] then [4,64] then [78]
Input - arr : [49,18,16], pieces : [[16,18,49]]
Output - false
Explanation - Even though the numbers match, we cannot reorder pieces[0].
Constraints -
1 <= pieces.length <= arr.length <= 100
sum(pieces[i].length) == arr.length
1 <= pieces[i].length <= arr.length
1 <= arr[i], pieces[i][j] <= 100
Solution Complexity -
Time : O(m + n); m = pieces.length, n = arr.length
Space : O(m)
"""
def can_form_array(arr, pieces):
indexing = {}
for i in pieces:
indexing[i[0]] = i
i = 0
while i < len(arr):
try:
tmp = indexing[arr[i]]
for ele in tmp:
if ele == arr[i]:
i += 1
else:
return False
except KeyError:
return False
return True
if __name__ == '__main__':
size = input().split()
arr = input().split()
pieces = []
for _ in range(int(size[1])):
pieces.append(input().split())
print(can_form_array(arr, pieces)) |
class Solution:
def subdomainVisits(self, cpdomains):
"""
:type cpdomains: List[str]
:rtype: List[str]
"""
count = dict()
for words in cpdomains:
times, cpdomain = words.split(' ')
times = int(times)
keys = cpdomain.split('.')
keys = ['.'.join(keys[i:]) for i in range(len(keys))]
for key in keys:
count[key] = times if count.get(key) is None else count[key] + times
ans = ['{} {}'.format(count[key], key) for key in count.keys()]
return ans | class Solution:
def subdomain_visits(self, cpdomains):
"""
:type cpdomains: List[str]
:rtype: List[str]
"""
count = dict()
for words in cpdomains:
(times, cpdomain) = words.split(' ')
times = int(times)
keys = cpdomain.split('.')
keys = ['.'.join(keys[i:]) for i in range(len(keys))]
for key in keys:
count[key] = times if count.get(key) is None else count[key] + times
ans = ['{} {}'.format(count[key], key) for key in count.keys()]
return ans |
ENTITY = "<<Entity>>"
REL = 'Rel/'
ATTR = 'Attr/'
SOME = 'SOME'
ALL = 'ALL'
GRAPH = 'GRAPH'
LIST = 'LIST'
TEXT = 'TEXT'
SHAPE = 'SHAPE'
SOME_LIMIT = 15
EXACT_MATCH = 'EXACT_MATCH'
REGEX_MATCH = 'REGEX_MATCH'
SYNONYM_MATCH = 'SYNONYM_MATCH' | entity = '<<Entity>>'
rel = 'Rel/'
attr = 'Attr/'
some = 'SOME'
all = 'ALL'
graph = 'GRAPH'
list = 'LIST'
text = 'TEXT'
shape = 'SHAPE'
some_limit = 15
exact_match = 'EXACT_MATCH'
regex_match = 'REGEX_MATCH'
synonym_match = 'SYNONYM_MATCH' |
def calculate(arr, index=0):
back = - 1 - index
if arr[index] != arr[back]:
return False
elif abs(back) == (index+1):
return True
return calculate(arr, index+1)
arr = [int(i) for i in input().split()]
print(calculate(arr))
| def calculate(arr, index=0):
back = -1 - index
if arr[index] != arr[back]:
return False
elif abs(back) == index + 1:
return True
return calculate(arr, index + 1)
arr = [int(i) for i in input().split()]
print(calculate(arr)) |
"""
Find the parant and the node to be deleted. [0]
Deleting the node means replacing its reference by something else. [1]
For the node to be deleted, if it only has no child, just remove it from the parent. Return None. [2]
If it has one child, return the child. So its parent will directly connect to its child. [3]
If it has both child. Update the node's val to the minimum value in the right subtree. Remove the minimum value node in the right subtree. [4]
This is equivalent to replacing the node by the minimum value node in the right subtree.
Another option is to replace the node by the maximum value node in the left subtree.
Find the minimum value in the left subtree is easy. The leftest node value in the tree is the smallest. [5]
Time Complexity: O(LogN). O(LogN) for finding the node to be deleted.
The recursive call in `remove()` will be apply to a much smaller subtree. And much smaller subtree...
So can be ignored.
Space complexity is O(LogN). Because the recursive call will at most be called LogN times.
N is the number of nodes. And LogN can be consider the height of the tree.
"""
class Solution(object):
def deleteNode(self, root, key):
def find_min(root):
curr = root
while curr.left: curr = curr.left
return curr.val#[5]
def remove(node):
if node.left and node.right:
node.val = find_min(node.right)
node.right = self.deleteNode(node.right, node.val)
return node #[4]
elif node.left and not node.right:
return node.left #[3]
elif node.right and not node.left:
return node.right #[3]
else:
return None #[2]
if not root: return root
node = root
while node: #[0]
if node.val==key:
return remove(node) #[1]
elif node.left and node.left.val==key:
node.left = remove(node.left) #[1]
return root
elif node.right and node.right.val==key:
node.right = remove(node.right) #[1]
return root
if key>node.val and node.right:
node = node.right
elif key<node.val and node.left:
node = node.left
else:
break
return root
class Solution(object):
def deleteNode(self, node, key):
if not node:
return node
elif key<node.val:
node.left = self.deleteNode(node.left, key)
return node
elif key>node.val:
node.right = self.deleteNode(node.right, key)
return node
elif key==node.val:
if not node.left and not node.right:
return None
elif not node.left:
return node.right
elif not node.right:
return node.left
else:
node.val = self.findMin(node.right) #min value in the right subtree
node.right = self.deleteNode(node.right, node.val)
return node
def findMin(self, root):
ans = float('inf')
stack = [root]
while stack:
node = stack.pop()
ans = min(ans, node.val)
if node.left: stack.append(node.left)
if node.right: stack.append(node.right)
return ans
| """
Find the parant and the node to be deleted. [0]
Deleting the node means replacing its reference by something else. [1]
For the node to be deleted, if it only has no child, just remove it from the parent. Return None. [2]
If it has one child, return the child. So its parent will directly connect to its child. [3]
If it has both child. Update the node's val to the minimum value in the right subtree. Remove the minimum value node in the right subtree. [4]
This is equivalent to replacing the node by the minimum value node in the right subtree.
Another option is to replace the node by the maximum value node in the left subtree.
Find the minimum value in the left subtree is easy. The leftest node value in the tree is the smallest. [5]
Time Complexity: O(LogN). O(LogN) for finding the node to be deleted.
The recursive call in `remove()` will be apply to a much smaller subtree. And much smaller subtree...
So can be ignored.
Space complexity is O(LogN). Because the recursive call will at most be called LogN times.
N is the number of nodes. And LogN can be consider the height of the tree.
"""
class Solution(object):
def delete_node(self, root, key):
def find_min(root):
curr = root
while curr.left:
curr = curr.left
return curr.val
def remove(node):
if node.left and node.right:
node.val = find_min(node.right)
node.right = self.deleteNode(node.right, node.val)
return node
elif node.left and (not node.right):
return node.left
elif node.right and (not node.left):
return node.right
else:
return None
if not root:
return root
node = root
while node:
if node.val == key:
return remove(node)
elif node.left and node.left.val == key:
node.left = remove(node.left)
return root
elif node.right and node.right.val == key:
node.right = remove(node.right)
return root
if key > node.val and node.right:
node = node.right
elif key < node.val and node.left:
node = node.left
else:
break
return root
class Solution(object):
def delete_node(self, node, key):
if not node:
return node
elif key < node.val:
node.left = self.deleteNode(node.left, key)
return node
elif key > node.val:
node.right = self.deleteNode(node.right, key)
return node
elif key == node.val:
if not node.left and (not node.right):
return None
elif not node.left:
return node.right
elif not node.right:
return node.left
else:
node.val = self.findMin(node.right)
node.right = self.deleteNode(node.right, node.val)
return node
def find_min(self, root):
ans = float('inf')
stack = [root]
while stack:
node = stack.pop()
ans = min(ans, node.val)
if node.left:
stack.append(node.left)
if node.right:
stack.append(node.right)
return ans |
class IberException(Exception):
pass
class ResponseException(IberException):
def __init__(self, status_code):
super().__init__("Response error, code: {}".format(status_code))
class LoginException(IberException):
def __init__(self, username):
super().__init__(f'Unable to log in with user {username}')
class SessionException(IberException):
def __init__(self):
super().__init__('Session required, use login() method to obtain a session')
class NoResponseException(IberException):
pass
class SelectContractException(IberException):
pass
| class Iberexception(Exception):
pass
class Responseexception(IberException):
def __init__(self, status_code):
super().__init__('Response error, code: {}'.format(status_code))
class Loginexception(IberException):
def __init__(self, username):
super().__init__(f'Unable to log in with user {username}')
class Sessionexception(IberException):
def __init__(self):
super().__init__('Session required, use login() method to obtain a session')
class Noresponseexception(IberException):
pass
class Selectcontractexception(IberException):
pass |
v = 6.0 # velocity of seismic waves [km/s]
def earthquake_epicenter(x1, y1, t1, x2, y2, t2, x3, y3, t3):
x = 0
y = 0
# Your code goes here!
return x, y
| v = 6.0
def earthquake_epicenter(x1, y1, t1, x2, y2, t2, x3, y3, t3):
x = 0
y = 0
return (x, y) |
class Logi:
def __init__(self, email, password):
self.email = email
self.password = password
| class Logi:
def __init__(self, email, password):
self.email = email
self.password = password |
class StringFormatFlags(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the display and layout information for text strings.
enum (flags) StringFormatFlags,values: DirectionRightToLeft (1),DirectionVertical (2),DisplayFormatControl (32),FitBlackBox (4),LineLimit (8192),MeasureTrailingSpaces (2048),NoClip (16384),NoFontFallback (1024),NoWrap (4096)
"""
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args):
pass
def __lt__(self, *args):
pass
def __ne__(self, *args):
pass
def __reduce_ex__(self, *args):
pass
def __str__(self, *args):
pass
DirectionRightToLeft = None
DirectionVertical = None
DisplayFormatControl = None
FitBlackBox = None
LineLimit = None
MeasureTrailingSpaces = None
NoClip = None
NoFontFallback = None
NoWrap = None
value__ = None
| class Stringformatflags(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the display and layout information for text strings.
enum (flags) StringFormatFlags,values: DirectionRightToLeft (1),DirectionVertical (2),DisplayFormatControl (32),FitBlackBox (4),LineLimit (8192),MeasureTrailingSpaces (2048),NoClip (16384),NoFontFallback (1024),NoWrap (4096)
"""
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args):
pass
def __lt__(self, *args):
pass
def __ne__(self, *args):
pass
def __reduce_ex__(self, *args):
pass
def __str__(self, *args):
pass
direction_right_to_left = None
direction_vertical = None
display_format_control = None
fit_black_box = None
line_limit = None
measure_trailing_spaces = None
no_clip = None
no_font_fallback = None
no_wrap = None
value__ = None |
requestDict = {
'instances':
[
{
"Lat": 37.4434774, "Long": -122.1652269,
"Altitude": 21.0, "Date_": "7/4/17",
"Time_": "23:37:25", "dt_": "7/4/17 23:37"
#driving meet conjestion
},
{
"Lat": 37.429302, "Long": -122.16145,
"Altitude": 20.0, "Date_": "7/4/17",
"Time_": "09:37:25", "dt_": "7/4/17 09:37"
#driving meet conjestion
}
]
} | request_dict = {'instances': [{'Lat': 37.4434774, 'Long': -122.1652269, 'Altitude': 21.0, 'Date_': '7/4/17', 'Time_': '23:37:25', 'dt_': '7/4/17 23:37'}, {'Lat': 37.429302, 'Long': -122.16145, 'Altitude': 20.0, 'Date_': '7/4/17', 'Time_': '09:37:25', 'dt_': '7/4/17 09:37'}]} |
#!/usr/local/bin/python3
class Object(object):
def __init__(self, id):
self.id = id
self.children = []
self.parent = None
root = Object("COM")
objects = {"COM": root}
def get_object(id):
if id not in objects:
objects[id] = Object(id)
return objects[id]
with open("input.txt") as f:
for line in f.readlines():
parent, child = map(get_object, line.strip().split(")"))
parent.children.append(child)
child.parent = parent
def get_path(node):
path = []
while node:
path.insert(0, node)
node = node.parent
return path
you_path = get_path(objects["YOU"])
santa_path = get_path(objects["SAN"])
for common_ancestor_index in range(min(len(you_path), len(santa_path))):
you_node = you_path[common_ancestor_index]
santa_node = santa_path[common_ancestor_index]
if you_node != santa_node:
break
print("transfers: %d" % (len(you_path) + len(santa_path) - 2 * (common_ancestor_index + 1)))
| class Object(object):
def __init__(self, id):
self.id = id
self.children = []
self.parent = None
root = object('COM')
objects = {'COM': root}
def get_object(id):
if id not in objects:
objects[id] = object(id)
return objects[id]
with open('input.txt') as f:
for line in f.readlines():
(parent, child) = map(get_object, line.strip().split(')'))
parent.children.append(child)
child.parent = parent
def get_path(node):
path = []
while node:
path.insert(0, node)
node = node.parent
return path
you_path = get_path(objects['YOU'])
santa_path = get_path(objects['SAN'])
for common_ancestor_index in range(min(len(you_path), len(santa_path))):
you_node = you_path[common_ancestor_index]
santa_node = santa_path[common_ancestor_index]
if you_node != santa_node:
break
print('transfers: %d' % (len(you_path) + len(santa_path) - 2 * (common_ancestor_index + 1))) |
def fizzbuzz(num):
if (num >= 0 and num % 3 == 0 and num % 5 == 0):
return "Fizz Buzz"
if (num >= 0 and num % 3 == 0):
return "Fizz"
if (num >= 0 and num % 5 == 0):
return "Buzz"
if (num >= 0):
return ""
| def fizzbuzz(num):
if num >= 0 and num % 3 == 0 and (num % 5 == 0):
return 'Fizz Buzz'
if num >= 0 and num % 3 == 0:
return 'Fizz'
if num >= 0 and num % 5 == 0:
return 'Buzz'
if num >= 0:
return '' |
dataset_paths = {
'ffhq': '',
'celeba_test': '',
'cars_train': '',
'cars_test': '',
'church_train': '',
'church_test': '',
'horse_train': '',
'horse_test': '',
'afhq_wild_train': '',
'afhq_wild_test': '',
'font_train': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops/pr',
'font_test': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_sample/pr',
'font_gs_train': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_grayscale/pr',
'font_gs_test': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_grayscale_sample/pr',
'font_train_modern': '/mnt/data02/Japan/font_gen/paired_training_data/pr/labeled_validated_rendered_chars',
'font_test_modern': '/mnt/data02/Japan/font_gen/paired_training_data/pr/rendered_chars_for_overfitting',
'font_train_historical': '/mnt/data02/Japan/font_gen/paired_training_data/pr/labeled_validated_char_crops',
'font_test_historical': '/mnt/data02/Japan/font_gen/paired_training_data/pr/char_crops_for_overfitting',
}
model_paths = {
'ir_se50': 'pretrained_models/model_ir_se50.pth',
'resnet34': '/mnt/workspace/pretrained_models/resnet34-333f7ec4.pth',
'stylegan_ffhq': 'pretrained_models/stylegan2-ffhq-config-f.pt',
'stylegan_cars': 'pretrained_models/stylegan2-car-config-f.pt',
'stylegan_church': 'pretrained_models/stylegan2-church-config-f.pt',
'stylegan_horse': 'pretrained_models/stylegan2-horse-config-f.pt',
'stylegan_ada_wild': 'pretrained_models/afhqwild.pt',
'stylegan_toonify': 'pretrained_models/ffhq_cartoon_blended.pt',
'shape_predictor': 'pretrained_models/shape_predictor_68_face_landmarks.dat',
'circular_face': 'pretrained_models/CurricularFace_Backbone.pth',
'mtcnn_pnet': 'pretrained_models/mtcnn/pnet.npy',
'mtcnn_rnet': 'pretrained_models/mtcnn/rnet.npy',
'mtcnn_onet': 'pretrained_models/mtcnn/onet.npy',
'moco': '/mnt/workspace/pretrained_models/moco_v2_800ep_pretrain.pt'
}
| dataset_paths = {'ffhq': '', 'celeba_test': '', 'cars_train': '', 'cars_test': '', 'church_train': '', 'church_test': '', 'horse_train': '', 'horse_test': '', 'afhq_wild_train': '', 'afhq_wild_test': '', 'font_train': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops/pr', 'font_test': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_sample/pr', 'font_gs_train': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_grayscale/pr', 'font_gs_test': '/mnt/data01/AWS_S3_CONTAINER/personnel-records/1956/seg/firm/stylegan2_crops_grayscale_sample/pr', 'font_train_modern': '/mnt/data02/Japan/font_gen/paired_training_data/pr/labeled_validated_rendered_chars', 'font_test_modern': '/mnt/data02/Japan/font_gen/paired_training_data/pr/rendered_chars_for_overfitting', 'font_train_historical': '/mnt/data02/Japan/font_gen/paired_training_data/pr/labeled_validated_char_crops', 'font_test_historical': '/mnt/data02/Japan/font_gen/paired_training_data/pr/char_crops_for_overfitting'}
model_paths = {'ir_se50': 'pretrained_models/model_ir_se50.pth', 'resnet34': '/mnt/workspace/pretrained_models/resnet34-333f7ec4.pth', 'stylegan_ffhq': 'pretrained_models/stylegan2-ffhq-config-f.pt', 'stylegan_cars': 'pretrained_models/stylegan2-car-config-f.pt', 'stylegan_church': 'pretrained_models/stylegan2-church-config-f.pt', 'stylegan_horse': 'pretrained_models/stylegan2-horse-config-f.pt', 'stylegan_ada_wild': 'pretrained_models/afhqwild.pt', 'stylegan_toonify': 'pretrained_models/ffhq_cartoon_blended.pt', 'shape_predictor': 'pretrained_models/shape_predictor_68_face_landmarks.dat', 'circular_face': 'pretrained_models/CurricularFace_Backbone.pth', 'mtcnn_pnet': 'pretrained_models/mtcnn/pnet.npy', 'mtcnn_rnet': 'pretrained_models/mtcnn/rnet.npy', 'mtcnn_onet': 'pretrained_models/mtcnn/onet.npy', 'moco': '/mnt/workspace/pretrained_models/moco_v2_800ep_pretrain.pt'} |
def v(kod):
if (k == len(kod)):
print(' '.join(kod))
return
if (len(kod) != 0):
for i in range(int(kod[-1]) + 1, n + 1):
if (str(i) not in kod):
gg = kod.copy()
gg.append(str(i))
v(gg)
else:
for i in range(1, n + 1):
gg = kod.copy()
gg.append(str(i))
v(gg)
n, k = map(int, input().split())
v([])
| def v(kod):
if k == len(kod):
print(' '.join(kod))
return
if len(kod) != 0:
for i in range(int(kod[-1]) + 1, n + 1):
if str(i) not in kod:
gg = kod.copy()
gg.append(str(i))
v(gg)
else:
for i in range(1, n + 1):
gg = kod.copy()
gg.append(str(i))
v(gg)
(n, k) = map(int, input().split())
v([]) |
'''
(0-1 Knapsack) example
The example solves the 0/1 Knapsack Problem:
how we get the maximum value, given our knapsack just can hold a maximum weight of w,
while the value of the i-th item is a1[i], and the weight of the i-th item is a2[i]?
i = total item
w = total weigh of knapsack can carry
'''
# a1: item value
a1 = [100, 70, 50, 10]
# a2: item weight
a2 = [10, 4, 6, 12]
def knapsack01(items, weight):
if (w == 0) or (i < 0):
return 0
elif (a2[i] > w):
return knapsack01(i-1, w)
else:
return max(a1[i] + knapsack01(i-1, w-a2[i], knapsack01(i-1, w)))
if __name__ == "__main__":
i = 3
w = 12
print (knapsack01(items=i, weight=w)) | """
(0-1 Knapsack) example
The example solves the 0/1 Knapsack Problem:
how we get the maximum value, given our knapsack just can hold a maximum weight of w,
while the value of the i-th item is a1[i], and the weight of the i-th item is a2[i]?
i = total item
w = total weigh of knapsack can carry
"""
a1 = [100, 70, 50, 10]
a2 = [10, 4, 6, 12]
def knapsack01(items, weight):
if w == 0 or i < 0:
return 0
elif a2[i] > w:
return knapsack01(i - 1, w)
else:
return max(a1[i] + knapsack01(i - 1, w - a2[i], knapsack01(i - 1, w)))
if __name__ == '__main__':
i = 3
w = 12
print(knapsack01(items=i, weight=w)) |
administrator_user_id = 403569083402158090
reaction_message_ids = [832010993542365184, 573059396259807232]
current_year = 2021
| administrator_user_id = 403569083402158090
reaction_message_ids = [832010993542365184, 573059396259807232]
current_year = 2021 |
class NoneTypeFont(Exception):
pass
class PortraitBoolError(Exception):
pass
class NoneStringObject(Exception):
pass
class BMPvalidationError(Exception):
pass
| class Nonetypefont(Exception):
pass
class Portraitboolerror(Exception):
pass
class Nonestringobject(Exception):
pass
class Bmpvalidationerror(Exception):
pass |
default_values = {
'mode': 'train',
'net': 'resnet32_cifar',
'device': 'cuda:0',
'num_epochs': 300,
'activation_type': 'deepBspline_explicit_linear',
'spline_init': 'leaky_relu',
'spline_size': 51,
'spline_range': 4,
'save_memory': False,
'knot_threshold': 0.,
'num_hidden_layers': 2,
'num_hidden_neurons': 4,
'lipschitz': False,
'lmbda': 1e-4,
'optimizer': ['SGD', 'Adam'],
'lr': 1e-1,
'aux_lr': 1e-3,
'weight_decay': 5e-4,
'gamma': 0.1,
'milestones': [150, 225, 262],
'log_dir': './ckpt',
'model_name': 'deepspline',
'resume': False,
'resume_from_best': False,
'ckpt_filename': None,
'ckpt_nmax_files': 3, # max number of saved *_net_*.ckpt
# checkpoint files at a time. Set to -1 if not restricted. '
'log_step': None,
'valid_log_step': None,
'seed': (-1),
'test_as_valid': False,
'dataset_name': 'cifar10',
'data_dir': './data',
'batch_size': 128,
# Number of subprocesses to use for data loading.
'num_workers': 4,
'plot_imgs': False,
'save_imgs': False,
'verbose': False,
'additional_info': [],
'num_classes': None
}
# This tree defines the strcuture of self.params in the Project() class.
# if it is desired to keep an entry in the first level that is also a
# leaf of deeper levels of the structure, this entry should be added to
# the first level too (e.g. as done for 'log_dir')
structure = {
'log_dir': None,
'model_name': None,
'verbose': None,
'net': None,
'knot_threshold': None,
'dataset': {
'dataset_name': None,
'log_dir': None,
'model_name': None,
'plot_imgs': None,
'save_imgs': None,
},
'dataloader': {
'data_dir': None,
'batch_size': None,
'num_workers': None,
'test_as_valid': None,
'seed': None
},
'model': {
'activation_type': None,
'spline_init': None,
'spline_size': None,
'spline_range': None,
'save_memory': None,
'knot_threshold': None,
'num_hidden_layers': None,
'num_hidden_neurons': None,
'net': None,
'verbose': None
}
}
| default_values = {'mode': 'train', 'net': 'resnet32_cifar', 'device': 'cuda:0', 'num_epochs': 300, 'activation_type': 'deepBspline_explicit_linear', 'spline_init': 'leaky_relu', 'spline_size': 51, 'spline_range': 4, 'save_memory': False, 'knot_threshold': 0.0, 'num_hidden_layers': 2, 'num_hidden_neurons': 4, 'lipschitz': False, 'lmbda': 0.0001, 'optimizer': ['SGD', 'Adam'], 'lr': 0.1, 'aux_lr': 0.001, 'weight_decay': 0.0005, 'gamma': 0.1, 'milestones': [150, 225, 262], 'log_dir': './ckpt', 'model_name': 'deepspline', 'resume': False, 'resume_from_best': False, 'ckpt_filename': None, 'ckpt_nmax_files': 3, 'log_step': None, 'valid_log_step': None, 'seed': -1, 'test_as_valid': False, 'dataset_name': 'cifar10', 'data_dir': './data', 'batch_size': 128, 'num_workers': 4, 'plot_imgs': False, 'save_imgs': False, 'verbose': False, 'additional_info': [], 'num_classes': None}
structure = {'log_dir': None, 'model_name': None, 'verbose': None, 'net': None, 'knot_threshold': None, 'dataset': {'dataset_name': None, 'log_dir': None, 'model_name': None, 'plot_imgs': None, 'save_imgs': None}, 'dataloader': {'data_dir': None, 'batch_size': None, 'num_workers': None, 'test_as_valid': None, 'seed': None}, 'model': {'activation_type': None, 'spline_init': None, 'spline_size': None, 'spline_range': None, 'save_memory': None, 'knot_threshold': None, 'num_hidden_layers': None, 'num_hidden_neurons': None, 'net': None, 'verbose': None}} |
class Solution:
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums)==0:
return 0
k=1
m=0
for i in range(1,len(nums)):
if nums[i]>nums[i-1]:
k+=1
else:
m=max(m,k)
k=1
m=max(m,k)
return m
| class Solution:
def find_length_of_lcis(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums) == 0:
return 0
k = 1
m = 0
for i in range(1, len(nums)):
if nums[i] > nums[i - 1]:
k += 1
else:
m = max(m, k)
k = 1
m = max(m, k)
return m |
NONE = u'none'
OTHER = u'other'
PRIMARY = u'primary'
JUNIOR_SECONDARY = u'junior_secondary'
SECONDARY = u'secondary'
ASSOCIATES = u'associates'
BACHELORS = u'bachelors'
MASTERS = u'masters'
DOCTORATE = u'doctorate'
| none = u'none'
other = u'other'
primary = u'primary'
junior_secondary = u'junior_secondary'
secondary = u'secondary'
associates = u'associates'
bachelors = u'bachelors'
masters = u'masters'
doctorate = u'doctorate' |
class SteepshotBotError(Exception):
msg = {}
def get_msg(self, locale: str = 'en') -> str:
return self.msg.get(locale, self.msg.get('en', 'Some error occurred: ')) + str(self)
class SteepshotServerError(SteepshotBotError):
msg = {
'en': 'Some Steepshot error occurred: '
}
class SteemError(SteepshotBotError):
msg = {
'en': 'Some Steem error occurred: '
}
class PostNotFound(SteepshotBotError):
msg = {
'en': 'This post was not found: '
}
class VotedSimilarily(SteepshotBotError):
msg = {
'en': 'You have already voted in a similar way: '
}
| class Steepshotboterror(Exception):
msg = {}
def get_msg(self, locale: str='en') -> str:
return self.msg.get(locale, self.msg.get('en', 'Some error occurred: ')) + str(self)
class Steepshotservererror(SteepshotBotError):
msg = {'en': 'Some Steepshot error occurred: '}
class Steemerror(SteepshotBotError):
msg = {'en': 'Some Steem error occurred: '}
class Postnotfound(SteepshotBotError):
msg = {'en': 'This post was not found: '}
class Votedsimilarily(SteepshotBotError):
msg = {'en': 'You have already voted in a similar way: '} |
class Instrument:
insId: int
name: str
urlName: str
instrument: int
isin: str
ticker: str
yahoo: str
sectorId: int
marketId: int
branchId: int
countryId: int
listingDate: str
def __init__(self, insId, name, urlName, instrument, isin, ticker, yahoo, sectorId, marketId, branchId, countryId,
listingDate):
self.insId = insId
self.name = name
self.urlName = urlName
self.instrument = instrument
self.isin = isin
self.ticker = ticker
self.yahoo = yahoo
self.sectorId = sectorId
self.marketId = marketId
self.branchId = branchId
self.countryId = countryId
self.listingDate = listingDate
def __str__(self):
return '{}: {}'.format(self.insId, self.name)
def __repr__(self):
return '{}: {}'.format(self.insId, self.name)
| class Instrument:
ins_id: int
name: str
url_name: str
instrument: int
isin: str
ticker: str
yahoo: str
sector_id: int
market_id: int
branch_id: int
country_id: int
listing_date: str
def __init__(self, insId, name, urlName, instrument, isin, ticker, yahoo, sectorId, marketId, branchId, countryId, listingDate):
self.insId = insId
self.name = name
self.urlName = urlName
self.instrument = instrument
self.isin = isin
self.ticker = ticker
self.yahoo = yahoo
self.sectorId = sectorId
self.marketId = marketId
self.branchId = branchId
self.countryId = countryId
self.listingDate = listingDate
def __str__(self):
return '{}: {}'.format(self.insId, self.name)
def __repr__(self):
return '{}: {}'.format(self.insId, self.name) |
class WeightedUnionFind(object):
def __init__(self, n):
self.n = n
self.parents = range(n)
self.sizes = [1] * n
def find(self, p):
while p != self.parents[p]:
p = self.parents[p]
return p
def is_connected(self, p, q):
return self.find(p) == self.find(q)
def __len__(self):
return self.n
def union(self, p, q):
"""
>>> uf = WeightedUnionFind(5)
>>> uf.parents = [0, 0, 0, 3, 3]
>>> uf.sizes = [3, 1, 1, 2, 1]
>>> uf.union(2, 3)
>>> uf.parents
[0, 0, 0, 0, 3]
>>> uf.sizes
[5, 1, 1, 2, 1]
"""
p_parent = self.parents[p]
q_parent = self.parents[q]
if p_parent == q_parent:
return
if self.sizes[p_parent] < self.sizes[q_parent]:
self.sizes[q_parent] += self.sizes[p_parent]
self.parents[p_parent] = q_parent
else:
self.sizes[p_parent] += self.sizes[q_parent]
self.parents[q_parent] = p_parent
self.n -= 1
| class Weightedunionfind(object):
def __init__(self, n):
self.n = n
self.parents = range(n)
self.sizes = [1] * n
def find(self, p):
while p != self.parents[p]:
p = self.parents[p]
return p
def is_connected(self, p, q):
return self.find(p) == self.find(q)
def __len__(self):
return self.n
def union(self, p, q):
"""
>>> uf = WeightedUnionFind(5)
>>> uf.parents = [0, 0, 0, 3, 3]
>>> uf.sizes = [3, 1, 1, 2, 1]
>>> uf.union(2, 3)
>>> uf.parents
[0, 0, 0, 0, 3]
>>> uf.sizes
[5, 1, 1, 2, 1]
"""
p_parent = self.parents[p]
q_parent = self.parents[q]
if p_parent == q_parent:
return
if self.sizes[p_parent] < self.sizes[q_parent]:
self.sizes[q_parent] += self.sizes[p_parent]
self.parents[p_parent] = q_parent
else:
self.sizes[p_parent] += self.sizes[q_parent]
self.parents[q_parent] = p_parent
self.n -= 1 |
num = int(input("Enter a number: "))
iter_num = 0
pwr = 0
if num == 0:
root = 0
else:
root = 1
while root**pwr != num and root < num:
while pwr < 6:
iter_num += 1
if root**pwr == num:
print(root, "^", pwr, sep="")
break
pwr += 1
if root**pwr == num:
break
else:
pwr = 0
root += 1
if root**pwr != num:
print("Not found")
print("Iterations:", iter_num) | num = int(input('Enter a number: '))
iter_num = 0
pwr = 0
if num == 0:
root = 0
else:
root = 1
while root ** pwr != num and root < num:
while pwr < 6:
iter_num += 1
if root ** pwr == num:
print(root, '^', pwr, sep='')
break
pwr += 1
if root ** pwr == num:
break
else:
pwr = 0
root += 1
if root ** pwr != num:
print('Not found')
print('Iterations:', iter_num) |
def dict_recursive_bypass(dictionary: dict, on_node: callable) -> dict:
"""
Recursive bypass dictionary
:param dictionary:
:param on_node: callable for every node, that get value of dict end node as parameters
"""
res = {}
for k, v in dictionary.items():
if isinstance(v, dict):
res[k] = dict_recursive_bypass(v, on_node)
else:
res[k] = on_node(v)
return res
def dict_pair_recursive_bypass(dictionary1: dict, dictionary2: dict, on_node: callable) -> dict:
"""
Recursive bypass dictionary
:param dictionary1:
:param dictionary2:
:param on_node: callable for every node, that get value of dict end node as parameters
"""
res = {}
for k, v in dictionary1.items():
if isinstance(v, dict):
res[k] = dict_pair_recursive_bypass(v, dictionary2[k], on_node)
else:
res[k] = on_node(v, dictionary2[k])
return res
| def dict_recursive_bypass(dictionary: dict, on_node: callable) -> dict:
"""
Recursive bypass dictionary
:param dictionary:
:param on_node: callable for every node, that get value of dict end node as parameters
"""
res = {}
for (k, v) in dictionary.items():
if isinstance(v, dict):
res[k] = dict_recursive_bypass(v, on_node)
else:
res[k] = on_node(v)
return res
def dict_pair_recursive_bypass(dictionary1: dict, dictionary2: dict, on_node: callable) -> dict:
"""
Recursive bypass dictionary
:param dictionary1:
:param dictionary2:
:param on_node: callable for every node, that get value of dict end node as parameters
"""
res = {}
for (k, v) in dictionary1.items():
if isinstance(v, dict):
res[k] = dict_pair_recursive_bypass(v, dictionary2[k], on_node)
else:
res[k] = on_node(v, dictionary2[k])
return res |
expected_output = {
"route-information": {
"route-table": {
"active-route-count": "1250009",
"destination-count": "1250009",
"hidden-route-count": "0",
"holddown-route-count": "0",
"rt": {
"rt-announced-count": "1",
"rt-destination": "10.55.0.0",
"rt-entry": {
"active-tag": "*",
"age": {"#text": "4:32"},
"announce-bits": "2",
"announce-tasks": "0-KRT 1-BGP_RT_Background",
"as-path": "AS path:2 I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "2 I",
}
},
"bgp-rt-flag": "Accepted",
"gateway": "10.30.0.2",
"local-as": "1",
"local-preference": "100",
"nh": {
"nh-string": "Next hop",
"session": "0xf44",
"to": "10.30.0.2",
"via": "ge-0/0/2.0",
},
"nh-address": "0x17b226b4",
"nh-index": "605",
"nh-reference-count": "800002",
"nh-type": "Router",
"peer-as": "2",
"peer-id": "192.168.19.1",
"preference": "170",
"preference2": "101",
"protocol-name": "BGP",
"rt-entry-state": "Active Ext",
"task-name": "BGP_10.144.30.0.2",
"validation-state": "unverified",
},
"rt-entry-count": {"#text": "1"},
"rt-prefix-length": "32",
"tsi": {"#text": "KRT in-kernel 10.55.0.0/32 -> {10.30.0.2}"},
},
"table-name": "inet.0",
"total-route-count": "1250009",
}
}
}
| expected_output = {'route-information': {'route-table': {'active-route-count': '1250009', 'destination-count': '1250009', 'hidden-route-count': '0', 'holddown-route-count': '0', 'rt': {'rt-announced-count': '1', 'rt-destination': '10.55.0.0', 'rt-entry': {'active-tag': '*', 'age': {'#text': '4:32'}, 'announce-bits': '2', 'announce-tasks': '0-KRT 1-BGP_RT_Background', 'as-path': 'AS path:2 I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': '2 I'}}, 'bgp-rt-flag': 'Accepted', 'gateway': '10.30.0.2', 'local-as': '1', 'local-preference': '100', 'nh': {'nh-string': 'Next hop', 'session': '0xf44', 'to': '10.30.0.2', 'via': 'ge-0/0/2.0'}, 'nh-address': '0x17b226b4', 'nh-index': '605', 'nh-reference-count': '800002', 'nh-type': 'Router', 'peer-as': '2', 'peer-id': '192.168.19.1', 'preference': '170', 'preference2': '101', 'protocol-name': 'BGP', 'rt-entry-state': 'Active Ext', 'task-name': 'BGP_10.144.30.0.2', 'validation-state': 'unverified'}, 'rt-entry-count': {'#text': '1'}, 'rt-prefix-length': '32', 'tsi': {'#text': 'KRT in-kernel 10.55.0.0/32 -> {10.30.0.2}'}}, 'table-name': 'inet.0', 'total-route-count': '1250009'}}} |
""" Summation puzzle
Example:
pot + pan = bib
dog + cat = pig
boy+ girl = baby
"""
def puzzle_solve(k, S, U, solutionSeq): # we have also passed puzzles solution samples to verify the configuarion
""" Input: an integer k : length of the subset made by combination of letters,
S: Sequence of unique letters , U: Universal Set of unique letters Example: {a, b, c} """
for element in U:
# add element to the end of S
# S.append(element) # S is list
S += element # S is string
# remove element from U
U.remove(element)
if k == 1:
# test whether string S is a configuartion that solves the puzzle
# sequnce_string = "".join(S) # list
sequnce_string = S
if sequnce_string in solutionSeq: # S solves the puzzle
print("Solution Found: ", S)
return "Solution Found: ", S
else: # No solution found
print("No solution found. Configuration = {}".format(sequnce_string))
else:
puzzle_solve(k-1, S, U, solutionSeq) # recursive call to obtain configuration of desired length
#the puzzle was not solved with element 'element ' which was added to S
# so we remove it from S and add it back to U
# S.remove(element) # S is list
S = S[:-1]
U.append(element)
if __name__ == "__main__":
solutionSeq = ['bca']
k = 3
# S = [] # list
S = ""
U = ['a', 'b', 'c']
puzzle_solve(3, S, U, solutionSeq)
solutionSeq = ['pot']
k = 3
# S = [] # list
S = ""
U = ['p', 'r', 'o', 't' ]
print(U)
puzzle_solve(3, S, U, solutionSeq)
| """ Summation puzzle
Example:
pot + pan = bib
dog + cat = pig
boy+ girl = baby
"""
def puzzle_solve(k, S, U, solutionSeq):
""" Input: an integer k : length of the subset made by combination of letters,
S: Sequence of unique letters , U: Universal Set of unique letters Example: {a, b, c} """
for element in U:
s += element
U.remove(element)
if k == 1:
sequnce_string = S
if sequnce_string in solutionSeq:
print('Solution Found: ', S)
return ('Solution Found: ', S)
else:
print('No solution found. Configuration = {}'.format(sequnce_string))
else:
puzzle_solve(k - 1, S, U, solutionSeq)
s = S[:-1]
U.append(element)
if __name__ == '__main__':
solution_seq = ['bca']
k = 3
s = ''
u = ['a', 'b', 'c']
puzzle_solve(3, S, U, solutionSeq)
solution_seq = ['pot']
k = 3
s = ''
u = ['p', 'r', 'o', 't']
print(U)
puzzle_solve(3, S, U, solutionSeq) |
# class MyHashSet:
# def __init__(self):
# """
# Initialize your data structure here.
# """
# self._range = 10000
# self.list = [[]]*self._range
# def _hash(self, key: int) -> int:
# return key%self._range
# def _search(self, key: int) -> int:
# pool = self.list[self._hash(key)]
# if len(pool)==0:
# return -1
# else:
# for idx in range(len(pool)):
# if pool[idx]==key:
# return idx
# return -1
# def add(self, key: int) -> None:
# if self.contains(key)==False:
# self.list[self._hash(key)].append(key)
# def remove(self, key: int) -> None:
# if self.contains(key)==True:
# idx = self._search(key)
# self.list[self._hash(key)].pop(idx)
# def contains(self, key: int) -> bool:
# """
# Returns true if this set contains the specified element
# """
# if self._search(key)==-1:
# return False
# else:
# return True
class MyHashSet(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.keyRange = 769
self.bucketArray = [Bucket() for i in range(self.keyRange)]
def _hash(self, key):
return key % self.keyRange
def add(self, key):
if not self.contains(key):
self.bucketArray[self._hash(key)].insert(key)
def remove(self, key):
if self.contains(key):
self.bucketArray[self._hash(key)].delete(key)
def contains(self, key):
bucketIndex = self._hash(key)
return self.bucketArray[bucketIndex].exists(key)
class Node:
def __init__(self, value, nextNode=None):
self.value = value
self.next = nextNode
class Bucket:
def __init__(self):
self.head = Node(0) # pseudo head
def insert(self, newValue):
if not self.exists(newValue): # if not existed, add the new element to the head
newNode = Node(newValue, self.head.next)
self.head.next = newNode
def delete(self, value):
prev = self.head
curr = self.head.next
while curr is not None:
if curr.value == value:
prev.next = curr.next
return
prev = curr
curr = curr.next
def exists(self, value):
curr = self.head.next
while curr is not None:
if curr.value==value:
return True
curr = curr.next
return False
# Your MyHashSet object will be instantiated and called as such:
# obj = MyHashSet()
# obj.add(key)
# obj.remove(key)
# param_3 = obj.contains(key) | class Myhashset(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.keyRange = 769
self.bucketArray = [bucket() for i in range(self.keyRange)]
def _hash(self, key):
return key % self.keyRange
def add(self, key):
if not self.contains(key):
self.bucketArray[self._hash(key)].insert(key)
def remove(self, key):
if self.contains(key):
self.bucketArray[self._hash(key)].delete(key)
def contains(self, key):
bucket_index = self._hash(key)
return self.bucketArray[bucketIndex].exists(key)
class Node:
def __init__(self, value, nextNode=None):
self.value = value
self.next = nextNode
class Bucket:
def __init__(self):
self.head = node(0)
def insert(self, newValue):
if not self.exists(newValue):
new_node = node(newValue, self.head.next)
self.head.next = newNode
def delete(self, value):
prev = self.head
curr = self.head.next
while curr is not None:
if curr.value == value:
prev.next = curr.next
return
prev = curr
curr = curr.next
def exists(self, value):
curr = self.head.next
while curr is not None:
if curr.value == value:
return True
curr = curr.next
return False |
SERVER_EMAIL = 'SERVER_EMAIL'
SERVER_PASSWORD = 'SERVER_PASSWORD'
WATCHED = {
'service': ['service'],
'process': ['process'],
}
NOTIFICATION_DETAILS = {
'service': [
{
'identifiers': ['identifiers'],
'to_emails': ['nimesh.aug11@gmail.com'],
'subject': 'subject',
'body': 'body'
},
],
'process': [
{
'identifiers': ['identifiers'],
'to_emails': ['nimesh.aug11@gmail.com'],
'subject': 'subject',
'body': 'body'
},
]
}
| server_email = 'SERVER_EMAIL'
server_password = 'SERVER_PASSWORD'
watched = {'service': ['service'], 'process': ['process']}
notification_details = {'service': [{'identifiers': ['identifiers'], 'to_emails': ['nimesh.aug11@gmail.com'], 'subject': 'subject', 'body': 'body'}], 'process': [{'identifiers': ['identifiers'], 'to_emails': ['nimesh.aug11@gmail.com'], 'subject': 'subject', 'body': 'body'}]} |
print("HelloWorld")
print(len("HelloWorld"))
a_string = "Hello"
b_string = "World"
print("a_string + b_string: ", a_string+b_string)
c_string = "abcdefghijklmnopqrstuvwxyz"
print("num of letters from a to z", len(c_string))
print(c_string[:3]) #abc
print(c_string[23:]) #xyz
#step count reverse
print(c_string[::-1])
#step count forward
print(c_string[::2])
print(c_string.upper())
print(c_string.split('l'))
#string formatting
userName = "San"
color = "blue"
print(f"{userName}'s fav color is {color}")
print("{}'s fav color is {}".format(userName, color)) | print('HelloWorld')
print(len('HelloWorld'))
a_string = 'Hello'
b_string = 'World'
print('a_string + b_string: ', a_string + b_string)
c_string = 'abcdefghijklmnopqrstuvwxyz'
print('num of letters from a to z', len(c_string))
print(c_string[:3])
print(c_string[23:])
print(c_string[::-1])
print(c_string[::2])
print(c_string.upper())
print(c_string.split('l'))
user_name = 'San'
color = 'blue'
print(f"{userName}'s fav color is {color}")
print("{}'s fav color is {}".format(userName, color)) |
def substituter(seq, substitutions):
for item in seq:
if item in substitutions:
yield substitutions[item]
else:
yield item
| def substituter(seq, substitutions):
for item in seq:
if item in substitutions:
yield substitutions[item]
else:
yield item |
a = input()
b = input()
ans = 0
while True:
s = a.find(b)
if s < 0:
break
ans += 1
a = a[s+len(b):]
print(ans)
| a = input()
b = input()
ans = 0
while True:
s = a.find(b)
if s < 0:
break
ans += 1
a = a[s + len(b):]
print(ans) |
"""Externalized strings for better structure and easier localization"""
setup_greeting = """
Dwarf - First run configuration
Insert your bot's token, or enter 'cancel' to cancel the setup:"""
not_a_token = "Invalid input. Restart Dwarf and repeat the configuration process."
choose_prefix = """Choose a prefix. A prefix is what you type before a command.
A typical prefix would be the exclamation mark.
Can be multiple characters. You will be able to change it later and add more of them.
Choose your prefix:"""
confirm_prefix = """Are you sure you want {0} as your prefix?
You will be able to issue commands like this: {0}help
Type yes to confirm or no to change it"""
setup_finished = """
The configuration is done. Leave this window always open to keep your bot online.
All commands will have to be issued through Discord's chat,
*this window will now be read only*.
Press enter to continue"""
prefix_singular = "Prefix"
prefix_plural = "Prefixes"
use_this_url = "Use this url to bring your bot to a server:"
bot_is_online = "{} is now online."
connected_to = "Connected to:"
connected_to_servers = "{} servers"
connected_to_channels = "{} channels"
connected_to_users = "{} users"
no_prefix_set = "No prefix set. Defaulting to !"
logging_into_discord = "Logging into Discord..."
invalid_credentials = """Invalid login credentials.
If they worked before Discord might be having temporary technical issues.
In this case, press enter and try again later.
Otherwise you can type 'reset' to delete the current configuration and
redo the setup process again the next start.
> """
keep_updated_win = """Make sure to keep your bot updated by running the file
update.bat"""
keep_updated = """Make sure to keep Dwarf updated by using:\n
git pull\npip3 install --upgrade
git+https://github.com/Rapptz/discord.py@async"""
official_server = "Official server: {}"
invite_link = "https://discord.me/AileenLumina"
update_the_api = """\nYou are using an outdated discord.py.\n
Update your discord.py with by running this in your cmd
prompt/terminal:\npip3 install --upgrade git+https://
github.com/Rapptz/discord.py@async"""
command_disabled = "That command is disabled."
exception_in_command = "Exception in command '{}'"
error_in_command = "Error in command '{}' - {}: {}"
not_available_in_dm = "That command is not available in DMs."
owner_recognized = "{} has been recognized and set as owner."
| """Externalized strings for better structure and easier localization"""
setup_greeting = "\nDwarf - First run configuration\n\nInsert your bot's token, or enter 'cancel' to cancel the setup:"
not_a_token = 'Invalid input. Restart Dwarf and repeat the configuration process.'
choose_prefix = 'Choose a prefix. A prefix is what you type before a command.\nA typical prefix would be the exclamation mark.\nCan be multiple characters. You will be able to change it later and add more of them.\nChoose your prefix:'
confirm_prefix = 'Are you sure you want {0} as your prefix?\nYou will be able to issue commands like this: {0}help\nType yes to confirm or no to change it'
setup_finished = "\nThe configuration is done. Leave this window always open to keep your bot online.\nAll commands will have to be issued through Discord's chat,\n*this window will now be read only*.\nPress enter to continue"
prefix_singular = 'Prefix'
prefix_plural = 'Prefixes'
use_this_url = 'Use this url to bring your bot to a server:'
bot_is_online = '{} is now online.'
connected_to = 'Connected to:'
connected_to_servers = '{} servers'
connected_to_channels = '{} channels'
connected_to_users = '{} users'
no_prefix_set = 'No prefix set. Defaulting to !'
logging_into_discord = 'Logging into Discord...'
invalid_credentials = "Invalid login credentials.\nIf they worked before Discord might be having temporary technical issues.\nIn this case, press enter and try again later.\nOtherwise you can type 'reset' to delete the current configuration and\nredo the setup process again the next start.\n> "
keep_updated_win = 'Make sure to keep your bot updated by running the file\n update.bat'
keep_updated = 'Make sure to keep Dwarf updated by using:\n\n git pull\npip3 install --upgrade\n git+https://github.com/Rapptz/discord.py@async'
official_server = 'Official server: {}'
invite_link = 'https://discord.me/AileenLumina'
update_the_api = '\nYou are using an outdated discord.py.\n\n Update your discord.py with by running this in your cmd\n prompt/terminal:\npip3 install --upgrade git+https://\n github.com/Rapptz/discord.py@async'
command_disabled = 'That command is disabled.'
exception_in_command = "Exception in command '{}'"
error_in_command = "Error in command '{}' - {}: {}"
not_available_in_dm = 'That command is not available in DMs.'
owner_recognized = '{} has been recognized and set as owner.' |
# Lecture 5, Problem 9
def semordnilapWrapper(str1, str2):
# A single-length string cannot be semordnilap.
if len(str1) == 1 or len(str2) == 1:
return False
# Equal strings cannot be semordnilap.
if str1 == str2:
return False
return semordnilap(str1, str2)
def semordnilap(str1, str2):
'''
str1: a string
str2: a string
returns: True if str1 and str2 are semordnilap;
False otherwise.
'''
if len(str1) != len(str2):
return False
elif len(str1) == 0 or len(str2) == 0:
return True
elif len(str1) == 0 and len(str2) == 0:
return False
elif str1[0] != str2[-1]:
return False
return semordnilap(str1[1:], str2[:-1]) | def semordnilap_wrapper(str1, str2):
if len(str1) == 1 or len(str2) == 1:
return False
if str1 == str2:
return False
return semordnilap(str1, str2)
def semordnilap(str1, str2):
"""
str1: a string
str2: a string
returns: True if str1 and str2 are semordnilap;
False otherwise.
"""
if len(str1) != len(str2):
return False
elif len(str1) == 0 or len(str2) == 0:
return True
elif len(str1) == 0 and len(str2) == 0:
return False
elif str1[0] != str2[-1]:
return False
return semordnilap(str1[1:], str2[:-1]) |
#!/usr/bin/env python
# Monitoring the Mem usage of a Sonicwall
# Herward Cooper <coops@fawk.eu> - 2012
# Uses OID 1.3.6.1.4.1.8741.1.3.1.4.0
sonicwall_mem_default_values = (35, 40)
def inventory_sonicwall_mem(checkname, info):
inventory=[]
inventory.append( (None, None, "sonicwall_mem_default_values") )
return inventory
def check_sonicwall_mem(item, params, info):
warn, crit = params
state = int(info[0][0])
perfdata = [ ( "cpu", state, warn, crit ) ]
if state > crit:
return (2, "CRITICAL - Mem is %s percent" % state, perfdata)
elif state > warn:
return (1, "WARNING - Mem is %s percent" % state, perfdata)
else:
return (0, "OK - Mem is %s percent" % state, perfdata)
check_info["sonicwall_mem"] = (check_sonicwall_mem, "Sonicwall Mem", 1, inventory_sonicwall_mem)
snmp_info["sonicwall_mem"] = ( ".1.3.6.1.4.1.8741.1.3.1.4", [ "0" ] )
| sonicwall_mem_default_values = (35, 40)
def inventory_sonicwall_mem(checkname, info):
inventory = []
inventory.append((None, None, 'sonicwall_mem_default_values'))
return inventory
def check_sonicwall_mem(item, params, info):
(warn, crit) = params
state = int(info[0][0])
perfdata = [('cpu', state, warn, crit)]
if state > crit:
return (2, 'CRITICAL - Mem is %s percent' % state, perfdata)
elif state > warn:
return (1, 'WARNING - Mem is %s percent' % state, perfdata)
else:
return (0, 'OK - Mem is %s percent' % state, perfdata)
check_info['sonicwall_mem'] = (check_sonicwall_mem, 'Sonicwall Mem', 1, inventory_sonicwall_mem)
snmp_info['sonicwall_mem'] = ('.1.3.6.1.4.1.8741.1.3.1.4', ['0']) |
title = 'Projects'
class Card:
def __init__(self, section, url, name, description, image):
self.section = section; self.url = url;
self.image = image; self.name = name; self.description = description
cards = [
Card('2018', 'resources/projects/awg_highres.jpg', 'Automatic Nanomanipulation Platform', 'electric tweezers research system for nanowire control', 'resources/projects/awg.png'),
Card('2018', 'resources/projects/alluvial_highres.jpg', 'Alluvial', 'three-day hexapod robot', 'resources/projects/alluvial.png'),
Card('2018', 'https://ras.ece.utexas.edu', 'UT IEEE RAS Website', 'rewritten in Bootstrap', 'resources/projects/ras.png'),
Card('2017', 'resources/projects/curmudgeon_highres.png', 'Curmudgeon', 'three-day jumping robot', 'resources/projects/curmudgeon.png'),
Card('2016', 'resources/projects/liberty_highres.jpg', 'Freedom to Make', 'maker spirit statue', 'resources/projects/liberty.jpg'),
Card('2016', 'resources/projects/chess_highres.jpg', 'Lasered Chess', 'an exercise in rapid prototyping', 'resources/projects/chess.jpg'),
Card('2016', 'resources/projects/mesa_highres.jpg', 'Battletank Mesa', 'dual-monitor workstation', 'resources/projects/mesa.jpg'),
Card('2016', 'resources/projects/piano_highres.png', 'PIano', 'Raspberry Pi keyboard system', 'resources/projects/piano.png'),
Card('2016', 'resources/projects/markovi_highres.jpg', 'MARKOVI', 'balancing robot chassis', 'resources/projects/markovi.jpg'),
Card('2016', 'resources/projects/dckx_highres.png', 'DCKX', 'xkcd headline illustrator', 'resources/projects/dckx.png'),
Card('2016', 'resources/research/hitr/hitr.jpg', 'Head Impact Test Rig', 'ballistic baseball research system', 'resources/projects/hitr.png'),
Card('2016', 'resources/research/fire/poster.pdf', 'Energy Storage Demo Rig', 'pumped-storage hydroelectricity demonstration model', 'resources/projects/fire.jpg'),
Card('2015', 'resources/projects/ultron_highres.jpg', 'Ultron', 'wooden competition roomba', 'resources/projects/ultron.jpg'),
Card('2015', 'resources/projects/sgi_highres.jpg', 'Sensel Gesture Interface', 'Swype-style keyboard with relative positioning', 'resources/projects/sgi.png'),
Card('2015', 'resources/projects/giraphphe_highres.jpg', 'GiraPHPHe', 'FTC Team 4290 2014-2015 pneumatic powerhouse', 'resources/projects/giraphphe.png'),
Card('2014', 'resources/projects/fermi_highres.jpg', 'FERmi 14', 'symmetrical teleoperated sumobot', 'resources/projects/fermi.jpg'),
Card('2014', 'resources/projects/pov.gif', 'POV Globe', 'persistence-of-vision LEDs', 'resources/projects/pov.png'),
Card('2014', 'resources/projects/4290_2014_highres.png', 'FTC 4290 2013-2014', 'experiments in gearing', 'resources/projects/4290_2014.png'),
Card('2014', 'resources/projects/sinusoidesque_highres.png', 'Sinusoidesque', 'simple arbitrary "sinusoid" visualizer', 'resources/projects/sinusoidesque.png'),
Card('2013', 'resources/projects/4290_2013_highres.png', 'FTC 4290 2012-2013', 'holonomic drives are hard', 'resources/projects/4290_2013.png'),
Card('2012', 'resources/projects/creator_3d_highres.png', 'Creator 3D', '"stochastic" "constraint solving" CAD sketcher', 'resources/projects/creator_3d.png'),
Card('2012', 'resources/projects/phobia_highres.jpg', 'PHobia', 'FTC Team 4290 2011-2012 gateway competition robot', 'resources/projects/phobia.png'),
Card('2012', 'resources/projects/tetris_highres.png', 'Tetris', 'blocks in TI-89 TI-BASIC', 'resources/projects/tetris.png'),
Card('2012', 'resources/projects/mendelssohn_highres.png', 'Mendelssohn', '3D printing from scratch', 'resources/projects/mendelssohn.png'),
]
content="""<header>
<h1>Projects / Daniel Teal</h1>
<p>I build things. Hardware, software, electronics. Here are some of them in chronological order.</p>
<p>Some favorites are the Automatic Electric Nanomanipulation platform, the Head Impact Test Rig, Ultron, and GiraPHPHe.</p>
<p>You may also be interested in my <a href="research.html">research</a>.</p>
</header>"""
sections = []
for card in cards:
if not card.section in sections:
sections.append(card.section)
content += '<div class="section">' + card.section + '</div>\n'
content += '<a class="card"' + (' href="' + card.url + '"' if card.url else '') + '>\n'
content += '<div class="left"><img src="' + card.image + '" alt="' + card.name + '"></div>\n'
content += '<div class="right"><h2>' + card.name + '</h2><p>' + card.description + '</p></div></a>\n'
| title = 'Projects'
class Card:
def __init__(self, section, url, name, description, image):
self.section = section
self.url = url
self.image = image
self.name = name
self.description = description
cards = [card('2018', 'resources/projects/awg_highres.jpg', 'Automatic Nanomanipulation Platform', 'electric tweezers research system for nanowire control', 'resources/projects/awg.png'), card('2018', 'resources/projects/alluvial_highres.jpg', 'Alluvial', 'three-day hexapod robot', 'resources/projects/alluvial.png'), card('2018', 'https://ras.ece.utexas.edu', 'UT IEEE RAS Website', 'rewritten in Bootstrap', 'resources/projects/ras.png'), card('2017', 'resources/projects/curmudgeon_highres.png', 'Curmudgeon', 'three-day jumping robot', 'resources/projects/curmudgeon.png'), card('2016', 'resources/projects/liberty_highres.jpg', 'Freedom to Make', 'maker spirit statue', 'resources/projects/liberty.jpg'), card('2016', 'resources/projects/chess_highres.jpg', 'Lasered Chess', 'an exercise in rapid prototyping', 'resources/projects/chess.jpg'), card('2016', 'resources/projects/mesa_highres.jpg', 'Battletank Mesa', 'dual-monitor workstation', 'resources/projects/mesa.jpg'), card('2016', 'resources/projects/piano_highres.png', 'PIano', 'Raspberry Pi keyboard system', 'resources/projects/piano.png'), card('2016', 'resources/projects/markovi_highres.jpg', 'MARKOVI', 'balancing robot chassis', 'resources/projects/markovi.jpg'), card('2016', 'resources/projects/dckx_highres.png', 'DCKX', 'xkcd headline illustrator', 'resources/projects/dckx.png'), card('2016', 'resources/research/hitr/hitr.jpg', 'Head Impact Test Rig', 'ballistic baseball research system', 'resources/projects/hitr.png'), card('2016', 'resources/research/fire/poster.pdf', 'Energy Storage Demo Rig', 'pumped-storage hydroelectricity demonstration model', 'resources/projects/fire.jpg'), card('2015', 'resources/projects/ultron_highres.jpg', 'Ultron', 'wooden competition roomba', 'resources/projects/ultron.jpg'), card('2015', 'resources/projects/sgi_highres.jpg', 'Sensel Gesture Interface', 'Swype-style keyboard with relative positioning', 'resources/projects/sgi.png'), card('2015', 'resources/projects/giraphphe_highres.jpg', 'GiraPHPHe', 'FTC Team 4290 2014-2015 pneumatic powerhouse', 'resources/projects/giraphphe.png'), card('2014', 'resources/projects/fermi_highres.jpg', 'FERmi 14', 'symmetrical teleoperated sumobot', 'resources/projects/fermi.jpg'), card('2014', 'resources/projects/pov.gif', 'POV Globe', 'persistence-of-vision LEDs', 'resources/projects/pov.png'), card('2014', 'resources/projects/4290_2014_highres.png', 'FTC 4290 2013-2014', 'experiments in gearing', 'resources/projects/4290_2014.png'), card('2014', 'resources/projects/sinusoidesque_highres.png', 'Sinusoidesque', 'simple arbitrary "sinusoid" visualizer', 'resources/projects/sinusoidesque.png'), card('2013', 'resources/projects/4290_2013_highres.png', 'FTC 4290 2012-2013', 'holonomic drives are hard', 'resources/projects/4290_2013.png'), card('2012', 'resources/projects/creator_3d_highres.png', 'Creator 3D', '"stochastic" "constraint solving" CAD sketcher', 'resources/projects/creator_3d.png'), card('2012', 'resources/projects/phobia_highres.jpg', 'PHobia', 'FTC Team 4290 2011-2012 gateway competition robot', 'resources/projects/phobia.png'), card('2012', 'resources/projects/tetris_highres.png', 'Tetris', 'blocks in TI-89 TI-BASIC', 'resources/projects/tetris.png'), card('2012', 'resources/projects/mendelssohn_highres.png', 'Mendelssohn', '3D printing from scratch', 'resources/projects/mendelssohn.png')]
content = '<header>\n<h1>Projects / Daniel Teal</h1>\n<p>I build things. Hardware, software, electronics. Here are some of them in chronological order.</p>\n<p>Some favorites are the Automatic Electric Nanomanipulation platform, the Head Impact Test Rig, Ultron, and GiraPHPHe.</p>\n<p>You may also be interested in my <a href="research.html">research</a>.</p>\n</header>'
sections = []
for card in cards:
if not card.section in sections:
sections.append(card.section)
content += '<div class="section">' + card.section + '</div>\n'
content += '<a class="card"' + (' href="' + card.url + '"' if card.url else '') + '>\n'
content += '<div class="left"><img src="' + card.image + '" alt="' + card.name + '"></div>\n'
content += '<div class="right"><h2>' + card.name + '</h2><p>' + card.description + '</p></div></a>\n' |
class LastPassError(Exception):
def __init__(self, output):
self.output = output
class CliNotInstalledException(Exception):
pass
| class Lastpasserror(Exception):
def __init__(self, output):
self.output = output
class Clinotinstalledexception(Exception):
pass |
def grad_tmp(temp, lat: np.ndarray, lon: np.ndarray) -> np.ndarray:
"""grad_eqv_ptntl_tmp.
calcureta gradient of temperature [K/100km]
Args:
eqv_ptntl_t:
lat (np.ndarray): lat
lon (np.ndarray): lon
Returns:
np.ndarray:
"""
# horizontal equivalent_potential_temperature gradient.
de_dx = [
np.array((temp[i][j] - temp[i][j-1]) / 2 + (temp[i][j+1] - temp[i][j]) / 2) / ((lon[j+1] - lon[j-1]) * 1.11 * math.cos(math.radians(lat[i])))
if j not in (0, len(temp[0]) - 1)
else
np.nan
for i in range(len(temp))
for j in range(len(temp[0]))
]
de_dx = np.array(de_dx).reshape(len(temp), len(temp[0]))
de_dy = [
np.array((temp[i][j] - temp[i-1][j]) / 2 + (temp[i+1][j] - temp[i][j]) / 2) / ((lat[1] - lat[0]) * 1.11)
if i not in (0, len(temp) - 1)
else
np.nan
for i in range(len(temp))
for j in range(len(temp[0]))
]
de_dy = np.array(de_dy).reshape(len(temp), len(temp[0]))
return (de_dx ** 2 + de_dy ** 2) ** 0.5
| def grad_tmp(temp, lat: np.ndarray, lon: np.ndarray) -> np.ndarray:
"""grad_eqv_ptntl_tmp.
calcureta gradient of temperature [K/100km]
Args:
eqv_ptntl_t:
lat (np.ndarray): lat
lon (np.ndarray): lon
Returns:
np.ndarray:
"""
de_dx = [np.array((temp[i][j] - temp[i][j - 1]) / 2 + (temp[i][j + 1] - temp[i][j]) / 2) / ((lon[j + 1] - lon[j - 1]) * 1.11 * math.cos(math.radians(lat[i]))) if j not in (0, len(temp[0]) - 1) else np.nan for i in range(len(temp)) for j in range(len(temp[0]))]
de_dx = np.array(de_dx).reshape(len(temp), len(temp[0]))
de_dy = [np.array((temp[i][j] - temp[i - 1][j]) / 2 + (temp[i + 1][j] - temp[i][j]) / 2) / ((lat[1] - lat[0]) * 1.11) if i not in (0, len(temp) - 1) else np.nan for i in range(len(temp)) for j in range(len(temp[0]))]
de_dy = np.array(de_dy).reshape(len(temp), len(temp[0]))
return (de_dx ** 2 + de_dy ** 2) ** 0.5 |
n=int(input())
arr=[int(x) for x in input().split()]
brr=[int(x) for x in input().split()]
my_list=[]
for i in arr[1:]:
my_list.append(i)
for i in brr[1:]:
my_list.append(i)
for i in range(1,n+1):
if i in my_list:
if i == n:
print("I become the guy.")
break
else:
continue
else:
print("Oh, my keyboard!")
break
| n = int(input())
arr = [int(x) for x in input().split()]
brr = [int(x) for x in input().split()]
my_list = []
for i in arr[1:]:
my_list.append(i)
for i in brr[1:]:
my_list.append(i)
for i in range(1, n + 1):
if i in my_list:
if i == n:
print('I become the guy.')
break
else:
continue
else:
print('Oh, my keyboard!')
break |
'''
Need 3 temporary variables to find the longest substring: start, maxLength,
and usedChars.
Start by walking through string of characters, one at a time.
Check if the current character is in the usedChars map, this would mean we
have already seen it and have stored it's corresponding index.
If it's in there and the start index is <= that index, update start
to the last seen duplicate's index+1. **This will put the start index at just
past the current value's last seen duplicate.** This allows us to have the
longest possible substring that does not contain duplicates.
If it's not in the usedChars map, we can calculate the longest substring
seen so far. Just take the current index minus the start index. If that
value is longer than maxLength, set maxLength to it.
Finally, update the usedChars map to contain the current value that we just
finished processing.
'''
class Solution:
# def lengthOfLongestSubstring(self, s):
# start = maxLength = 0
# usedChar = {}
# for i in range(len(s)):
# print("Iteration number = {}".format(i))
# if s[i] in usedChar and start <= usedChar[s[i]]:
# start = usedChar[s[i]] + 1
# print("start = {}".format(start))
# else:
# maxLength = max(maxLength, i - start + 1)
# usedChar[s[i]] = i
# print("usedChar = {}".format(usedChar))
# print("===")
# return maxLength
# def lengthOfLongestSubstring(self, s: str) -> int:
# seen = {}
# l = 0
# output = 0
# for r in range(len(s)):
# """
# There are two cases if s[r] in seen:
# case1: s[r] is inside the current window, we need to change the window by moving left pointer to seen[s[r]] + 1.
# case2: s[r] is not inside the current window, we can keep increase the window
# """
# if s[r] not in seen:
# # + 1 is to compensate the 0-indexed
# output = max(output, r-l+1)
# else:
# if seen[s[r]] < l:
# output = max(output, r-l+1)
# else:
# l = seen[s[r]] + 1
# seen[s[r]] = r
# return output
# def lengthOfLongestSubstring(self, s: str) -> int:
# """
# :type s: str
# :rtype: int abcabcbb
# """
# if len(s) == 0:
# return 0
# seen = {}
# left, right = 0, 0
# longest = 1
# while right < len(s):
# if s[right] in seen:
# left = max(left, right)
# longest = max(longest, right - left + 1)
# seen[s[right]] = right
# right += 1
# print(left, right, longest)
# print(seen)
# return longest
def lengthOfLongestSubstring(self, s: str) -> int:
seen = {}
mx = left = 0
for right, c in enumerate(s):
if c in seen:
left = max(left, seen[c] + 1)
seen[c] = right
mx = max(mx, right-left+1)
return mx
s = Solution()
print(s.lengthOfLongestSubstring("abcabcbb"))
| """
Need 3 temporary variables to find the longest substring: start, maxLength,
and usedChars.
Start by walking through string of characters, one at a time.
Check if the current character is in the usedChars map, this would mean we
have already seen it and have stored it's corresponding index.
If it's in there and the start index is <= that index, update start
to the last seen duplicate's index+1. **This will put the start index at just
past the current value's last seen duplicate.** This allows us to have the
longest possible substring that does not contain duplicates.
If it's not in the usedChars map, we can calculate the longest substring
seen so far. Just take the current index minus the start index. If that
value is longer than maxLength, set maxLength to it.
Finally, update the usedChars map to contain the current value that we just
finished processing.
"""
class Solution:
def length_of_longest_substring(self, s: str) -> int:
seen = {}
mx = left = 0
for (right, c) in enumerate(s):
if c in seen:
left = max(left, seen[c] + 1)
seen[c] = right
mx = max(mx, right - left + 1)
return mx
s = solution()
print(s.lengthOfLongestSubstring('abcabcbb')) |
class APICONTROLLERNAMEController(apicontrollersbase.APIOperationBase):
def __init__(self, apirequest):
super(APICONTROLLERNAMEController, self).__init__(apirequest)
return
def validaterequest(self):
logging.debug('performing custom validation..')
#validate required fields
#if (self._request.xyz == "null"):
# raise ValueError('xyz is required')
return
def getrequesttype(self):
'''Returns request type'''
return 'APICONTROLLERNAMERequest'
def getresponseclass(self):
''' Returns the response class '''
return apicontractsv1.APICONTROLLERNAMEResponse() | class Apicontrollernamecontroller(apicontrollersbase.APIOperationBase):
def __init__(self, apirequest):
super(APICONTROLLERNAMEController, self).__init__(apirequest)
return
def validaterequest(self):
logging.debug('performing custom validation..')
return
def getrequesttype(self):
"""Returns request type"""
return 'APICONTROLLERNAMERequest'
def getresponseclass(self):
""" Returns the response class """
return apicontractsv1.APICONTROLLERNAMEResponse() |
class Solution:
"""
@param nums: A list of integer which is 0, 1 or 2
@return: nothing
"""
def sortColors(self, nums):
# write your code here
if nums == None or len(nums) <= 1:
return
pl = 0
pr = len(nums) - 1
i = 0
while i <= pr:
if nums[i] == 0:
nums = self.swap(nums, pl, i)
pl += 1
i += 1
elif nums[i] == 1:
i += 1
else:
nums = self.swap(nums, pr, i)
pr -= 1
return nums
def swap(self, a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a
| class Solution:
"""
@param nums: A list of integer which is 0, 1 or 2
@return: nothing
"""
def sort_colors(self, nums):
if nums == None or len(nums) <= 1:
return
pl = 0
pr = len(nums) - 1
i = 0
while i <= pr:
if nums[i] == 0:
nums = self.swap(nums, pl, i)
pl += 1
i += 1
elif nums[i] == 1:
i += 1
else:
nums = self.swap(nums, pr, i)
pr -= 1
return nums
def swap(self, a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a |
# Leo colorizer control file for c mode.
# This file is in the public domain.
# Properties for c mode.
properties = {
"commentEnd": "*/",
"commentStart": "/*",
"doubleBracketIndent": "false",
"indentCloseBrackets": "}",
"indentNextLine": "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)",
"indentOpenBrackets": "{",
"lineComment": "//",
"lineUpClosingBracket": "true",
"wordBreakChars": ",+-=<>/?^&*",
}
# Attributes dict for c_main ruleset.
c_main_attributes_dict = {
"default": "null",
"digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
"escape": "\\",
"highlight_digits": "true",
"ignore_case": "false",
"no_word_sep": "",
}
# Attributes dict for c_cpp ruleset.
c_cpp_attributes_dict = {
"default": "KEYWORD2",
"digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
"escape": "\\",
"highlight_digits": "true",
"ignore_case": "false",
"no_word_sep": "",
}
# Attributes dict for c_include ruleset.
c_include_attributes_dict = {
"default": "KEYWORD2",
"digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
"escape": "\\",
"highlight_digits": "true",
"ignore_case": "false",
"no_word_sep": "",
}
# Dictionary of attributes dictionaries for c mode.
attributesDictDict = {
"c_cpp": c_cpp_attributes_dict,
"c_include": c_include_attributes_dict,
"c_main": c_main_attributes_dict,
}
# Keywords dict for c_main ruleset.
c_main_keywords_dict = {
"NULL": "literal2",
"asm": "keyword2",
"asmlinkage": "keyword2",
"auto": "keyword1",
"break": "keyword1",
"case": "keyword1",
"char": "keyword3",
"const": "keyword1",
"continue": "keyword1",
"default": "keyword1",
"do": "keyword1",
"double": "keyword3",
"else": "keyword1",
"enum": "keyword3",
"extern": "keyword1",
"false": "literal2",
"far": "keyword2",
"float": "keyword3",
"for": "keyword1",
"goto": "keyword1",
"huge": "keyword2",
"if": "keyword1",
"inline": "keyword2",
"int": "keyword3",
"long": "keyword3",
"near": "keyword2",
"pascal": "keyword2",
"register": "keyword1",
"return": "keyword1",
"short": "keyword3",
"signed": "keyword3",
"sizeof": "keyword1",
"static": "keyword1",
"struct": "keyword3",
"switch": "keyword1",
"true": "literal2",
"typedef": "keyword3",
"union": "keyword3",
"unsigned": "keyword3",
"void": "keyword3",
"volatile": "keyword1",
"while": "keyword1",
}
# Keywords dict for c_cpp ruleset.
c_cpp_keywords_dict = {
"assert": "markup",
"define": "markup",
"elif": "markup",
"else": "markup",
"endif": "markup",
"error": "markup",
"ident": "markup",
"if": "markup",
"ifdef": "markup",
"ifndef": "markup",
"import": "markup",
"include": "markup",
"include_next": "markup",
"line": "markup",
"pragma": "markup",
"sccs": "markup",
"unassert": "markup",
"undef": "markup",
"warning": "markup",
}
# Keywords dict for c_include ruleset.
c_include_keywords_dict = {}
# Dictionary of keywords dictionaries for c mode.
keywordsDictDict = {
"c_cpp": c_cpp_keywords_dict,
"c_include": c_include_keywords_dict,
"c_main": c_main_keywords_dict,
}
# Rules for c_main ruleset.
def c_rule0(colorer, s, i):
return colorer.match_span(s, i, kind="comment3", begin="/**", end="*/",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="doxygen::doxygen",exclude_match=False,
no_escape=False, no_line_break=False, no_word_break=False)
def c_rule1(colorer, s, i):
return colorer.match_span(s, i, kind="comment3", begin="/*!", end="*/",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="doxygen::doxygen",exclude_match=False,
no_escape=False, no_line_break=False, no_word_break=False)
def c_rule2(colorer, s, i):
return colorer.match_span(s, i, kind="comment1", begin="/*", end="*/",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=False, no_word_break=False)
def c_rule3(colorer, s, i):
return colorer.match_span(s, i, kind="literal1", begin="\"", end="\"",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=True, no_word_break=False)
def c_rule4(colorer, s, i):
return colorer.match_span(s, i, kind="literal1", begin="'", end="'",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=True, no_word_break=False)
def c_rule5(colorer, s, i):
return colorer.match_seq(s, i, kind="keyword2", seq="##",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule6(colorer, s, i):
return colorer.match_eol_span(s, i, kind="keyword2", seq="#",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="c::cpp", exclude_match=False)
def c_rule7(colorer, s, i):
return colorer.match_eol_span(s, i, kind="comment2", seq="//",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="", exclude_match=False)
def c_rule8(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule9(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="!",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule10(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq=">=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule11(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="<=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule12(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="+",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule13(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="-",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule14(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="/",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule15(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="*",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule16(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq=">",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule17(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="<",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule18(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="%",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule19(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="&",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule20(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="|",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule21(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="^",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule22(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="~",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule23(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="}",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule24(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="{",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def c_rule25(colorer, s, i):
return colorer.match_mark_previous(s, i, kind="label", pattern=":",
at_line_start=False, at_whitespace_end=True, at_word_start=False, exclude_match=True)
def c_rule26(colorer, s, i):
return colorer.match_mark_previous(s, i, kind="function", pattern="(",
at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=True)
def c_rule27(colorer, s, i):
return colorer.match_keywords(s, i)
# Rules dict for c_main ruleset.
rulesDict1 = {
"!": [c_rule9,],
"\"": [c_rule3,],
"#": [c_rule5,c_rule6,],
"%": [c_rule18,],
"&": [c_rule19,],
"'": [c_rule4,],
"(": [c_rule26,],
"*": [c_rule15,],
"+": [c_rule12,],
"-": [c_rule13,],
"/": [c_rule0,c_rule1,c_rule2,c_rule7,c_rule14,],
"0": [c_rule27,],
"1": [c_rule27,],
"2": [c_rule27,],
"3": [c_rule27,],
"4": [c_rule27,],
"5": [c_rule27,],
"6": [c_rule27,],
"7": [c_rule27,],
"8": [c_rule27,],
"9": [c_rule27,],
":": [c_rule25,],
"<": [c_rule11,c_rule17,],
"=": [c_rule8,],
">": [c_rule10,c_rule16,],
"@": [c_rule27,],
"A": [c_rule27,],
"B": [c_rule27,],
"C": [c_rule27,],
"D": [c_rule27,],
"E": [c_rule27,],
"F": [c_rule27,],
"G": [c_rule27,],
"H": [c_rule27,],
"I": [c_rule27,],
"J": [c_rule27,],
"K": [c_rule27,],
"L": [c_rule27,],
"M": [c_rule27,],
"N": [c_rule27,],
"O": [c_rule27,],
"P": [c_rule27,],
"Q": [c_rule27,],
"R": [c_rule27,],
"S": [c_rule27,],
"T": [c_rule27,],
"U": [c_rule27,],
"V": [c_rule27,],
"W": [c_rule27,],
"X": [c_rule27,],
"Y": [c_rule27,],
"Z": [c_rule27,],
"^": [c_rule21,],
"_": [c_rule27,],
"a": [c_rule27,],
"b": [c_rule27,],
"c": [c_rule27,],
"d": [c_rule27,],
"e": [c_rule27,],
"f": [c_rule27,],
"g": [c_rule27,],
"h": [c_rule27,],
"i": [c_rule27,],
"j": [c_rule27,],
"k": [c_rule27,],
"l": [c_rule27,],
"m": [c_rule27,],
"n": [c_rule27,],
"o": [c_rule27,],
"p": [c_rule27,],
"q": [c_rule27,],
"r": [c_rule27,],
"s": [c_rule27,],
"t": [c_rule27,],
"u": [c_rule27,],
"v": [c_rule27,],
"w": [c_rule27,],
"x": [c_rule27,],
"y": [c_rule27,],
"z": [c_rule27,],
"{": [c_rule24,],
"|": [c_rule20,],
"}": [c_rule23,],
"~": [c_rule22,],
}
# Rules for c_cpp ruleset.
def c_rule28(colorer, s, i):
return colorer.match_span(s, i, kind="comment1", begin="/*", end="*/",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=False, no_word_break=False)
def c_rule29(colorer, s, i):
return colorer.match_eol_span(s, i, kind="markup", seq="include",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="c::include", exclude_match=False)
def c_rule30(colorer, s, i):
return colorer.match_keywords(s, i)
# Rules dict for c_cpp ruleset.
rulesDict2 = {
"/": [c_rule28,],
"0": [c_rule30,],
"1": [c_rule30,],
"2": [c_rule30,],
"3": [c_rule30,],
"4": [c_rule30,],
"5": [c_rule30,],
"6": [c_rule30,],
"7": [c_rule30,],
"8": [c_rule30,],
"9": [c_rule30,],
"@": [c_rule30,],
"A": [c_rule30,],
"B": [c_rule30,],
"C": [c_rule30,],
"D": [c_rule30,],
"E": [c_rule30,],
"F": [c_rule30,],
"G": [c_rule30,],
"H": [c_rule30,],
"I": [c_rule30,],
"J": [c_rule30,],
"K": [c_rule30,],
"L": [c_rule30,],
"M": [c_rule30,],
"N": [c_rule30,],
"O": [c_rule30,],
"P": [c_rule30,],
"Q": [c_rule30,],
"R": [c_rule30,],
"S": [c_rule30,],
"T": [c_rule30,],
"U": [c_rule30,],
"V": [c_rule30,],
"W": [c_rule30,],
"X": [c_rule30,],
"Y": [c_rule30,],
"Z": [c_rule30,],
"_": [c_rule30,],
"a": [c_rule30,],
"b": [c_rule30,],
"c": [c_rule30,],
"d": [c_rule30,],
"e": [c_rule30,],
"f": [c_rule30,],
"g": [c_rule30,],
"h": [c_rule30,],
"i": [c_rule29,c_rule30,],
"j": [c_rule30,],
"k": [c_rule30,],
"l": [c_rule30,],
"m": [c_rule30,],
"n": [c_rule30,],
"o": [c_rule30,],
"p": [c_rule30,],
"q": [c_rule30,],
"r": [c_rule30,],
"s": [c_rule30,],
"t": [c_rule30,],
"u": [c_rule30,],
"v": [c_rule30,],
"w": [c_rule30,],
"x": [c_rule30,],
"y": [c_rule30,],
"z": [c_rule30,],
}
# Rules for c_include ruleset.
# Rules dict for c_include ruleset.
rulesDict3 = {}
# x.rulesDictDict for c mode.
rulesDictDict = {
"c_cpp": rulesDict2,
"c_include": rulesDict3,
"c_main": rulesDict1,
}
# Import dict for c mode.
importDict = {}
| properties = {'commentEnd': '*/', 'commentStart': '/*', 'doubleBracketIndent': 'false', 'indentCloseBrackets': '}', 'indentNextLine': '\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)', 'indentOpenBrackets': '{', 'lineComment': '//', 'lineUpClosingBracket': 'true', 'wordBreakChars': ',+-=<>/?^&*'}
c_main_attributes_dict = {'default': 'null', 'digit_re': '(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)', 'escape': '\\', 'highlight_digits': 'true', 'ignore_case': 'false', 'no_word_sep': ''}
c_cpp_attributes_dict = {'default': 'KEYWORD2', 'digit_re': '(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)', 'escape': '\\', 'highlight_digits': 'true', 'ignore_case': 'false', 'no_word_sep': ''}
c_include_attributes_dict = {'default': 'KEYWORD2', 'digit_re': '(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)', 'escape': '\\', 'highlight_digits': 'true', 'ignore_case': 'false', 'no_word_sep': ''}
attributes_dict_dict = {'c_cpp': c_cpp_attributes_dict, 'c_include': c_include_attributes_dict, 'c_main': c_main_attributes_dict}
c_main_keywords_dict = {'NULL': 'literal2', 'asm': 'keyword2', 'asmlinkage': 'keyword2', 'auto': 'keyword1', 'break': 'keyword1', 'case': 'keyword1', 'char': 'keyword3', 'const': 'keyword1', 'continue': 'keyword1', 'default': 'keyword1', 'do': 'keyword1', 'double': 'keyword3', 'else': 'keyword1', 'enum': 'keyword3', 'extern': 'keyword1', 'false': 'literal2', 'far': 'keyword2', 'float': 'keyword3', 'for': 'keyword1', 'goto': 'keyword1', 'huge': 'keyword2', 'if': 'keyword1', 'inline': 'keyword2', 'int': 'keyword3', 'long': 'keyword3', 'near': 'keyword2', 'pascal': 'keyword2', 'register': 'keyword1', 'return': 'keyword1', 'short': 'keyword3', 'signed': 'keyword3', 'sizeof': 'keyword1', 'static': 'keyword1', 'struct': 'keyword3', 'switch': 'keyword1', 'true': 'literal2', 'typedef': 'keyword3', 'union': 'keyword3', 'unsigned': 'keyword3', 'void': 'keyword3', 'volatile': 'keyword1', 'while': 'keyword1'}
c_cpp_keywords_dict = {'assert': 'markup', 'define': 'markup', 'elif': 'markup', 'else': 'markup', 'endif': 'markup', 'error': 'markup', 'ident': 'markup', 'if': 'markup', 'ifdef': 'markup', 'ifndef': 'markup', 'import': 'markup', 'include': 'markup', 'include_next': 'markup', 'line': 'markup', 'pragma': 'markup', 'sccs': 'markup', 'unassert': 'markup', 'undef': 'markup', 'warning': 'markup'}
c_include_keywords_dict = {}
keywords_dict_dict = {'c_cpp': c_cpp_keywords_dict, 'c_include': c_include_keywords_dict, 'c_main': c_main_keywords_dict}
def c_rule0(colorer, s, i):
return colorer.match_span(s, i, kind='comment3', begin='/**', end='*/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='doxygen::doxygen', exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False)
def c_rule1(colorer, s, i):
return colorer.match_span(s, i, kind='comment3', begin='/*!', end='*/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='doxygen::doxygen', exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False)
def c_rule2(colorer, s, i):
return colorer.match_span(s, i, kind='comment1', begin='/*', end='*/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False)
def c_rule3(colorer, s, i):
return colorer.match_span(s, i, kind='literal1', begin='"', end='"', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=True, no_word_break=False)
def c_rule4(colorer, s, i):
return colorer.match_span(s, i, kind='literal1', begin="'", end="'", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=True, no_word_break=False)
def c_rule5(colorer, s, i):
return colorer.match_seq(s, i, kind='keyword2', seq='##', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule6(colorer, s, i):
return colorer.match_eol_span(s, i, kind='keyword2', seq='#', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='c::cpp', exclude_match=False)
def c_rule7(colorer, s, i):
return colorer.match_eol_span(s, i, kind='comment2', seq='//', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False)
def c_rule8(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule9(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='!', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule10(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='>=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule11(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='<=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule12(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='+', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule13(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='-', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule14(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule15(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='*', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule16(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='>', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule17(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='<', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule18(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='%', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule19(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='&', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule20(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='|', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule21(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='^', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule22(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='~', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule23(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='}', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule24(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='{', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def c_rule25(colorer, s, i):
return colorer.match_mark_previous(s, i, kind='label', pattern=':', at_line_start=False, at_whitespace_end=True, at_word_start=False, exclude_match=True)
def c_rule26(colorer, s, i):
return colorer.match_mark_previous(s, i, kind='function', pattern='(', at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=True)
def c_rule27(colorer, s, i):
return colorer.match_keywords(s, i)
rules_dict1 = {'!': [c_rule9], '"': [c_rule3], '#': [c_rule5, c_rule6], '%': [c_rule18], '&': [c_rule19], "'": [c_rule4], '(': [c_rule26], '*': [c_rule15], '+': [c_rule12], '-': [c_rule13], '/': [c_rule0, c_rule1, c_rule2, c_rule7, c_rule14], '0': [c_rule27], '1': [c_rule27], '2': [c_rule27], '3': [c_rule27], '4': [c_rule27], '5': [c_rule27], '6': [c_rule27], '7': [c_rule27], '8': [c_rule27], '9': [c_rule27], ':': [c_rule25], '<': [c_rule11, c_rule17], '=': [c_rule8], '>': [c_rule10, c_rule16], '@': [c_rule27], 'A': [c_rule27], 'B': [c_rule27], 'C': [c_rule27], 'D': [c_rule27], 'E': [c_rule27], 'F': [c_rule27], 'G': [c_rule27], 'H': [c_rule27], 'I': [c_rule27], 'J': [c_rule27], 'K': [c_rule27], 'L': [c_rule27], 'M': [c_rule27], 'N': [c_rule27], 'O': [c_rule27], 'P': [c_rule27], 'Q': [c_rule27], 'R': [c_rule27], 'S': [c_rule27], 'T': [c_rule27], 'U': [c_rule27], 'V': [c_rule27], 'W': [c_rule27], 'X': [c_rule27], 'Y': [c_rule27], 'Z': [c_rule27], '^': [c_rule21], '_': [c_rule27], 'a': [c_rule27], 'b': [c_rule27], 'c': [c_rule27], 'd': [c_rule27], 'e': [c_rule27], 'f': [c_rule27], 'g': [c_rule27], 'h': [c_rule27], 'i': [c_rule27], 'j': [c_rule27], 'k': [c_rule27], 'l': [c_rule27], 'm': [c_rule27], 'n': [c_rule27], 'o': [c_rule27], 'p': [c_rule27], 'q': [c_rule27], 'r': [c_rule27], 's': [c_rule27], 't': [c_rule27], 'u': [c_rule27], 'v': [c_rule27], 'w': [c_rule27], 'x': [c_rule27], 'y': [c_rule27], 'z': [c_rule27], '{': [c_rule24], '|': [c_rule20], '}': [c_rule23], '~': [c_rule22]}
def c_rule28(colorer, s, i):
return colorer.match_span(s, i, kind='comment1', begin='/*', end='*/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False)
def c_rule29(colorer, s, i):
return colorer.match_eol_span(s, i, kind='markup', seq='include', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='c::include', exclude_match=False)
def c_rule30(colorer, s, i):
return colorer.match_keywords(s, i)
rules_dict2 = {'/': [c_rule28], '0': [c_rule30], '1': [c_rule30], '2': [c_rule30], '3': [c_rule30], '4': [c_rule30], '5': [c_rule30], '6': [c_rule30], '7': [c_rule30], '8': [c_rule30], '9': [c_rule30], '@': [c_rule30], 'A': [c_rule30], 'B': [c_rule30], 'C': [c_rule30], 'D': [c_rule30], 'E': [c_rule30], 'F': [c_rule30], 'G': [c_rule30], 'H': [c_rule30], 'I': [c_rule30], 'J': [c_rule30], 'K': [c_rule30], 'L': [c_rule30], 'M': [c_rule30], 'N': [c_rule30], 'O': [c_rule30], 'P': [c_rule30], 'Q': [c_rule30], 'R': [c_rule30], 'S': [c_rule30], 'T': [c_rule30], 'U': [c_rule30], 'V': [c_rule30], 'W': [c_rule30], 'X': [c_rule30], 'Y': [c_rule30], 'Z': [c_rule30], '_': [c_rule30], 'a': [c_rule30], 'b': [c_rule30], 'c': [c_rule30], 'd': [c_rule30], 'e': [c_rule30], 'f': [c_rule30], 'g': [c_rule30], 'h': [c_rule30], 'i': [c_rule29, c_rule30], 'j': [c_rule30], 'k': [c_rule30], 'l': [c_rule30], 'm': [c_rule30], 'n': [c_rule30], 'o': [c_rule30], 'p': [c_rule30], 'q': [c_rule30], 'r': [c_rule30], 's': [c_rule30], 't': [c_rule30], 'u': [c_rule30], 'v': [c_rule30], 'w': [c_rule30], 'x': [c_rule30], 'y': [c_rule30], 'z': [c_rule30]}
rules_dict3 = {}
rules_dict_dict = {'c_cpp': rulesDict2, 'c_include': rulesDict3, 'c_main': rulesDict1}
import_dict = {} |
class Solution:
def eraseOverlapIntervals(self, intervals: List[List[int]]) -> int:
if not intervals:
return 0
intervals.sort(key = lambda interval : interval[1])
res = 0
prev = intervals[0][1]
for i in range(1, len(intervals)):
if intervals[i][0] < prev:
res +=1
else:
prev = intervals[i][1]
return res
| class Solution:
def erase_overlap_intervals(self, intervals: List[List[int]]) -> int:
if not intervals:
return 0
intervals.sort(key=lambda interval: interval[1])
res = 0
prev = intervals[0][1]
for i in range(1, len(intervals)):
if intervals[i][0] < prev:
res += 1
else:
prev = intervals[i][1]
return res |
#https://www.interviewbit.com/problems/max-distance/
def maximumGap(A):
left = [A[0]]
right = [A[-1]]
n = len(A)
for i in range(1,n):
left.append(min(left[-1], A[i]))
for i in range(n-2, -1, -1):
right.insert(0, max(right[0], A[i]))
i,j,gap = 0, 0, -1
while (i < n and j < n):
if left[i] < right[j]:
gap = max(gap, j-i)
j += 1 # look for a larger gap
else:
i += 1
return gap
# test cases
assert(maximumGap([3,5,4,2])==2)
assert(maximumGap([3,2,1,0])==-1) | def maximum_gap(A):
left = [A[0]]
right = [A[-1]]
n = len(A)
for i in range(1, n):
left.append(min(left[-1], A[i]))
for i in range(n - 2, -1, -1):
right.insert(0, max(right[0], A[i]))
(i, j, gap) = (0, 0, -1)
while i < n and j < n:
if left[i] < right[j]:
gap = max(gap, j - i)
j += 1
else:
i += 1
return gap
assert maximum_gap([3, 5, 4, 2]) == 2
assert maximum_gap([3, 2, 1, 0]) == -1 |
'''
Created on May 24, 2012
@author: newatv2user
'''
PIANO_RPC_HOST = "tuner.pandora.com"
PIANO_ONE_HOST = "internal-tuner.pandora.com"
PIANO_RPC_PATH = "/services/json/?"
class PianoUserInfo:
def __init__(self):
self.listenerId = ''
self.authToken = ''
class PianoStation:
def __init__(self):
self.isCreator = ''
self.isQuickMix = ''
self.useQuickMix = ''
self.name = ''
self.id = ''
self.seedId = ''
# Piano Song Rating Enum
PIANO_RATE_NONE = 0
PIANO_RATE_LOVE = 1
PIANO_RATE_BAN = 2
class PianoSongRating:
def __init__(self):
self.Rating = PIANO_RATE_NONE
# Piano Audio Format Enum
PIANO_AF_UNKNOWN = 0
PIANO_AF_AACPLUS = 1
PIANO_AF_MP3 = 2
PIANO_AF_MP3_HI = 3
PIANO_AF_AACPLUS_LO = 4
class PianoAudioFormat:
def __init__(self):
self.Format = PIANO_AF_UNKNOWN
class PianoSong:
def __init__(self):
self.artist = ''
self.stationId = ''
self.album = ''
self.audioUrl = ''
self.coverArt = ''
self.musicId = ''
self.title = ''
self.seedId = ''
self.feedbackId = ''
self.detailUrl = ''
self.trackToken = ''
self.fileGain = 0
self.rating = PianoSongRating()
self.audioFormat = PianoAudioFormat()
class PianoArtist:
def __init__(self):
self.name = ''
self.musicId = ''
self.seedId = ''
self.score = 0
self.next = PianoArtist()
class PianoGenre:
def __init__(self):
self.name = ''
self.musicId = ''
class PianoGenreCategory:
def __init__(self):
self.name = ''
self.genres = PianoGenre()
class PianoPartner:
def __init__(self):
self.In = ''
self.out = ''
self.authToken = ''
self.device = ''
self.user = ''
self.password = ''
self.id = 0
class PianoSearchResult:
def __init__(self):
self.songs = PianoSong()
self.artists = PianoArtist()
class PianoStationInfo:
def __init__(self):
self.songSeeds = PianoSong()
self.artistSeeds = PianoArtist()
self.stationSeeds = PianoStation()
self.feedback = PianoSong()
# Piano Request Type Enum
#/* 0 is reserved: memset (x, 0, sizeof (x)) */
PIANO_REQUEST_LOGIN = 1
PIANO_REQUEST_GET_STATIONS = 2
PIANO_REQUEST_GET_PLAYLIST = 3
PIANO_REQUEST_RATE_SONG = 4
PIANO_REQUEST_ADD_FEEDBACK = 5
PIANO_REQUEST_MOVE_SONG = 6
PIANO_REQUEST_RENAME_STATION = 7
PIANO_REQUEST_DELETE_STATION = 8
PIANO_REQUEST_SEARCH = 9
PIANO_REQUEST_CREATE_STATION = 10
PIANO_REQUEST_ADD_SEED = 11
PIANO_REQUEST_ADD_TIRED_SONG = 12
PIANO_REQUEST_SET_QUICKMIX = 13
PIANO_REQUEST_GET_GENRE_STATIONS = 14
PIANO_REQUEST_TRANSFORM_STATION = 15
PIANO_REQUEST_EXPLAIN = 16
PIANO_REQUEST_BOOKMARK_SONG = 18
PIANO_REQUEST_BOOKMARK_ARTIST = 19
PIANO_REQUEST_GET_STATION_INFO = 20
PIANO_REQUEST_DELETE_FEEDBACK = 21
PIANO_REQUEST_DELETE_SEED = 22
class PianoRequestType:
def __init__(self):
self.RequestType = PIANO_REQUEST_LOGIN
class PianoRequest:
def __init__(self):
self.type = PianoRequestType()
self.secure = False
self.data = ''
self.urlPath = [1024]
self.postData = ''
self.responseData = ''
#/* request data structures */
class PianoRequestDataLogin:
def __init__(self):
self.user = ''
self.password = ''
self.step = ''
class PianoRequestDataGetPlaylist:
def __init__(self):
self.station = PianoStation()
self.format = PianoAudioFormat()
self.retPlaylist = PianoSong()
class PianoRequestDataRateSong:
def __init__(self):
self.song = PianoSong()
self.rating = PianoSongRating()
class PianoRequestDataAddFeedback:
def __init__(self):
self.stationId = ''
self.trackToken = ''
self.rating = PianoSongRating()
class PianoRequestDataMoveSong:
def __init__(self):
self.song = PianoSong()
self.From = PianoStation()
self.to = PianoStation()
self.step = 0
class PianoRequestDataRenameStation:
def __init__(self):
self.station = PianoStation()
self.newName = ''
class PianoRequestDataSearch:
def __init__(self):
self.searchStr = ''
self.searchResult = PianoSearchResult()
class PianoRequestDataCreateStation:
def __init__(self):
self.type = ''
self.id = ''
class PianoRequestDataAddSeed:
def __init__(self):
self.station = PianoStation()
self.musicId = ''
class PianoRequestDataExplain:
def __init__(self):
self.song = PianoSong()
self.retExplain = ''
class PianoRequestDataGetStationInfo:
def __init__(self):
self.station = PianoStation()
self.info = PianoStationInfo()
class PianoRequestDataDeleteSeed:
def __init__(self):
self.song = PianoSong()
self.artist = PianoArtist()
self.station = PianoStation()
#/* pandora error code offset */
PIANO_RET_OFFSET = 1024
# Piano Return Enum
PIANO_RET_ERR = 0
PIANO_RET_OK = 1
PIANO_RET_INVALID_RESPONSE = 2
PIANO_RET_CONTINUE_REQUEST = 3
PIANO_RET_OUT_OF_MEMORY = 4
PIANO_RET_INVALID_LOGIN = 5
PIANO_RET_QUALITY_UNAVAILABLE = 6
PIANO_RET_P_INTERNAL = PIANO_RET_OFFSET + 0
PIANO_RET_P_API_VERSION_NOT_SUPPORTED = PIANO_RET_OFFSET + 11
PIANO_RET_P_BIRTH_YEAR_INVALID = PIANO_RET_OFFSET + 1025
PIANO_RET_P_BIRTH_YEAR_TOO_YOUNG = PIANO_RET_OFFSET + 1026
PIANO_RET_P_CALL_NOT_ALLOWED = PIANO_RET_OFFSET + 1008
PIANO_RET_P_CERTIFICATE_REQUIRED = PIANO_RET_OFFSET + 7
PIANO_RET_P_COMPLIMENTARY_PERIOD_ALREADY_IN_USE = PIANO_RET_OFFSET + 1007
PIANO_RET_P_DAILY_TRIAL_LIMIT_REACHED = PIANO_RET_OFFSET + 1035
PIANO_RET_P_DEVICE_ALREADY_ASSOCIATED_TO_ACCOUNT = PIANO_RET_OFFSET + 1014
PIANO_RET_P_DEVICE_DISABLED = PIANO_RET_OFFSET + 1034
PIANO_RET_P_DEVICE_MODEL_INVALID = PIANO_RET_OFFSET + 1023
PIANO_RET_P_DEVICE_NOT_FOUND = PIANO_RET_OFFSET + 1009
PIANO_RET_P_EXPLICIT_PIN_INCORRECT = PIANO_RET_OFFSET + 1018
PIANO_RET_P_EXPLICIT_PIN_MALFORMED = PIANO_RET_OFFSET + 1020
PIANO_RET_P_INSUFFICIENT_CONNECTIVITY = PIANO_RET_OFFSET + 13
PIANO_RET_P_INVALID_AUTH_TOKEN = PIANO_RET_OFFSET + 1001
PIANO_RET_P_INVALID_COUNTRY_CODE = PIANO_RET_OFFSET + 1027
PIANO_RET_P_INVALID_GENDER = PIANO_RET_OFFSET + 1027
PIANO_RET_P_INVALID_PARTNER_LOGIN = PIANO_RET_OFFSET + 1002
PIANO_RET_P_INVALID_PASSWORD = PIANO_RET_OFFSET + 1012
PIANO_RET_P_INVALID_SPONSOR = PIANO_RET_OFFSET + 1036
PIANO_RET_P_INVALID_USERNAME = PIANO_RET_OFFSET + 1011
PIANO_RET_P_LICENSING_RESTRICTIONS = PIANO_RET_OFFSET + 12
PIANO_RET_P_MAINTENANCE_MODE = PIANO_RET_OFFSET + 1
PIANO_RET_P_MAX_STATIONS_REACHED = PIANO_RET_OFFSET + 1005
PIANO_RET_P_PARAMETER_MISSING = PIANO_RET_OFFSET + 9
PIANO_RET_P_PARAMETER_TYPE_MISMATCH = PIANO_RET_OFFSET + 8
PIANO_RET_P_PARAMETER_VALUE_INVALID = PIANO_RET_OFFSET + 10
PIANO_RET_P_PARTNER_NOT_AUTHORIZED = PIANO_RET_OFFSET + 1010
PIANO_RET_P_READ_ONLY_MODE = PIANO_RET_OFFSET + 1000
PIANO_RET_P_SECURE_PROTOCOL_REQUIRED = PIANO_RET_OFFSET + 6
PIANO_RET_P_STATION_DOES_NOT_EXIST = PIANO_RET_OFFSET + 1006
PIANO_RET_P_UPGRADE_DEVICE_MODEL_INVALID = PIANO_RET_OFFSET + 1015
PIANO_RET_P_URL_PARAM_MISSING_AUTH_TOKEN = PIANO_RET_OFFSET + 3
PIANO_RET_P_URL_PARAM_MISSING_METHOD = PIANO_RET_OFFSET + 2
PIANO_RET_P_URL_PARAM_MISSING_PARTNER_ID = PIANO_RET_OFFSET + 4
PIANO_RET_P_URL_PARAM_MISSING_USER_ID = PIANO_RET_OFFSET + 5
PIANO_RET_P_USERNAME_ALREADY_EXISTS = PIANO_RET_OFFSET + 1013
PIANO_RET_P_USER_ALREADY_USED_TRIAL = PIANO_RET_OFFSET + 1037
PIANO_RET_P_LISTENER_NOT_AUTHORIZED = PIANO_RET_OFFSET + 1003
PIANO_RET_P_USER_NOT_AUTHORIZED = PIANO_RET_OFFSET + 1004
PIANO_RET_P_ZIP_CODE_INVALID = PIANO_RET_OFFSET + 1024
class PianoReturn:
def __init__(self):
self.Return = PIANO_RET_ERR
def PianoFindStationById (stations, searchStation):
#/* get station from list by id
#* @param search here
#* @param search for this
#* @return the first station structure matching the given id
#*/
for station in stations:
if station.id == searchStation:
return station
return None
def PianoErrorToStr (ret):
#/* convert return value to human-readable string
#* @param enum
#* @return error string
#*/
return {
PIANO_RET_OK: "Everything is fine :)",
PIANO_RET_ERR: "Unknown.",
PIANO_RET_INVALID_RESPONSE: "Invalid response.",
PIANO_RET_CONTINUE_REQUEST: "Fix your program.",
PIANO_RET_OUT_OF_MEMORY: "Out of memory.",
PIANO_RET_INVALID_LOGIN: "Wrong email address or password.",
PIANO_RET_QUALITY_UNAVAILABLE: "Selected audio quality is not available.",
PIANO_RET_P_INTERNAL: "Internal error.",
PIANO_RET_P_CALL_NOT_ALLOWED: "Call not allowed.",
PIANO_RET_P_INVALID_AUTH_TOKEN: "Invalid auth token.",
PIANO_RET_P_MAINTENANCE_MODE: "Maintenance mode.",
PIANO_RET_P_MAX_STATIONS_REACHED: "Max number of stations reached.",
PIANO_RET_P_READ_ONLY_MODE: "Read only mode. Try again later.",
PIANO_RET_P_STATION_DOES_NOT_EXIST: "Station does not exist.",
PIANO_RET_P_INVALID_PARTNER_LOGIN: "Invalid partner login.",
PIANO_RET_P_LICENSING_RESTRICTIONS: "Pandora is not available in your country. "\
"Set up a control proxy (see manpage).",
PIANO_RET_P_PARTNER_NOT_AUTHORIZED: "Invalid partner credentials.",
PIANO_RET_P_LISTENER_NOT_AUTHORIZED: "Listener not authorized."
}.get(ret, "No error message available.")
| """
Created on May 24, 2012
@author: newatv2user
"""
piano_rpc_host = 'tuner.pandora.com'
piano_one_host = 'internal-tuner.pandora.com'
piano_rpc_path = '/services/json/?'
class Pianouserinfo:
def __init__(self):
self.listenerId = ''
self.authToken = ''
class Pianostation:
def __init__(self):
self.isCreator = ''
self.isQuickMix = ''
self.useQuickMix = ''
self.name = ''
self.id = ''
self.seedId = ''
piano_rate_none = 0
piano_rate_love = 1
piano_rate_ban = 2
class Pianosongrating:
def __init__(self):
self.Rating = PIANO_RATE_NONE
piano_af_unknown = 0
piano_af_aacplus = 1
piano_af_mp3 = 2
piano_af_mp3_hi = 3
piano_af_aacplus_lo = 4
class Pianoaudioformat:
def __init__(self):
self.Format = PIANO_AF_UNKNOWN
class Pianosong:
def __init__(self):
self.artist = ''
self.stationId = ''
self.album = ''
self.audioUrl = ''
self.coverArt = ''
self.musicId = ''
self.title = ''
self.seedId = ''
self.feedbackId = ''
self.detailUrl = ''
self.trackToken = ''
self.fileGain = 0
self.rating = piano_song_rating()
self.audioFormat = piano_audio_format()
class Pianoartist:
def __init__(self):
self.name = ''
self.musicId = ''
self.seedId = ''
self.score = 0
self.next = piano_artist()
class Pianogenre:
def __init__(self):
self.name = ''
self.musicId = ''
class Pianogenrecategory:
def __init__(self):
self.name = ''
self.genres = piano_genre()
class Pianopartner:
def __init__(self):
self.In = ''
self.out = ''
self.authToken = ''
self.device = ''
self.user = ''
self.password = ''
self.id = 0
class Pianosearchresult:
def __init__(self):
self.songs = piano_song()
self.artists = piano_artist()
class Pianostationinfo:
def __init__(self):
self.songSeeds = piano_song()
self.artistSeeds = piano_artist()
self.stationSeeds = piano_station()
self.feedback = piano_song()
piano_request_login = 1
piano_request_get_stations = 2
piano_request_get_playlist = 3
piano_request_rate_song = 4
piano_request_add_feedback = 5
piano_request_move_song = 6
piano_request_rename_station = 7
piano_request_delete_station = 8
piano_request_search = 9
piano_request_create_station = 10
piano_request_add_seed = 11
piano_request_add_tired_song = 12
piano_request_set_quickmix = 13
piano_request_get_genre_stations = 14
piano_request_transform_station = 15
piano_request_explain = 16
piano_request_bookmark_song = 18
piano_request_bookmark_artist = 19
piano_request_get_station_info = 20
piano_request_delete_feedback = 21
piano_request_delete_seed = 22
class Pianorequesttype:
def __init__(self):
self.RequestType = PIANO_REQUEST_LOGIN
class Pianorequest:
def __init__(self):
self.type = piano_request_type()
self.secure = False
self.data = ''
self.urlPath = [1024]
self.postData = ''
self.responseData = ''
class Pianorequestdatalogin:
def __init__(self):
self.user = ''
self.password = ''
self.step = ''
class Pianorequestdatagetplaylist:
def __init__(self):
self.station = piano_station()
self.format = piano_audio_format()
self.retPlaylist = piano_song()
class Pianorequestdataratesong:
def __init__(self):
self.song = piano_song()
self.rating = piano_song_rating()
class Pianorequestdataaddfeedback:
def __init__(self):
self.stationId = ''
self.trackToken = ''
self.rating = piano_song_rating()
class Pianorequestdatamovesong:
def __init__(self):
self.song = piano_song()
self.From = piano_station()
self.to = piano_station()
self.step = 0
class Pianorequestdatarenamestation:
def __init__(self):
self.station = piano_station()
self.newName = ''
class Pianorequestdatasearch:
def __init__(self):
self.searchStr = ''
self.searchResult = piano_search_result()
class Pianorequestdatacreatestation:
def __init__(self):
self.type = ''
self.id = ''
class Pianorequestdataaddseed:
def __init__(self):
self.station = piano_station()
self.musicId = ''
class Pianorequestdataexplain:
def __init__(self):
self.song = piano_song()
self.retExplain = ''
class Pianorequestdatagetstationinfo:
def __init__(self):
self.station = piano_station()
self.info = piano_station_info()
class Pianorequestdatadeleteseed:
def __init__(self):
self.song = piano_song()
self.artist = piano_artist()
self.station = piano_station()
piano_ret_offset = 1024
piano_ret_err = 0
piano_ret_ok = 1
piano_ret_invalid_response = 2
piano_ret_continue_request = 3
piano_ret_out_of_memory = 4
piano_ret_invalid_login = 5
piano_ret_quality_unavailable = 6
piano_ret_p_internal = PIANO_RET_OFFSET + 0
piano_ret_p_api_version_not_supported = PIANO_RET_OFFSET + 11
piano_ret_p_birth_year_invalid = PIANO_RET_OFFSET + 1025
piano_ret_p_birth_year_too_young = PIANO_RET_OFFSET + 1026
piano_ret_p_call_not_allowed = PIANO_RET_OFFSET + 1008
piano_ret_p_certificate_required = PIANO_RET_OFFSET + 7
piano_ret_p_complimentary_period_already_in_use = PIANO_RET_OFFSET + 1007
piano_ret_p_daily_trial_limit_reached = PIANO_RET_OFFSET + 1035
piano_ret_p_device_already_associated_to_account = PIANO_RET_OFFSET + 1014
piano_ret_p_device_disabled = PIANO_RET_OFFSET + 1034
piano_ret_p_device_model_invalid = PIANO_RET_OFFSET + 1023
piano_ret_p_device_not_found = PIANO_RET_OFFSET + 1009
piano_ret_p_explicit_pin_incorrect = PIANO_RET_OFFSET + 1018
piano_ret_p_explicit_pin_malformed = PIANO_RET_OFFSET + 1020
piano_ret_p_insufficient_connectivity = PIANO_RET_OFFSET + 13
piano_ret_p_invalid_auth_token = PIANO_RET_OFFSET + 1001
piano_ret_p_invalid_country_code = PIANO_RET_OFFSET + 1027
piano_ret_p_invalid_gender = PIANO_RET_OFFSET + 1027
piano_ret_p_invalid_partner_login = PIANO_RET_OFFSET + 1002
piano_ret_p_invalid_password = PIANO_RET_OFFSET + 1012
piano_ret_p_invalid_sponsor = PIANO_RET_OFFSET + 1036
piano_ret_p_invalid_username = PIANO_RET_OFFSET + 1011
piano_ret_p_licensing_restrictions = PIANO_RET_OFFSET + 12
piano_ret_p_maintenance_mode = PIANO_RET_OFFSET + 1
piano_ret_p_max_stations_reached = PIANO_RET_OFFSET + 1005
piano_ret_p_parameter_missing = PIANO_RET_OFFSET + 9
piano_ret_p_parameter_type_mismatch = PIANO_RET_OFFSET + 8
piano_ret_p_parameter_value_invalid = PIANO_RET_OFFSET + 10
piano_ret_p_partner_not_authorized = PIANO_RET_OFFSET + 1010
piano_ret_p_read_only_mode = PIANO_RET_OFFSET + 1000
piano_ret_p_secure_protocol_required = PIANO_RET_OFFSET + 6
piano_ret_p_station_does_not_exist = PIANO_RET_OFFSET + 1006
piano_ret_p_upgrade_device_model_invalid = PIANO_RET_OFFSET + 1015
piano_ret_p_url_param_missing_auth_token = PIANO_RET_OFFSET + 3
piano_ret_p_url_param_missing_method = PIANO_RET_OFFSET + 2
piano_ret_p_url_param_missing_partner_id = PIANO_RET_OFFSET + 4
piano_ret_p_url_param_missing_user_id = PIANO_RET_OFFSET + 5
piano_ret_p_username_already_exists = PIANO_RET_OFFSET + 1013
piano_ret_p_user_already_used_trial = PIANO_RET_OFFSET + 1037
piano_ret_p_listener_not_authorized = PIANO_RET_OFFSET + 1003
piano_ret_p_user_not_authorized = PIANO_RET_OFFSET + 1004
piano_ret_p_zip_code_invalid = PIANO_RET_OFFSET + 1024
class Pianoreturn:
def __init__(self):
self.Return = PIANO_RET_ERR
def piano_find_station_by_id(stations, searchStation):
for station in stations:
if station.id == searchStation:
return station
return None
def piano_error_to_str(ret):
return {PIANO_RET_OK: 'Everything is fine :)', PIANO_RET_ERR: 'Unknown.', PIANO_RET_INVALID_RESPONSE: 'Invalid response.', PIANO_RET_CONTINUE_REQUEST: 'Fix your program.', PIANO_RET_OUT_OF_MEMORY: 'Out of memory.', PIANO_RET_INVALID_LOGIN: 'Wrong email address or password.', PIANO_RET_QUALITY_UNAVAILABLE: 'Selected audio quality is not available.', PIANO_RET_P_INTERNAL: 'Internal error.', PIANO_RET_P_CALL_NOT_ALLOWED: 'Call not allowed.', PIANO_RET_P_INVALID_AUTH_TOKEN: 'Invalid auth token.', PIANO_RET_P_MAINTENANCE_MODE: 'Maintenance mode.', PIANO_RET_P_MAX_STATIONS_REACHED: 'Max number of stations reached.', PIANO_RET_P_READ_ONLY_MODE: 'Read only mode. Try again later.', PIANO_RET_P_STATION_DOES_NOT_EXIST: 'Station does not exist.', PIANO_RET_P_INVALID_PARTNER_LOGIN: 'Invalid partner login.', PIANO_RET_P_LICENSING_RESTRICTIONS: 'Pandora is not available in your country. Set up a control proxy (see manpage).', PIANO_RET_P_PARTNER_NOT_AUTHORIZED: 'Invalid partner credentials.', PIANO_RET_P_LISTENER_NOT_AUTHORIZED: 'Listener not authorized.'}.get(ret, 'No error message available.') |
class Emplacement:
"""
documentation
"""
def __init__(self, id, line, n):
self.id = id
line = line.split(' ')
distances = {}
i = 0
for elt in line:
if elt != '':
i+=1
if i != id:
distances[i] = int(elt.replace('\n', ''))
if len(distances) != n-1:
print("ERROR: len(distances) != n-1")
self.distances = distances
self.equipment = None | class Emplacement:
"""
documentation
"""
def __init__(self, id, line, n):
self.id = id
line = line.split(' ')
distances = {}
i = 0
for elt in line:
if elt != '':
i += 1
if i != id:
distances[i] = int(elt.replace('\n', ''))
if len(distances) != n - 1:
print('ERROR: len(distances) != n-1')
self.distances = distances
self.equipment = None |
"""
Streamlined python project setup and build system.
"""
__version__ = "0.2"
DESCRIPTION = __doc__
__all__ = ['__init__', '__main__', 'parsers']
| """
Streamlined python project setup and build system.
"""
__version__ = '0.2'
description = __doc__
__all__ = ['__init__', '__main__', 'parsers'] |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
class Error(object):
@staticmethod
def exceeded_maximum_metric_capacity():
return "ErrorExceededMaximumMetricCapacity"
@staticmethod
def missing_attribute():
return "ErrorMissingAttributes"
@staticmethod
def is_not_lower():
return "ErrorNotLowerCase"
@staticmethod
def out_of_order():
return "ErrorOutOfOrder"
@staticmethod
def unable_to_sort():
return "ErrorNotSorted"
@staticmethod
def is_null():
return "ErrorNullValue"
@staticmethod
def empty_dataframe():
return "ErrorEmptyDataFrame"
| class Error(object):
@staticmethod
def exceeded_maximum_metric_capacity():
return 'ErrorExceededMaximumMetricCapacity'
@staticmethod
def missing_attribute():
return 'ErrorMissingAttributes'
@staticmethod
def is_not_lower():
return 'ErrorNotLowerCase'
@staticmethod
def out_of_order():
return 'ErrorOutOfOrder'
@staticmethod
def unable_to_sort():
return 'ErrorNotSorted'
@staticmethod
def is_null():
return 'ErrorNullValue'
@staticmethod
def empty_dataframe():
return 'ErrorEmptyDataFrame' |
class Singleton(type):
def __new__(meta, name, bases, attrs):
attrs["_instance"] = None
return super().__new__(meta, name, bases, attrs)
def __call__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super().__call__(*args, **kwargs)
return cls._instance
| class Singleton(type):
def __new__(meta, name, bases, attrs):
attrs['_instance'] = None
return super().__new__(meta, name, bases, attrs)
def __call__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super().__call__(*args, **kwargs)
return cls._instance |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: template_deploy
short_description: Manage TemplateDeploy objects of ConfigurationTemplates
description:
- Deploys a template.
- Returns the status of a deployed template.
version_added: '1.0.0'
author: Rafael Campos (@racampos)
options:
forcePushTemplate:
description:
- TemplateDeploymentInfo's forcePushTemplate.
type: bool
isComposite:
description:
- TemplateDeploymentInfo's isComposite.
type: bool
mainTemplateId:
description:
- TemplateDeploymentInfo's mainTemplateId.
type: str
memberTemplateDeploymentInfo:
description:
- TemplateDeploymentInfo's memberTemplateDeploymentInfo (list of any objects).
type: list
targetInfo:
description:
- TemplateDeploymentInfo's targetInfo (list of objects).
type: list
elements: dict
suboptions:
hostName:
description:
- It is the template deploy's hostName.
type: str
id:
description:
- It is the template deploy's id.
type: str
params:
description:
- It is the template deploy's params.
type: dict
type:
description:
- It is the template deploy's type.
type: str
templateId:
description:
- TemplateDeploymentInfo's templateId.
type: str
deployment_id:
description:
- DeploymentId path parameter.
- Required for state query.
type: str
requirements:
- dnacentersdk
seealso:
# Reference by module name
- module: cisco.dnac.plugins.module_utils.definitions.template_deploy
# Reference by Internet resource
- name: TemplateDeploy reference
description: Complete reference of the TemplateDeploy object model.
link: https://developer.cisco.com/docs/dna-center/api/1-3-3-x
# Reference by Internet resource
- name: TemplateDeploy reference
description: SDK reference.
link: https://dnacentersdk.readthedocs.io/en/latest/api/api.html#v2-1-1-summary
"""
EXAMPLES = r"""
- name: deploy_template
cisco.dnac.template_deploy:
state: create # required
forcePushTemplate: True # boolean
isComposite: True # boolean
mainTemplateId: SomeValue # string
memberTemplateDeploymentInfo: None
targetInfo:
- hostName: SomeValue # string
id: SomeValue # string
params:
type: SomeValue # string
templateId: SomeValue # string
- name: get_template_deployment_status
cisco.dnac.template_deploy:
state: query # required
deployment_id: SomeValue # string, required
register: nm_get_template_deployment_status
"""
RETURN = r"""
dnac_response:
description: A dictionary with the response returned by the DNA Center Python SDK
returned: always
type: dict
sample: {"response": 29, "version": "1.0"}
sdk_function:
description: The DNA Center SDK function used to execute the task
returned: always
type: str
sample: configuration_templates.deploy_template
missing_params:
description: Provided arguments do not comply with the schema of the DNA Center Python SDK function
returned: when the function request schema is not satisfied
type: list
sample:
"""
| documentation = "\n---\nmodule: template_deploy\nshort_description: Manage TemplateDeploy objects of ConfigurationTemplates\ndescription:\n- Deploys a template.\n- Returns the status of a deployed template.\nversion_added: '1.0.0'\nauthor: Rafael Campos (@racampos)\noptions:\n forcePushTemplate:\n description:\n - TemplateDeploymentInfo's forcePushTemplate.\n type: bool\n isComposite:\n description:\n - TemplateDeploymentInfo's isComposite.\n type: bool\n mainTemplateId:\n description:\n - TemplateDeploymentInfo's mainTemplateId.\n type: str\n memberTemplateDeploymentInfo:\n description:\n - TemplateDeploymentInfo's memberTemplateDeploymentInfo (list of any objects).\n type: list\n targetInfo:\n description:\n - TemplateDeploymentInfo's targetInfo (list of objects).\n type: list\n elements: dict\n suboptions:\n hostName:\n description:\n - It is the template deploy's hostName.\n type: str\n id:\n description:\n - It is the template deploy's id.\n type: str\n params:\n description:\n - It is the template deploy's params.\n type: dict\n type:\n description:\n - It is the template deploy's type.\n type: str\n\n templateId:\n description:\n - TemplateDeploymentInfo's templateId.\n type: str\n deployment_id:\n description:\n - DeploymentId path parameter.\n - Required for state query.\n type: str\n\nrequirements:\n- dnacentersdk\nseealso:\n# Reference by module name\n- module: cisco.dnac.plugins.module_utils.definitions.template_deploy\n# Reference by Internet resource\n- name: TemplateDeploy reference\n description: Complete reference of the TemplateDeploy object model.\n link: https://developer.cisco.com/docs/dna-center/api/1-3-3-x\n# Reference by Internet resource\n- name: TemplateDeploy reference\n description: SDK reference.\n link: https://dnacentersdk.readthedocs.io/en/latest/api/api.html#v2-1-1-summary\n"
examples = '\n- name: deploy_template\n cisco.dnac.template_deploy:\n state: create # required\n forcePushTemplate: True # boolean\n isComposite: True # boolean\n mainTemplateId: SomeValue # string\n memberTemplateDeploymentInfo: None\n targetInfo:\n - hostName: SomeValue # string\n id: SomeValue # string\n params:\n type: SomeValue # string\n templateId: SomeValue # string\n\n- name: get_template_deployment_status\n cisco.dnac.template_deploy:\n state: query # required\n deployment_id: SomeValue # string, required\n register: nm_get_template_deployment_status\n\n'
return = '\ndnac_response:\n description: A dictionary with the response returned by the DNA Center Python SDK\n returned: always\n type: dict\n sample: {"response": 29, "version": "1.0"}\nsdk_function:\n description: The DNA Center SDK function used to execute the task\n returned: always\n type: str\n sample: configuration_templates.deploy_template\nmissing_params:\n description: Provided arguments do not comply with the schema of the DNA Center Python SDK function\n returned: when the function request schema is not satisfied\n type: list\n sample:\n' |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/pygictower/blob/master/NOTICE
__version__ = "0.0.1"
| __version__ = '0.0.1' |
def countBits(n: int) -> list[int]:
result = [0]
for i in range(1,n+1):
count = 0
test = ~(i - 1)
while test & 1 == 0:
test >>= 1
count += 1
result.append(result[i-1] - count + 1)
return result | def count_bits(n: int) -> list[int]:
result = [0]
for i in range(1, n + 1):
count = 0
test = ~(i - 1)
while test & 1 == 0:
test >>= 1
count += 1
result.append(result[i - 1] - count + 1)
return result |
class Predicate(object):
def test(self, obj):
raise NotImplementedError()
def __call__(self, obj):
return self.test(obj)
def __eq__(self, obj):
return self.test(obj)
def __ne__(self, obj):
return not self == obj
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
def __str__(self):
return self.describe()
def __repr__(self):
return "<%s>" % self
def describe(self, variable="X"):
return self._describe(variable) + "?"
def _describe(self, variable):
raise NotImplementedError()
class FunctionPredicate(Predicate):
def __init__(self, func, description=None):
super(FunctionPredicate, self).__init__()
self.func = func
if description is None:
description = func.__doc__
self.description = description
def test(self, obj):
if isinstance(obj, FunctionPredicate):
return obj.func is self.func
else:
return self.func(obj)
def _describe(self, variable):
if self.description:
return self.description % dict(var=variable)
else:
return "%s(%s)" % (self.func,variable)
class Equality(Predicate):
def __init__(self, value):
super(Equality, self).__init__()
self.value = value
def test(self, obj):
if isinstance(obj, Equality):
return obj.value == self.value
else:
return obj == self.value
def _describe(self, variable):
return "%s==%s" % (variable, str(self.value))
Inequality = lambda value: Not(Equality(value))
class Or(Predicate):
def __init__(self, *preds):
super(Or, self).__init__()
self.preds = map(make_predicate, preds)
def test(self, obj):
return any(p == obj for p in self.preds)
def _describe(self, variable):
return " OR ".join("(%s)" % pred._describe(variable) for pred in self.preds)
class And(Predicate):
def __init__(self, *preds):
super(And, self).__init__()
self.preds = map(make_predicate, preds)
def test(self, obj):
return all(p == obj for p in self.preds)
def _describe(self, variable):
return " AND ".join("(%s)" % pred._describe(variable) for pred in self.preds)
class Not(Predicate):
def __init__(self, pred):
super(Not, self).__init__()
self.pred = make_predicate(pred)
def test(self, obj):
return not self.pred == obj
def _describe(self, variable):
return "NOT(%s)" % (self.pred._describe(variable),)
class _Dummy(Predicate):
def __init__(self, retval, description=""):
self.retval = retval
self.description = description
def test(self, other):
return self.retval
def _describe(self, variable):
return self.description
IGNORE = _Dummy(True, "ANYTHING")
FAIL = _Dummy(False, "NOTHING")
def make_predicate(expr):
"""
common utility for making various expressions into predicates
"""
if isinstance(expr, Predicate):
return expr
elif isinstance(expr, type):
return FunctionPredicate(lambda obj, type=expr: isinstance(obj, type))
elif callable(expr):
return FunctionPredicate(expr)
else:
return Equality(expr)
P = make_predicate
| class Predicate(object):
def test(self, obj):
raise not_implemented_error()
def __call__(self, obj):
return self.test(obj)
def __eq__(self, obj):
return self.test(obj)
def __ne__(self, obj):
return not self == obj
def __and__(self, other):
return and(self, other)
def __or__(self, other):
return or(self, other)
def __str__(self):
return self.describe()
def __repr__(self):
return '<%s>' % self
def describe(self, variable='X'):
return self._describe(variable) + '?'
def _describe(self, variable):
raise not_implemented_error()
class Functionpredicate(Predicate):
def __init__(self, func, description=None):
super(FunctionPredicate, self).__init__()
self.func = func
if description is None:
description = func.__doc__
self.description = description
def test(self, obj):
if isinstance(obj, FunctionPredicate):
return obj.func is self.func
else:
return self.func(obj)
def _describe(self, variable):
if self.description:
return self.description % dict(var=variable)
else:
return '%s(%s)' % (self.func, variable)
class Equality(Predicate):
def __init__(self, value):
super(Equality, self).__init__()
self.value = value
def test(self, obj):
if isinstance(obj, Equality):
return obj.value == self.value
else:
return obj == self.value
def _describe(self, variable):
return '%s==%s' % (variable, str(self.value))
inequality = lambda value: not(equality(value))
class Or(Predicate):
def __init__(self, *preds):
super(Or, self).__init__()
self.preds = map(make_predicate, preds)
def test(self, obj):
return any((p == obj for p in self.preds))
def _describe(self, variable):
return ' OR '.join(('(%s)' % pred._describe(variable) for pred in self.preds))
class And(Predicate):
def __init__(self, *preds):
super(And, self).__init__()
self.preds = map(make_predicate, preds)
def test(self, obj):
return all((p == obj for p in self.preds))
def _describe(self, variable):
return ' AND '.join(('(%s)' % pred._describe(variable) for pred in self.preds))
class Not(Predicate):
def __init__(self, pred):
super(Not, self).__init__()
self.pred = make_predicate(pred)
def test(self, obj):
return not self.pred == obj
def _describe(self, variable):
return 'NOT(%s)' % (self.pred._describe(variable),)
class _Dummy(Predicate):
def __init__(self, retval, description=''):
self.retval = retval
self.description = description
def test(self, other):
return self.retval
def _describe(self, variable):
return self.description
ignore = __dummy(True, 'ANYTHING')
fail = __dummy(False, 'NOTHING')
def make_predicate(expr):
"""
common utility for making various expressions into predicates
"""
if isinstance(expr, Predicate):
return expr
elif isinstance(expr, type):
return function_predicate(lambda obj, type=expr: isinstance(obj, type))
elif callable(expr):
return function_predicate(expr)
else:
return equality(expr)
p = make_predicate |
# Copyright 2018 Jianfei Gao, Leonardo Teixeira, Bruno Ribeiro.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Summer Time Period
Set summer time period for stratux data to shift time zone.
"""
SUMMER = {
2017: ((3, 12), (11, 5)),
2018: ((3, 11), (11, 4)),
2019: ((3, 10), (11, 3)),
}
"""Minimum Ground Speed
Set minimum ground speed, above which will be regarded as flight.
The default class embedded value is 0.0005, and is empirically designed.
"""
GROUND_SPEED_THRESHOLD = 0.0004
"""Problematic Flights
Set problematic flights which are provided commonly, but in trouble. For instance,
1. There are some flights provided in G1000 records which are not real flight data.
2. Some time stratux will run out of battery, and give partial flight data which will
crash alignment process.
"""
HIZARD_FLIGHTS = ('112017_02', '112817_01', '022718_01', '030418_03')
"""Input Keywords
Necessary keywords of input in short version.
By current, it is defined by five types:
1. GPS
2. Speed of GPS (Not divided by time step)
3. Acceleration of GPS (Not divided by time step)
4. Accelerometer
5. Gyroscope
"""
INPUT_KEYWORDS = (
'alt', 'lat', 'long',
'spd_alt', 'spd_lat', 'spd_long',
'acc_alt', 'acc_lat', 'acc_long',
'accmx', 'accmy', 'accmz',
'gyrox', 'gyroy', 'gyroz',
)
"""Window Configuration
Window configuration for dividing sequences into frames.
It should contain enough information for generating frames. For instance,
1. It should have window length for input and target;
2. It should have information to compute window offset length for input and target;
3. It should have padding method for input and target.
"""
WINDOW_CONFIG = {
'input': {
'length': 32,
'offset_length': None, 'offset_rate': 0.4,
'padding': 'repeat_base',
},
'target': {
'length': 32,
'offset_length': None, 'offset_rate': 0.4,
'padding': 'repeat_base',
},
} | """Summer Time Period
Set summer time period for stratux data to shift time zone.
"""
summer = {2017: ((3, 12), (11, 5)), 2018: ((3, 11), (11, 4)), 2019: ((3, 10), (11, 3))}
'Minimum Ground Speed\n\nSet minimum ground speed, above which will be regarded as flight.\nThe default class embedded value is 0.0005, and is empirically designed.\n\n'
ground_speed_threshold = 0.0004
'Problematic Flights\n\nSet problematic flights which are provided commonly, but in trouble. For instance,\n\n1. There are some flights provided in G1000 records which are not real flight data.\n\n2. Some time stratux will run out of battery, and give partial flight data which will\ncrash alignment process.\n\n'
hizard_flights = ('112017_02', '112817_01', '022718_01', '030418_03')
'Input Keywords\n\nNecessary keywords of input in short version.\nBy current, it is defined by five types:\n\n1. GPS\n2. Speed of GPS (Not divided by time step)\n3. Acceleration of GPS (Not divided by time step)\n4. Accelerometer\n5. Gyroscope\n\n'
input_keywords = ('alt', 'lat', 'long', 'spd_alt', 'spd_lat', 'spd_long', 'acc_alt', 'acc_lat', 'acc_long', 'accmx', 'accmy', 'accmz', 'gyrox', 'gyroy', 'gyroz')
'Window Configuration\n\nWindow configuration for dividing sequences into frames.\nIt should contain enough information for generating frames. For instance,\n\n1. It should have window length for input and target;\n2. It should have information to compute window offset length for input and target;\n3. It should have padding method for input and target.\n\n'
window_config = {'input': {'length': 32, 'offset_length': None, 'offset_rate': 0.4, 'padding': 'repeat_base'}, 'target': {'length': 32, 'offset_length': None, 'offset_rate': 0.4, 'padding': 'repeat_base'}} |
def increment(dictionary, k1, k2):
"""
dictionary[k1][k2]++
:param dictionary: Dictionary of dictionary of integers.
:param k1: First key.
:param k2: Second key.
:return: same dictionary with incremented [k1][k2]
"""
if k1 not in dictionary:
dictionary[k1] = {}
if 0 not in dictionary[k1]:
dictionary[k1][0] = 0
if k2 not in dictionary[k1]:
dictionary[k1][k2] = 0
dictionary[k1][0] += 1 # k1 count
dictionary[k1][k2] += 1 # k1, k2 pair count
return dictionary
def get_tags(input, flatten=False):
"""
Get the tags from an input.
:param input: list of tags, list of tuples (word, tag), list of lists of tags or list of lists of tuples (word, tag)
:param flatten:
:return: list of tags.
"""
if type(input[0]) is str: # The input is a list of tags.
tag_list = input
elif type(input[0]) is tuple: # The input is a list of tuples (word, tag).
tag_list = [tag for (word, tag) in input]
else: # The input is a list of lists.
if type(input[0][0]) is str: # The input is a list of lists of tags.
tag_list = input
elif type(input[0][0]) is tuple: # The input is a list of lists of tuples (word, tag).
tag_list = []
for sentence in input:
tag_list.append([tag for (word, tag) in sentence])
if flatten:
tag_list = [tag for sublist in tag_list for tag in sublist]
return tag_list
def get_words(input, flatten=False):
"""
Get the tags from an input.
:param input: list of tags, list of tuples (word, tag), list of lists of tags or list of lists of tuples (word, tag)
:param flatten:
:return: list of tags.
"""
if type(input[0]) is str: # The input is a list of tags.
word_list = input
elif type(input[0]) is tuple: # The input is a list of tuples (word, tag).
word_list = [word for (word, tag) in input]
else: # The input is a list of lists.
if type(input[0][0]) is str: # The input is a list of lists of tags.
word_list = input
elif type(input[0][0]) is tuple: # The input is a list of lists of tuples (word, tag).
word_list = []
for sentence in input:
word_list.append([word for (word, tag) in sentence])
if flatten:
word_list = [word for sublist in word_list for word in sublist]
return word_list
| def increment(dictionary, k1, k2):
"""
dictionary[k1][k2]++
:param dictionary: Dictionary of dictionary of integers.
:param k1: First key.
:param k2: Second key.
:return: same dictionary with incremented [k1][k2]
"""
if k1 not in dictionary:
dictionary[k1] = {}
if 0 not in dictionary[k1]:
dictionary[k1][0] = 0
if k2 not in dictionary[k1]:
dictionary[k1][k2] = 0
dictionary[k1][0] += 1
dictionary[k1][k2] += 1
return dictionary
def get_tags(input, flatten=False):
"""
Get the tags from an input.
:param input: list of tags, list of tuples (word, tag), list of lists of tags or list of lists of tuples (word, tag)
:param flatten:
:return: list of tags.
"""
if type(input[0]) is str:
tag_list = input
elif type(input[0]) is tuple:
tag_list = [tag for (word, tag) in input]
elif type(input[0][0]) is str:
tag_list = input
elif type(input[0][0]) is tuple:
tag_list = []
for sentence in input:
tag_list.append([tag for (word, tag) in sentence])
if flatten:
tag_list = [tag for sublist in tag_list for tag in sublist]
return tag_list
def get_words(input, flatten=False):
"""
Get the tags from an input.
:param input: list of tags, list of tuples (word, tag), list of lists of tags or list of lists of tuples (word, tag)
:param flatten:
:return: list of tags.
"""
if type(input[0]) is str:
word_list = input
elif type(input[0]) is tuple:
word_list = [word for (word, tag) in input]
elif type(input[0][0]) is str:
word_list = input
elif type(input[0][0]) is tuple:
word_list = []
for sentence in input:
word_list.append([word for (word, tag) in sentence])
if flatten:
word_list = [word for sublist in word_list for word in sublist]
return word_list |
# Solution to Advent of Code 2020 day 6
# Read data
with open("input.txt") as inFile:
groups = inFile.read().split("\n\n")
# Part 1
yesAnswers = sum([len(set(group.replace("\n", ""))) for group in groups])
print("Solution for part 1:", yesAnswers)
# Part 2
yesAnswers = 0
for group in groups:
persons = group.split("\n")
sameAnswers = set(persons[0])
for person in persons[1:]:
sameAnswers &= set(person)
yesAnswers += len(sameAnswers)
print("Solution for part 2:", yesAnswers)
| with open('input.txt') as in_file:
groups = inFile.read().split('\n\n')
yes_answers = sum([len(set(group.replace('\n', ''))) for group in groups])
print('Solution for part 1:', yesAnswers)
yes_answers = 0
for group in groups:
persons = group.split('\n')
same_answers = set(persons[0])
for person in persons[1:]:
same_answers &= set(person)
yes_answers += len(sameAnswers)
print('Solution for part 2:', yesAnswers) |
DOCARRAY_PULL_NAME = "fashion-product-images-clip-all"
DATA_DIR = "../data/images" # Where are the files?
CSV_FILE = "../data/styles.csv" # Where's the metadata?
WORKSPACE_DIR = "../embeddings"
DIMS = 512 # This should be same shape as vector embedding
| docarray_pull_name = 'fashion-product-images-clip-all'
data_dir = '../data/images'
csv_file = '../data/styles.csv'
workspace_dir = '../embeddings'
dims = 512 |
def Instagram_scroller(driver,command):
print('In scroller function')
while True:
while True:
l0 = ["scroll up","call down","call don","scroll down","up","down","exit","roll down","croll down","roll up","croll up"]
if len([i for i in l0 if i in command]) != 0:
break
else:
speak("Please , come again .")
command = takeCommand().lower()
print("in scroller function, while loop")
l = ["scroll down","down","roll down","croll down"]
if len([i for i in l if i in command]) != 0:
print("voice gets recognized")
speak("Scrolling Down the pan")
while True:
driver.execute_script("window.scrollBy(0,500)","")
time.sleep(0)
q = takeCommand().lower()
if "stop" in q or "exit" in q or "top" in q:
speak("Exiting the scroll down")
break
l2 = ["scroll up","croll up","up","roll up","call app"]
if len([i for i in l2 if i in command]) != 0:
speak("Scrolling up the pan")
while True:
driver.execute_script("scrollBy(0,-2000);")
time.sleep(0)
q = takeCommand().lower()
if "stop" in q or "exit" in q or "top" in q:
speak("Exiting the scroll up")
break
command = takeCommand().lower()
if "exit" in command:
speak("exiting from scroller")
break | def instagram_scroller(driver, command):
print('In scroller function')
while True:
while True:
l0 = ['scroll up', 'call down', 'call don', 'scroll down', 'up', 'down', 'exit', 'roll down', 'croll down', 'roll up', 'croll up']
if len([i for i in l0 if i in command]) != 0:
break
else:
speak('Please , come again .')
command = take_command().lower()
print('in scroller function, while loop')
l = ['scroll down', 'down', 'roll down', 'croll down']
if len([i for i in l if i in command]) != 0:
print('voice gets recognized')
speak('Scrolling Down the pan')
while True:
driver.execute_script('window.scrollBy(0,500)', '')
time.sleep(0)
q = take_command().lower()
if 'stop' in q or 'exit' in q or 'top' in q:
speak('Exiting the scroll down')
break
l2 = ['scroll up', 'croll up', 'up', 'roll up', 'call app']
if len([i for i in l2 if i in command]) != 0:
speak('Scrolling up the pan')
while True:
driver.execute_script('scrollBy(0,-2000);')
time.sleep(0)
q = take_command().lower()
if 'stop' in q or 'exit' in q or 'top' in q:
speak('Exiting the scroll up')
break
command = take_command().lower()
if 'exit' in command:
speak('exiting from scroller')
break |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def _is_tensor(x):
return hasattr(x, "__len__")
| def _is_tensor(x):
return hasattr(x, '__len__') |
# initial based on FreeCAD 0.17dev
#last edit: 2019-08
SourceFolder=[
("Base","Foundamental classes for FreeCAD",
"""import as FreeCAD in Python, see detailed description in later section"""),
("App","nonGUI code: Document, Property and DocumentObject",
"""import as FreeCAD in Python, see detailed description in later section"""),
("Gui","Qt-based GUI code: macro-recording, Workbench",
"""import as FreeCADGui in Python, see detailed description in later section"""),
("CXX","modified PyCXX containing both python 2 and python 3"),
("Ext","Source code for all modules with each module in one subfolder",
"""enable module import from FreeCAD to avoid python module name clashing"""),
("Main","main() function for FreeCADCmd.exe and FreeCADGui.exe",
""""Main() of FreeCADCmd.exe (build up CAD model without GUI but python scripting) and FreeCADGui.exe (Interactive mode)"""),
("Mod","Source code for all modules with each module in one subfolder",
"""Source code of ome modules will be explained in later section"""),
("Tools","Tool to build the source code: fcbt.py",
"""fcbt can generate a basic module from _TEMPLATE_ folder, """),
("Doc","Manual and documentation generated by doxygen"),
("CMakeLists.txt","topmost CMake config file, kind of high level cross-platform makefile generator",
"""
Module developer needs not to care about this file, CMakeLists.txt within module will be automatically included.
"""),
("FCConfig.h","preprocessor shared by all source for portability on diff platforms"),
("fc.sh","export environment variable for CASROOT -> OpenCASCADE",
"""
Module developer needs not to care about this file
"""),
("3rdParty","Third party code integration",
"""boost.CMakeLists.txt CxImage Pivy-0.5 zlib.CMakeLists.txt CMakeLists.txt Pivy salomesmesh"""),
("zipios++","source of zipios++ lib"),
("Build","set the version of FreeCAD"),
("MacAppBundle","config file to generate MacOSX bundle (installer)"),
("XDGData","FreeCAD.desktop file for linux package compliant Linux freedesktop standard"),
("WindowsInstaller","config files to generate windows installer"),
] | source_folder = [('Base', 'Foundamental classes for FreeCAD', 'import as FreeCAD in Python, see detailed description in later section'), ('App', 'nonGUI code: Document, Property and DocumentObject', 'import as FreeCAD in Python, see detailed description in later section'), ('Gui', 'Qt-based GUI code: macro-recording, Workbench', 'import as FreeCADGui in Python, see detailed description in later section'), ('CXX', 'modified PyCXX containing both python 2 and python 3'), ('Ext', 'Source code for all modules with each module in one subfolder', 'enable module import from FreeCAD to avoid python module name clashing'), ('Main', 'main() function for FreeCADCmd.exe and FreeCADGui.exe', '"Main() of FreeCADCmd.exe (build up CAD model without GUI but python scripting) and FreeCADGui.exe (Interactive mode)'), ('Mod', 'Source code for all modules with each module in one subfolder', 'Source code of ome modules will be explained in later section'), ('Tools', 'Tool to build the source code: fcbt.py', 'fcbt can generate a basic module from _TEMPLATE_ folder, '), ('Doc', 'Manual and documentation generated by doxygen'), ('CMakeLists.txt', 'topmost CMake config file, kind of high level cross-platform makefile generator', '\nModule developer needs not to care about this file, CMakeLists.txt within module will be automatically included.\n'), ('FCConfig.h', 'preprocessor shared by all source for portability on diff platforms'), ('fc.sh', 'export environment variable for CASROOT -> OpenCASCADE', '\nModule developer needs not to care about this file\n'), ('3rdParty', 'Third party code integration', 'boost.CMakeLists.txt CxImage Pivy-0.5 zlib.CMakeLists.txt CMakeLists.txt Pivy salomesmesh'), ('zipios++', 'source of zipios++ lib'), ('Build', 'set the version of FreeCAD'), ('MacAppBundle', 'config file to generate MacOSX bundle (installer)'), ('XDGData', 'FreeCAD.desktop file for linux package compliant Linux freedesktop standard'), ('WindowsInstaller', 'config files to generate windows installer')] |
"""
Manipulating lists
"""
# numlist = [1, 2, 3, 4, 5]
#
# print(numlist)
#
# numlist.reverse()
# print(numlist)
#
# numlist.sort()
# print(numlist)
#
# for num in numlist:
# print(str(num))
#
# mystring = 'julian'
# mystring_list = list(mystring)
# print(mystring_list)
#
# print(mystring_list[4])
# print(mystring_list.pop())
#
# print(mystring_list)
# mystring_list.insert(5, 'n')
#
# print(mystring_list)
# mystring_list[0] = 'b'
# print(mystring_list)
#
# del mystring_list[0]
# print(mystring_list)
#
# mystring_list.insert(0, 'm')
# print(mystring_list)
#
# print(mystring_list.pop(0))
# print(mystring_list)
#
# mystring_list.append('s')
# print(mystring_list)
#
# del mystring_list[0]
# print(mystring_list)
"""
Immutability(cannot be changed) and Tuples -- cannot be edited since are immutable
"""
# mystring = 'julian'
#
# l = list(mystring)
# t = tuple(mystring)
#
# print(l)
# print(t)
#
# l[0] = 't'
# print(l)
#
# ## t[0] = 't' --> will throw an exception since is immutable
#
# # but we can view or return elements from the tuple (t)
# for letter in t:
# print(letter)
"""
Dictionaries
-- no guarantee that the data will remain in order (they are unordered)
"""
# pybites = {'julian': 30, 'bob': 33, 'mike': 33}
# print(pybites)
#
# people = {}
# people['julian'] = 30
# people['bob'] = 103
# print(people)
#
# print(people.keys())
# print(people.values())
# print(people.items())
#
# for keys in people.keys():
# print(keys)
#
# for values in people.values():
# print(values)
# for keys, values in people.items():
# # print('%s is %d years of age' % (keys, values))
# print(f'{keys} is {values} years of age')
| """
Manipulating lists
"""
'\nImmutability(cannot be changed) and Tuples -- cannot be edited since are immutable\n'
'\nDictionaries\n-- no guarantee that the data will remain in order (they are unordered)\n' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.