content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
if not headA or not headB:
return None
# compute the length of each seq
lenA = lenB = 1
nodeA = headA
while nodeA.next:
nodeA = nodeA.next
lenA += 1
nodeB = headB
while nodeB.next:
nodeB = nodeB.next
lenB += 1
if lenA < lenB: # make sure seq A is longer or equal to seq B
headA, headB = headB, headA
lenA, lenB = lenB, lenA
for i in range(lenA - lenB): # move only the seqA part longer than seq B forward
headA = headA.next
while headA and headB and headA != headB: # find the intersection
headA = headA.next
headB = headB.next
return headA | class Solution:
def get_intersection_node(self, headA: ListNode, headB: ListNode) -> ListNode:
if not headA or not headB:
return None
len_a = len_b = 1
node_a = headA
while nodeA.next:
node_a = nodeA.next
len_a += 1
node_b = headB
while nodeB.next:
node_b = nodeB.next
len_b += 1
if lenA < lenB:
(head_a, head_b) = (headB, headA)
(len_a, len_b) = (lenB, lenA)
for i in range(lenA - lenB):
head_a = headA.next
while headA and headB and (headA != headB):
head_a = headA.next
head_b = headB.next
return headA |
# Autogenerated file for HID Mouse
# Add missing from ... import const
_JD_SERVICE_CLASS_HID_MOUSE = const(0x1885dc1c)
_JD_HID_MOUSE_BUTTON_LEFT = const(0x1)
_JD_HID_MOUSE_BUTTON_RIGHT = const(0x2)
_JD_HID_MOUSE_BUTTON_MIDDLE = const(0x4)
_JD_HID_MOUSE_BUTTON_EVENT_UP = const(0x1)
_JD_HID_MOUSE_BUTTON_EVENT_DOWN = const(0x2)
_JD_HID_MOUSE_BUTTON_EVENT_CLICK = const(0x3)
_JD_HID_MOUSE_BUTTON_EVENT_DOUBLE_CLICK = const(0x4)
_JD_HID_MOUSE_CMD_SET_BUTTON = const(0x80)
_JD_HID_MOUSE_CMD_MOVE = const(0x81)
_JD_HID_MOUSE_CMD_WHEEL = const(0x82) | _jd_service_class_hid_mouse = const(411425820)
_jd_hid_mouse_button_left = const(1)
_jd_hid_mouse_button_right = const(2)
_jd_hid_mouse_button_middle = const(4)
_jd_hid_mouse_button_event_up = const(1)
_jd_hid_mouse_button_event_down = const(2)
_jd_hid_mouse_button_event_click = const(3)
_jd_hid_mouse_button_event_double_click = const(4)
_jd_hid_mouse_cmd_set_button = const(128)
_jd_hid_mouse_cmd_move = const(129)
_jd_hid_mouse_cmd_wheel = const(130) |
def is_substitution_cipher(s1, s2):
dict1={}
dict2={}
for i,j in zip(s1, s2):
dict1[i]=dict1.get(i, 0)+1
dict2[j]=dict2.get(j, 0)+1
if len(dict1)!=len(dict2):
return False
return True | def is_substitution_cipher(s1, s2):
dict1 = {}
dict2 = {}
for (i, j) in zip(s1, s2):
dict1[i] = dict1.get(i, 0) + 1
dict2[j] = dict2.get(j, 0) + 1
if len(dict1) != len(dict2):
return False
return True |
# A program to rearrange array in alternating positive & negative items with O(1) extra space
class ArrayRearrange:
def __init__(self, arr, n):
self.arr = arr
self.n = n
def rearrange_array(self):
arr = self.arr.copy()
out_of_place = -1
for i in range(self.n):
if out_of_place == -1:
# conditions for A[i] to
# be in out of place
if (arr[i] >= 0 and i % 2 == 0) or (arr[i] < 0 and i % 2 == 1):
out_of_place = i
if out_of_place >= 0:
if (arr[i] >= 0 and arr[out_of_place] < 0) or (arr[i] < 0 and arr[out_of_place] >= 0):
arr = self.right_rotate(arr, out_of_place, i)
if i - out_of_place > 2:
out_of_place += 2
else:
out_of_place = -1
return arr
@staticmethod
def right_rotate(arr, out_of_place, cur):
temp = arr[cur]
for i in range(cur, out_of_place, -1):
arr[i] = arr[i - 1]
arr[out_of_place] = temp
return arr
# Driver Code
arr = [-5, -2, 5, 2, 4,7, 1, 8, 0, -8]
s= ArrayRearrange(arr, len(arr))
print(f"Rearranged array is: {s.rearrange_array()}") | class Arrayrearrange:
def __init__(self, arr, n):
self.arr = arr
self.n = n
def rearrange_array(self):
arr = self.arr.copy()
out_of_place = -1
for i in range(self.n):
if out_of_place == -1:
if arr[i] >= 0 and i % 2 == 0 or (arr[i] < 0 and i % 2 == 1):
out_of_place = i
if out_of_place >= 0:
if arr[i] >= 0 and arr[out_of_place] < 0 or (arr[i] < 0 and arr[out_of_place] >= 0):
arr = self.right_rotate(arr, out_of_place, i)
if i - out_of_place > 2:
out_of_place += 2
else:
out_of_place = -1
return arr
@staticmethod
def right_rotate(arr, out_of_place, cur):
temp = arr[cur]
for i in range(cur, out_of_place, -1):
arr[i] = arr[i - 1]
arr[out_of_place] = temp
return arr
arr = [-5, -2, 5, 2, 4, 7, 1, 8, 0, -8]
s = array_rearrange(arr, len(arr))
print(f'Rearranged array is: {s.rearrange_array()}') |
expected_output = {
'pid': 'WS-C4507R',
'os': 'ios',
'platform': 'cat4k',
'version': '12.2(18)EW5',
}
| expected_output = {'pid': 'WS-C4507R', 'os': 'ios', 'platform': 'cat4k', 'version': '12.2(18)EW5'} |
_MAJOR = 0
_MINOR = 6
_PATCH = 4
__version__ = str(_MAJOR) + '.' + str(_MINOR) + '.' + str(_PATCH)
def version():
'''
Returns a string representation of the version
'''
return __version__
def version_tuple():
'''
Returns a 3-tuple of ints that represent the version
'''
return (_MAJOR, _MINOR, _PATCH)
| _major = 0
_minor = 6
_patch = 4
__version__ = str(_MAJOR) + '.' + str(_MINOR) + '.' + str(_PATCH)
def version():
"""
Returns a string representation of the version
"""
return __version__
def version_tuple():
"""
Returns a 3-tuple of ints that represent the version
"""
return (_MAJOR, _MINOR, _PATCH) |
#!/usr/bin/env python3
# https://www.hackerrank.com/challenges/python-lists/
if __name__ == '__main__':
N = int(input())
lst = []
for i in range(N):
cmd = input().rstrip().split()
if(cmd[0] == 'insert'):
lst.insert(int(cmd[1]), int(cmd[2]))
elif(cmd[0] == 'print'):
print(lst)
elif(cmd[0] == 'remove'):
lst.remove(int(cmd[1]))
elif(cmd[0] == 'append'):
lst.append(int(cmd[1]))
elif(cmd[0] == 'sort'):
lst.sort()
elif(cmd[0] == 'pop'):
lst.pop()
elif(cmd[0] == 'reverse'):
lst.reverse()
| if __name__ == '__main__':
n = int(input())
lst = []
for i in range(N):
cmd = input().rstrip().split()
if cmd[0] == 'insert':
lst.insert(int(cmd[1]), int(cmd[2]))
elif cmd[0] == 'print':
print(lst)
elif cmd[0] == 'remove':
lst.remove(int(cmd[1]))
elif cmd[0] == 'append':
lst.append(int(cmd[1]))
elif cmd[0] == 'sort':
lst.sort()
elif cmd[0] == 'pop':
lst.pop()
elif cmd[0] == 'reverse':
lst.reverse() |
class Solution:
def minSwap(self, A: List[int], B: List[int]) -> int:
n1, s1 = 0, 1
for i in range(1, len(A)):
n2 = s2 = float("inf")
if A[i - 1] < A[i] and B[i - 1] < B[i]:
n2 = min(n2, n1)
s2 = min(s2, s1 + 1)
if A[i - 1] < B[i] and B[i - 1] < A[i]:
n2 = min(n2, s1)
s2 = min(s2, n1 + 1)
n1, s1 = n2, s2
print(n1, s2)
return min(n1, s1)
| class Solution:
def min_swap(self, A: List[int], B: List[int]) -> int:
(n1, s1) = (0, 1)
for i in range(1, len(A)):
n2 = s2 = float('inf')
if A[i - 1] < A[i] and B[i - 1] < B[i]:
n2 = min(n2, n1)
s2 = min(s2, s1 + 1)
if A[i - 1] < B[i] and B[i - 1] < A[i]:
n2 = min(n2, s1)
s2 = min(s2, n1 + 1)
(n1, s1) = (n2, s2)
print(n1, s2)
return min(n1, s1) |
__author__ = 'xelhark'
class ErrorWithList(ValueError):
def __init__(self, message, errors_list=None):
self.errors_list = errors_list
super(ErrorWithList, self).__init__(message)
class ModelValidationError(ErrorWithList):
pass
class InstanceValidationError(ErrorWithList):
pass
| __author__ = 'xelhark'
class Errorwithlist(ValueError):
def __init__(self, message, errors_list=None):
self.errors_list = errors_list
super(ErrorWithList, self).__init__(message)
class Modelvalidationerror(ErrorWithList):
pass
class Instancevalidationerror(ErrorWithList):
pass |
config = {
"username": "",
"password": "",
"phonename": "iPhone",
"sms_csv": ""
} | config = {'username': '', 'password': '', 'phonename': 'iPhone', 'sms_csv': ''} |
#This program takes in a postive integer and applies a calculation to it.
# It then outputs a sequence that ends in 1
#creates a list called L
mylist=[]
#take the input for the user
value = int(input("Please enter a positive integer: "))
# Adds the input to the list.
# The append wouldnt work unless I made i an int value when tring to append
mylist.append(int(value))
#starts a while loop that will stop when i reaches 1
# The next value is gotten by taking the current value and
# if it is even, divide it by two, but if it is odd, multiply it by three and add one.
# The program ends if the current value is one., if the user enters 1 then the loop wont run
while value != 1:
if value % 2 == 0:
value /= 2
mylist.append(int(value))
else:
value = (value*3)+1
mylist.append(int(value))
print(mylist)
#based on andrew's feedback I tried to make my variable names more meaning full | mylist = []
value = int(input('Please enter a positive integer: '))
mylist.append(int(value))
while value != 1:
if value % 2 == 0:
value /= 2
mylist.append(int(value))
else:
value = value * 3 + 1
mylist.append(int(value))
print(mylist) |
class Aritmatika:
@staticmethod
def tambah(a, b):
return a + b
@staticmethod
def kurang(a, b):
return a - b
@staticmethod
def bagi(a, b):
return a / b
@staticmethod
def bagi_int(a, b):
return a // b
@staticmethod
def pangkat(a, b):
return a ** b
# Langsung call class dan method
print(Aritmatika.tambah(5, 5))
# Bikin object dlu
objekA = Aritmatika()
print(objekA.pangkat(2, 3)) | class Aritmatika:
@staticmethod
def tambah(a, b):
return a + b
@staticmethod
def kurang(a, b):
return a - b
@staticmethod
def bagi(a, b):
return a / b
@staticmethod
def bagi_int(a, b):
return a // b
@staticmethod
def pangkat(a, b):
return a ** b
print(Aritmatika.tambah(5, 5))
objek_a = aritmatika()
print(objekA.pangkat(2, 3)) |
def calculate_similarity(my, theirs, tags):
similarity = {}
for group in ('personal', 'hobbies'):
all_names = {tag.code for tag in tags if tag.group == group}
my_names = all_names & my
their_names = all_names & theirs
both = my_names | their_names
same = my_names & their_names
similarity[group] = len(same) * 100 / len(both) if both else 0
return similarity
def is_role_manageable_by_user(role, user):
if role in (user.ROLE_GOD, user.ROLE_MODERATOR):
return user.is_god
if role == user.ROLE_CURATOR:
return user.is_moderator
return False
| def calculate_similarity(my, theirs, tags):
similarity = {}
for group in ('personal', 'hobbies'):
all_names = {tag.code for tag in tags if tag.group == group}
my_names = all_names & my
their_names = all_names & theirs
both = my_names | their_names
same = my_names & their_names
similarity[group] = len(same) * 100 / len(both) if both else 0
return similarity
def is_role_manageable_by_user(role, user):
if role in (user.ROLE_GOD, user.ROLE_MODERATOR):
return user.is_god
if role == user.ROLE_CURATOR:
return user.is_moderator
return False |
# Method 1: using index find the max first, and then process
def validMountainArray(self, A):
if len(A) < 3: return False
index = A.index(max(A))
if index == 0 or index == len(A) -1: return False
for i in range(1, len(A)):
if i <= index:
if A[i] <= A[i - 1]: return False
else:
if A[i] >= A[i - 1]: return False
return True
# Method 2: one pass, using two pointers trace from the begining and end
def validMountainArray(self, A):
i, j = 0, len(A) - 1
while i < len(A) - 1 and A[i] < A[i + 1]: i += 1
while j > 0 and A[j - 1] > A[j]: j -= 1
return 0 < i == j < len(A) - 1 | def valid_mountain_array(self, A):
if len(A) < 3:
return False
index = A.index(max(A))
if index == 0 or index == len(A) - 1:
return False
for i in range(1, len(A)):
if i <= index:
if A[i] <= A[i - 1]:
return False
elif A[i] >= A[i - 1]:
return False
return True
def valid_mountain_array(self, A):
(i, j) = (0, len(A) - 1)
while i < len(A) - 1 and A[i] < A[i + 1]:
i += 1
while j > 0 and A[j - 1] > A[j]:
j -= 1
return 0 < i == j < len(A) - 1 |
# 69. Sqrt(x) Easy
# Implement int sqrt(int x).
#
# Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
#
# Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
#
# Example 1:
#
# Input: 4
# Output: 2
# Example 2:
#
# Input: 8
# Output: 2
# Explanation: The square root of 8 is 2.82842..., and since
# the decimal part is truncated, 2 is returned.
def mySqrt(self, x: int) -> int:
'''
Runtime: 56 ms, faster than 54.11% of Python3 online submissions for Sqrt(x).
Memory Usage: 13.1 MB, less than 79.16% of Python3 online submissions for Sqrt(x).
'''
# 2^2 = 4
# 2.82842^2 = 8
# x > 1, range(1, x)
# x < 1, range(0, 1)
if x == 1 or x == 0:
return x
max_range = max(1, x)
min_range = 0
result = 0
while (max_range - min_range != 0):
mid = min_range + (max_range - min_range) // 2
result = mid * mid
print(result)
if int(result) <= x < (mid + 1) * (mid + 1):
return int(mid)
if result < x:
min_range = mid
else:
max_range = mid
| def my_sqrt(self, x: int) -> int:
"""
Runtime: 56 ms, faster than 54.11% of Python3 online submissions for Sqrt(x).
Memory Usage: 13.1 MB, less than 79.16% of Python3 online submissions for Sqrt(x).
"""
if x == 1 or x == 0:
return x
max_range = max(1, x)
min_range = 0
result = 0
while max_range - min_range != 0:
mid = min_range + (max_range - min_range) // 2
result = mid * mid
print(result)
if int(result) <= x < (mid + 1) * (mid + 1):
return int(mid)
if result < x:
min_range = mid
else:
max_range = mid |
class UncleEngineer:
'''
test = UncleEngineer()
test.art()
'''
def __init__(self):
self.name = 'Uncle Engineer'
def art(self):
asciiart = '''
Z
Z
.,., z
(((((()) z
((('_ _`) '
((G \ |)
(((` " ,
.((\.:~: .--------------.
__.| `"'.__ | \ |
.~~ `---' ~. | . :
/ ` | `-.__________)
| ~ | : :
| | : |
| _ | | [ ## :
\ ~~-. | , oo_______.'
`_ ( \) _____/~~~~ `--___
| ~`-) ) `-. `--- ( - a:f -
| '///` | `-.
| | | | `-.
| | | | `-.
| | |\ |
| | | \|
`-. | | |
`-| '
'''
print(asciiart)
def __str__(self):
return self.name
class UncleEngineer:
'''
test = BTT()
test.art()
'''
def __init__(self):
self.name = 'BTT'
def art(self):
asciiart = '''
;::::;
;::::; :;
;:::::' :;
;:::::; ;.
,:::::' ; OOO\
::::::; ; OOOOO\
;:::::; ; OOOOOOOO
,;::::::; ;' / OOOOOOO
;:::::::::`. ,,,;. / / DOOOOOO
.';:::::::::::::::::;, / / DOOOO
,::::::;::::::;;;;::::;, / / DOOO
;`::::::`'::::::;;;::::: ,#/ / DOOO
:`:::::::`;::::::;;::: ;::# / DOOO
::`:::::::`;:::::::: ;::::# / DOO
`:`:::::::`;:::::: ;::::::#/ DOO
:::`:::::::`;; ;:::::::::## OO
::::`:::::::`;::::::::;:::# OO
`:::::`::::::::::::;'`:;::# O
`:::::`::::::::;' / / `:#
::::::`:::::;' / / `#
'''
print(asciiart)
def __str__(self):
return self.name
| class Uncleengineer:
"""
test = UncleEngineer()
test.art()
"""
def __init__(self):
self.name = 'Uncle Engineer'
def art(self):
asciiart = '\n Z \n Z \n .,., z \n (((((()) z \n (((\'_ _`) \' \n ((G \\ |) \n (((` " , \n .((\\.:~: .--------------. \n __.| `"\'.__ | \\ | \n .~~ `---\' ~. | . : \n / ` | `-.__________) \n| ~ | : : \n| | : | \n| _ | | [ ## : \n \\ ~~-. | , oo_______.\' \n `_ ( \\) _____/~~~~ `--___ \n | ~`-) ) `-. `--- ( - a:f - \n | \'///` | `-. \n | | | | `-. \n | | | | `-. \n | | |\\ | \n | | | \\| \n `-. | | | \n `-| \'\n '
print(asciiart)
def __str__(self):
return self.name
class Uncleengineer:
"""
test = BTT()
test.art()
"""
def __init__(self):
self.name = 'BTT'
def art(self):
asciiart = "\n\n ;::::; \n ;::::; :; \n ;:::::' :; \n ;:::::; ;. \n ,:::::' ; OOO\\ \n ::::::; ; OOOOO\\ \n ;:::::; ; OOOOOOOO \n ,;::::::; ;' / OOOOOOO \n ;:::::::::`. ,,,;. / / DOOOOOO \n .';:::::::::::::::::;, / / DOOOO \n ,::::::;::::::;;;;::::;, / / DOOO \n;`::::::`'::::::;;;::::: ,#/ / DOOO \n:`:::::::`;::::::;;::: ;::# / DOOO\n::`:::::::`;:::::::: ;::::# / DOO\n`:`:::::::`;:::::: ;::::::#/ DOO\n :::`:::::::`;; ;:::::::::## OO\n ::::`:::::::`;::::::::;:::# OO\n `:::::`::::::::::::;'`:;::# O \n `:::::`::::::::;' / / `:# \n ::::::`:::::;' / / `# \n\n "
print(asciiart)
def __str__(self):
return self.name |
class Vscode():
def execute(self):
print("code is compiling and code is running")
class Pycharm():
def execute(self):
print("code is compiling and code is running")
class python():
def execute(self):
print("python is using")
class CPP():
def execute(self):
print("C++ is using")
class Laptop():
def code(self,ide,lang):
ide.execute(self)
lang.execute(self)
lap1=Laptop()
lap1.code(Vscode,python)
lap1.code(Pycharm,CPP)
| class Vscode:
def execute(self):
print('code is compiling and code is running')
class Pycharm:
def execute(self):
print('code is compiling and code is running')
class Python:
def execute(self):
print('python is using')
class Cpp:
def execute(self):
print('C++ is using')
class Laptop:
def code(self, ide, lang):
ide.execute(self)
lang.execute(self)
lap1 = laptop()
lap1.code(Vscode, python)
lap1.code(Pycharm, CPP) |
nums = [2, 3, 4, 5, 7, 10, 12]
for n in nums:
print(n, end=", ")
class CartItem:
def __init__(self, name, price) -> None:
self.price = price
self.name = name
def __repr__(self) -> str:
return "({0}, ${1})".format(self.name, self.price)
class ShoppingCart:
def __init__(self) -> None:
self.items = []
def add(self, cart_item):
self.items.append(cart_item)
def __iter__(self):
return self.items.__iter__()
@property
def total_price(self):
total = 0.0
for item in self.items:
total += item.price
return total
print()
print()
cart = ShoppingCart()
cart.add(CartItem("CD", 9.99))
cart.add(CartItem("Vinyle", 14.99))
for c in cart:
print(c)
print("Total is ${0:,}".format(cart.total_price))
| nums = [2, 3, 4, 5, 7, 10, 12]
for n in nums:
print(n, end=', ')
class Cartitem:
def __init__(self, name, price) -> None:
self.price = price
self.name = name
def __repr__(self) -> str:
return '({0}, ${1})'.format(self.name, self.price)
class Shoppingcart:
def __init__(self) -> None:
self.items = []
def add(self, cart_item):
self.items.append(cart_item)
def __iter__(self):
return self.items.__iter__()
@property
def total_price(self):
total = 0.0
for item in self.items:
total += item.price
return total
print()
print()
cart = shopping_cart()
cart.add(cart_item('CD', 9.99))
cart.add(cart_item('Vinyle', 14.99))
for c in cart:
print(c)
print('Total is ${0:,}'.format(cart.total_price)) |
highest_seat_id = 0
with open("input.txt", "r") as f:
lines = [line.rstrip() for line in f.readlines()]
for line in lines:
rows = [0, 127]
row = None
columns = [0, 7]
column = None
for command in list(line):
if command == "F":
rows = [rows[0], ((rows[1] - rows[0]) // 2) + rows[0]]
elif command == "B":
rows = [((rows[1] - rows[0]) // 2) + rows[0] + 1, rows[1]]
elif command == "L":
columns = [columns[0], ((columns[1] - columns[0]) // 2) + columns[0]]
elif command == "R":
columns = [((columns[1] - columns[0]) // 2) + columns[0] + 1, columns[1]]
if rows[0] == rows[1]:
row = rows[0]
if columns[0] == columns[1]:
column = columns[0]
seat_id = row * 8 + column
if seat_id > highest_seat_id:
highest_seat_id = seat_id
#print(f"line: {line}, row: {row}, column: {column}, seat ID: {seat_id}")
print(f"\nWhat is the highest seat ID on a boarding pass? {highest_seat_id}")
| highest_seat_id = 0
with open('input.txt', 'r') as f:
lines = [line.rstrip() for line in f.readlines()]
for line in lines:
rows = [0, 127]
row = None
columns = [0, 7]
column = None
for command in list(line):
if command == 'F':
rows = [rows[0], (rows[1] - rows[0]) // 2 + rows[0]]
elif command == 'B':
rows = [(rows[1] - rows[0]) // 2 + rows[0] + 1, rows[1]]
elif command == 'L':
columns = [columns[0], (columns[1] - columns[0]) // 2 + columns[0]]
elif command == 'R':
columns = [(columns[1] - columns[0]) // 2 + columns[0] + 1, columns[1]]
if rows[0] == rows[1]:
row = rows[0]
if columns[0] == columns[1]:
column = columns[0]
seat_id = row * 8 + column
if seat_id > highest_seat_id:
highest_seat_id = seat_id
print(f'\nWhat is the highest seat ID on a boarding pass? {highest_seat_id}') |
class Vertex:
def __init__(self, label: str = None, weight: int = float("inf"), key: int = None):
self.label: str = label
self.weight: int = weight
self.key: int = key
| class Vertex:
def __init__(self, label: str=None, weight: int=float('inf'), key: int=None):
self.label: str = label
self.weight: int = weight
self.key: int = key |
class Solution:
def dfs(self, s:str, n:int, pos:int, sub_res:list, total_res:list, left:int):
if left == 0 and pos >= n:
total_res.append(sub_res[:])
return
if left == 0 and pos < n:
return
if pos < n and s[pos] == '0':
sub_res.append(s[pos])
self.dfs(s,n,pos + 1, sub_res,total_res, left - 1)
sub_res.pop()
return
for delt in range(3, 0, -1):
if delt + pos > n:
continue
target = int(s[pos:delt + pos])
if target > 255:
continue
sub_res.append(s[pos:delt + pos])
self.dfs(s, n, pos + delt, sub_res, total_res, left - 1)
sub_res.pop()
def restoreIpAddresses(self, s: str):
n = len(s)
if n < 4:
return []
if n == 4:
return [".".join(s)]
res = []
self.dfs(s, n, 0, [], res, 4)
return [".".join(x) for x in res]
# sl = Solution()
# t1 = "25525511135"
# res = sl.restoreIpAddresses(t1)
# print(res)
sl = Solution()
t1 = "010010"
res = sl.restoreIpAddresses(t1)
print(res)
| class Solution:
def dfs(self, s: str, n: int, pos: int, sub_res: list, total_res: list, left: int):
if left == 0 and pos >= n:
total_res.append(sub_res[:])
return
if left == 0 and pos < n:
return
if pos < n and s[pos] == '0':
sub_res.append(s[pos])
self.dfs(s, n, pos + 1, sub_res, total_res, left - 1)
sub_res.pop()
return
for delt in range(3, 0, -1):
if delt + pos > n:
continue
target = int(s[pos:delt + pos])
if target > 255:
continue
sub_res.append(s[pos:delt + pos])
self.dfs(s, n, pos + delt, sub_res, total_res, left - 1)
sub_res.pop()
def restore_ip_addresses(self, s: str):
n = len(s)
if n < 4:
return []
if n == 4:
return ['.'.join(s)]
res = []
self.dfs(s, n, 0, [], res, 4)
return ['.'.join(x) for x in res]
sl = solution()
t1 = '010010'
res = sl.restoreIpAddresses(t1)
print(res) |
collection = ["gold", "silver", "bronze"]
# list comprehension
new_list = [item.upper for item in collection]
# generator expression
# it is similar to list comprehension, but use () round brackets
my_gen = (item.upper for item in collection) | collection = ['gold', 'silver', 'bronze']
new_list = [item.upper for item in collection]
my_gen = (item.upper for item in collection) |
# This is where all of our model classes are defined
class PhysicalAttributes:
def __init__(self, width=None, height=None, depth=None, dimensions=None, mass=None):
self.width = width
self.height = height
self.depth = depth
self.dimensions = dimensions
self.mass = mass
def serialize(self):
return {
'width': self.width,
'height': self.height,
'depth': self.depth,
'dimensions': self.dimensions,
'mass': self.mass
}
def __repr__(self):
return repr(self.serialize())
class Hardware:
def __init__(self, cpu=None, gpu=None, ram=None, nonvolatile_memory=None):
self.cpu = cpu
self.gpu = gpu
self.ram = ram
self.nonvolatile_memory = nonvolatile_memory
def serialize(self):
return {
'cpu': self.cpu.serialize() if self.cpu is not None else None,
'gpu': self.gpu.serialize() if self.gpu is not None else None,
'ram': self.ram.serialize() if self.ram is not None else None,
'nonvolatile_memory': self.nonvolatile_memory.serialize() if self.nonvolatile_memory is not None else None
}
def __repr__(self):
return repr(self.serialize())
class Cpu:
def __init__(self, model=None, additional_info=None, clock_speed=None):
self.model = model
self.clock_speed = clock_speed
self.additional_info = additional_info \
if not additional_info or not isinstance(additional_info, str) \
else [additional_info]
def serialize(self):
return {
'model': self.model,
'additional_info': self.additional_info,
'clock_speed': self.clock_speed
}
def __repr__(self):
return repr(self.serialize())
class Gpu:
def __init__(self, model=None, clock_speed=None):
self.model = model
self.clock_speed = clock_speed
def serialize(self):
return {
'model': self.model,
'clock_speed': self.clock_speed
}
def __repr__(self):
return repr(self.serialize())
class Ram:
def __init__(self, type_m=None, capacity=None):
self.type_m = type_m
self.capacity = capacity
def serialize(self):
return {
'type': self.type_m,
'capacity': self.capacity
}
def __repr__(self):
return repr(self.serialize())
class NonvolatileMemory:
def __init__(self, type_m=None, capacity=None):
self.type_m = type_m
self.capacity = capacity
def serialize(self):
return {
'type': self.type_m,
'capacity': self.capacity
}
def __repr__(self):
return repr(self.serialize())
class Display:
def __init__(self, resolution=None, diagonal=None, width=None, height=None, bezel_width=None,
area_utilization=None, pixel_density=None, type_m=None, color_depth=None, screen=None):
self.resolution = resolution
self.diagonal = diagonal
self.width = width
self.height = height
self.bezel_width = bezel_width
self.area_utilization = area_utilization
self.pixel_density = pixel_density
self.type_m = type_m
self.color_depth = color_depth
self.screen = screen
def serialize(self):
return {
'resolution': self.resolution,
'diagonal': self.diagonal,
'width': self.width,
'height': self.height,
'bezel_width': self.bezel_width,
'area_utilization': self.area_utilization,
'pixel_density': self.pixel_density,
'type': self.type_m,
'color_depth': self.color_depth,
'screen': self.screen
}
def __repr__(self):
return repr(self.serialize())
class Camera:
def __init__(self, placement=None, module=None, sensor=None, sensor_format=None, resolution=None,
num_pixels=None, aperture=None, optical_zoom=None, digital_zoom=None, focus=None,
camcorder=None, flash=None):
self.placement = placement
self.module = module
self.sensor = sensor
self.sensor_format = sensor_format
self.resolution = resolution
self.num_pixels = num_pixels
self.aperture = aperture
self.optical_zoom = optical_zoom
self.digital_zoom = digital_zoom
self.focus = focus
self.camcorder = camcorder
self.flash = flash
def serialize(self):
return {
'placement': self.placement,
'module': self.module,
'sensor': self.sensor,
'sensor_format': self.sensor_format,
'resolution': self.resolution,
'num_pixels': self.num_pixels,
'aperture': self.aperture,
'optical_zoom': self.optical_zoom,
'digital_zoom': self.digital_zoom,
'focus': self.focus,
'camcorder': self.camcorder.serialize() if self.camcorder is not None else None,
'flash': self.flash
}
def __repr__(self):
return repr(self.serialize())
class Camcorder:
def __init__(self, resolution=None, formats=None):
self.resolution = resolution
self.formats = formats
def serialize(self):
return {
'resolution': self.resolution,
'formats': self.formats
}
def __repr__(self):
return repr(self.serialize())
class Software:
def __init__(self, platform=None, os=None, software_extras=None):
self.platform = platform
self.os = os
self.software_extras = software_extras \
if not software_extras or not isinstance(software_extras, str) \
else [software_extras]
def serialize(self):
return {
'platform': self.platform,
'os': self.os,
'software_extras': self.software_extras
}
def __repr__(self):
return repr(self.serialize())
class Model:
def __init__(self, image=None, name=None, brand=None, model=None, release_date=None,
hardware_designer=None, manufacturers=None, codename=None, market_countries=None,
market_regions=None, carriers=None, physical_attributes=None,
hardware=None, software=None, display=None, cameras=None):
# singular attributes
self.image = image
self.name = name
self.brand = brand
self.model = model
self.release_date = release_date
self.hardware_designer = hardware_designer
self.codename = codename
# list attributes (convert to list if it's neither str nor None)
self.manufacturers = manufacturers \
if not manufacturers or not isinstance(manufacturers, str) else [manufacturers]
self.market_countries = market_countries \
if not market_countries or not isinstance(market_countries, str) else [market_countries]
self.market_regions = market_regions \
if not market_regions or not isinstance(market_regions, str) else [market_regions]
self.carriers = carriers \
if not carriers or not isinstance(carriers, str) else [carriers]
# classed attributes
self.physical_attributes = physical_attributes
self.hardware = hardware
self.software = software
self.display = display
self.cameras = cameras
def serialize(self):
return {
'image': self.image,
'name': self.name,
'brand': self.brand,
'model': self.model,
'release_date': self.release_date,
'hardware_designer': self.hardware_designer,
'manufacturers': self.manufacturers,
'codename': self.codename,
'market_countries': self.market_countries,
'market_regions': self.market_regions,
'carriers': self.carriers,
'physical_attributes': self.physical_attributes.serialize() if self.physical_attributes is not None else None,
'software': self.software.serialize() if self.software is not None else None,
'hardware': self.hardware.serialize() if self.hardware is not None else None,
'display': self.display.serialize() if self.display is not None else None,
'cameras': [camera.serialize() for camera in self.cameras]
}
def __repr__(self):
return repr(self.serialize())
class Brand:
def __init__(self, image=None, name=None, type_m=None, industries=None, found_date=None, location=None,
area_served=None, phone_models=None, carriers=None, os=None, founders=None,
parent=None):
self.image = image
self.name = name
self.type_m = type_m
self.found_date = found_date
self.location = location
self.area_served = area_served
self.parent = parent
self.industries = industries \
if not industries or not isinstance(industries, str) else [industries]
self.phone_models = phone_models \
if not phone_models or not isinstance(phone_models, str) else [phone_models]
self.carriers = carriers \
if not carriers or not isinstance(carriers, str) else [carriers]
self.os = os \
if not os or not isinstance(os, str) else [os]
self.founders = founders \
if not founders or not isinstance(founders, str) else [founders]
def serialize(self):
return {
'image': self.image,
'name': self.name,
'type': self.type_m,
'industries': self.industries,
'found_date': self.found_date,
'location': self.location,
'area_served': self.area_served,
'phone_models': self.phone_models,
'carriers': self.carriers,
'os': self.os,
'founders': self.founders,
'parent': self.parent
}
def __repr__(self):
return repr(self.serialize())
class OS:
def __init__(self, image=None, name=None, developer=None, release_date=None, version=None,
os_kernel=None, os_family=None, supported_cpu_instruction_sets=None,
predecessor=None, brands=None, models=None, codename=None,
successor=None):
self.image = image
self.name = name
self.developer = developer
self.release_date = release_date
self.version = version
self.os_kernel = os_kernel
self.os_family = os_family
self.supported_cpu_instruction_sets = supported_cpu_instruction_sets \
if not supported_cpu_instruction_sets or not isinstance(supported_cpu_instruction_sets, str) \
else [supported_cpu_instruction_sets]
self.predecessor = predecessor
self.brands = brands \
if not brands or not isinstance(brands, str) else [brands]
self.models = models \
if not models or not isinstance(models, str) else [models]
self.codename = codename
self.successor = successor
def serialize(self):
return {
'image': self.image,
'name': self.name,
'developer': self.developer,
'release_date': self.release_date,
'version': self.version,
'os_kernel': self.os_kernel,
'os_family': self.os_family,
'supported_cpu_instruction_sets': self.supported_cpu_instruction_sets,
'predecessor': self.predecessor,
'brands': self.brands,
'models': self.models,
'codename': self.codename,
'successor': self.successor
}
def __repr__(self):
return repr(self.serialize())
class Carrier:
def __init__(self, image=None, name=None, short_name=None, cellular_networks=None,
covered_countries=None, brands=None, models=None):
self.image = image
self.name = name
self.short_name = short_name
self.cellular_networks = cellular_networks \
if not cellular_networks or not isinstance(cellular_networks, str) else [cellular_networks]
self.covered_countries = covered_countries \
if not covered_countries or not isinstance(covered_countries, str) else [covered_countries]
self.brands = brands \
if not brands or not isinstance(brands, str) else [brands]
self.models = models \
if not models or not isinstance(models, str) else [models]
def serialize(self):
return {
'image': self.image,
'name': self.name,
'short_name': self.short_name,
'cellular_networks': self.cellular_networks,
'covered_countries': self.covered_countries,
'brands': self.brands,
'models': self.models
}
def __repr__(self):
return repr(self.serialize())
| class Physicalattributes:
def __init__(self, width=None, height=None, depth=None, dimensions=None, mass=None):
self.width = width
self.height = height
self.depth = depth
self.dimensions = dimensions
self.mass = mass
def serialize(self):
return {'width': self.width, 'height': self.height, 'depth': self.depth, 'dimensions': self.dimensions, 'mass': self.mass}
def __repr__(self):
return repr(self.serialize())
class Hardware:
def __init__(self, cpu=None, gpu=None, ram=None, nonvolatile_memory=None):
self.cpu = cpu
self.gpu = gpu
self.ram = ram
self.nonvolatile_memory = nonvolatile_memory
def serialize(self):
return {'cpu': self.cpu.serialize() if self.cpu is not None else None, 'gpu': self.gpu.serialize() if self.gpu is not None else None, 'ram': self.ram.serialize() if self.ram is not None else None, 'nonvolatile_memory': self.nonvolatile_memory.serialize() if self.nonvolatile_memory is not None else None}
def __repr__(self):
return repr(self.serialize())
class Cpu:
def __init__(self, model=None, additional_info=None, clock_speed=None):
self.model = model
self.clock_speed = clock_speed
self.additional_info = additional_info if not additional_info or not isinstance(additional_info, str) else [additional_info]
def serialize(self):
return {'model': self.model, 'additional_info': self.additional_info, 'clock_speed': self.clock_speed}
def __repr__(self):
return repr(self.serialize())
class Gpu:
def __init__(self, model=None, clock_speed=None):
self.model = model
self.clock_speed = clock_speed
def serialize(self):
return {'model': self.model, 'clock_speed': self.clock_speed}
def __repr__(self):
return repr(self.serialize())
class Ram:
def __init__(self, type_m=None, capacity=None):
self.type_m = type_m
self.capacity = capacity
def serialize(self):
return {'type': self.type_m, 'capacity': self.capacity}
def __repr__(self):
return repr(self.serialize())
class Nonvolatilememory:
def __init__(self, type_m=None, capacity=None):
self.type_m = type_m
self.capacity = capacity
def serialize(self):
return {'type': self.type_m, 'capacity': self.capacity}
def __repr__(self):
return repr(self.serialize())
class Display:
def __init__(self, resolution=None, diagonal=None, width=None, height=None, bezel_width=None, area_utilization=None, pixel_density=None, type_m=None, color_depth=None, screen=None):
self.resolution = resolution
self.diagonal = diagonal
self.width = width
self.height = height
self.bezel_width = bezel_width
self.area_utilization = area_utilization
self.pixel_density = pixel_density
self.type_m = type_m
self.color_depth = color_depth
self.screen = screen
def serialize(self):
return {'resolution': self.resolution, 'diagonal': self.diagonal, 'width': self.width, 'height': self.height, 'bezel_width': self.bezel_width, 'area_utilization': self.area_utilization, 'pixel_density': self.pixel_density, 'type': self.type_m, 'color_depth': self.color_depth, 'screen': self.screen}
def __repr__(self):
return repr(self.serialize())
class Camera:
def __init__(self, placement=None, module=None, sensor=None, sensor_format=None, resolution=None, num_pixels=None, aperture=None, optical_zoom=None, digital_zoom=None, focus=None, camcorder=None, flash=None):
self.placement = placement
self.module = module
self.sensor = sensor
self.sensor_format = sensor_format
self.resolution = resolution
self.num_pixels = num_pixels
self.aperture = aperture
self.optical_zoom = optical_zoom
self.digital_zoom = digital_zoom
self.focus = focus
self.camcorder = camcorder
self.flash = flash
def serialize(self):
return {'placement': self.placement, 'module': self.module, 'sensor': self.sensor, 'sensor_format': self.sensor_format, 'resolution': self.resolution, 'num_pixels': self.num_pixels, 'aperture': self.aperture, 'optical_zoom': self.optical_zoom, 'digital_zoom': self.digital_zoom, 'focus': self.focus, 'camcorder': self.camcorder.serialize() if self.camcorder is not None else None, 'flash': self.flash}
def __repr__(self):
return repr(self.serialize())
class Camcorder:
def __init__(self, resolution=None, formats=None):
self.resolution = resolution
self.formats = formats
def serialize(self):
return {'resolution': self.resolution, 'formats': self.formats}
def __repr__(self):
return repr(self.serialize())
class Software:
def __init__(self, platform=None, os=None, software_extras=None):
self.platform = platform
self.os = os
self.software_extras = software_extras if not software_extras or not isinstance(software_extras, str) else [software_extras]
def serialize(self):
return {'platform': self.platform, 'os': self.os, 'software_extras': self.software_extras}
def __repr__(self):
return repr(self.serialize())
class Model:
def __init__(self, image=None, name=None, brand=None, model=None, release_date=None, hardware_designer=None, manufacturers=None, codename=None, market_countries=None, market_regions=None, carriers=None, physical_attributes=None, hardware=None, software=None, display=None, cameras=None):
self.image = image
self.name = name
self.brand = brand
self.model = model
self.release_date = release_date
self.hardware_designer = hardware_designer
self.codename = codename
self.manufacturers = manufacturers if not manufacturers or not isinstance(manufacturers, str) else [manufacturers]
self.market_countries = market_countries if not market_countries or not isinstance(market_countries, str) else [market_countries]
self.market_regions = market_regions if not market_regions or not isinstance(market_regions, str) else [market_regions]
self.carriers = carriers if not carriers or not isinstance(carriers, str) else [carriers]
self.physical_attributes = physical_attributes
self.hardware = hardware
self.software = software
self.display = display
self.cameras = cameras
def serialize(self):
return {'image': self.image, 'name': self.name, 'brand': self.brand, 'model': self.model, 'release_date': self.release_date, 'hardware_designer': self.hardware_designer, 'manufacturers': self.manufacturers, 'codename': self.codename, 'market_countries': self.market_countries, 'market_regions': self.market_regions, 'carriers': self.carriers, 'physical_attributes': self.physical_attributes.serialize() if self.physical_attributes is not None else None, 'software': self.software.serialize() if self.software is not None else None, 'hardware': self.hardware.serialize() if self.hardware is not None else None, 'display': self.display.serialize() if self.display is not None else None, 'cameras': [camera.serialize() for camera in self.cameras]}
def __repr__(self):
return repr(self.serialize())
class Brand:
def __init__(self, image=None, name=None, type_m=None, industries=None, found_date=None, location=None, area_served=None, phone_models=None, carriers=None, os=None, founders=None, parent=None):
self.image = image
self.name = name
self.type_m = type_m
self.found_date = found_date
self.location = location
self.area_served = area_served
self.parent = parent
self.industries = industries if not industries or not isinstance(industries, str) else [industries]
self.phone_models = phone_models if not phone_models or not isinstance(phone_models, str) else [phone_models]
self.carriers = carriers if not carriers or not isinstance(carriers, str) else [carriers]
self.os = os if not os or not isinstance(os, str) else [os]
self.founders = founders if not founders or not isinstance(founders, str) else [founders]
def serialize(self):
return {'image': self.image, 'name': self.name, 'type': self.type_m, 'industries': self.industries, 'found_date': self.found_date, 'location': self.location, 'area_served': self.area_served, 'phone_models': self.phone_models, 'carriers': self.carriers, 'os': self.os, 'founders': self.founders, 'parent': self.parent}
def __repr__(self):
return repr(self.serialize())
class Os:
def __init__(self, image=None, name=None, developer=None, release_date=None, version=None, os_kernel=None, os_family=None, supported_cpu_instruction_sets=None, predecessor=None, brands=None, models=None, codename=None, successor=None):
self.image = image
self.name = name
self.developer = developer
self.release_date = release_date
self.version = version
self.os_kernel = os_kernel
self.os_family = os_family
self.supported_cpu_instruction_sets = supported_cpu_instruction_sets if not supported_cpu_instruction_sets or not isinstance(supported_cpu_instruction_sets, str) else [supported_cpu_instruction_sets]
self.predecessor = predecessor
self.brands = brands if not brands or not isinstance(brands, str) else [brands]
self.models = models if not models or not isinstance(models, str) else [models]
self.codename = codename
self.successor = successor
def serialize(self):
return {'image': self.image, 'name': self.name, 'developer': self.developer, 'release_date': self.release_date, 'version': self.version, 'os_kernel': self.os_kernel, 'os_family': self.os_family, 'supported_cpu_instruction_sets': self.supported_cpu_instruction_sets, 'predecessor': self.predecessor, 'brands': self.brands, 'models': self.models, 'codename': self.codename, 'successor': self.successor}
def __repr__(self):
return repr(self.serialize())
class Carrier:
def __init__(self, image=None, name=None, short_name=None, cellular_networks=None, covered_countries=None, brands=None, models=None):
self.image = image
self.name = name
self.short_name = short_name
self.cellular_networks = cellular_networks if not cellular_networks or not isinstance(cellular_networks, str) else [cellular_networks]
self.covered_countries = covered_countries if not covered_countries or not isinstance(covered_countries, str) else [covered_countries]
self.brands = brands if not brands or not isinstance(brands, str) else [brands]
self.models = models if not models or not isinstance(models, str) else [models]
def serialize(self):
return {'image': self.image, 'name': self.name, 'short_name': self.short_name, 'cellular_networks': self.cellular_networks, 'covered_countries': self.covered_countries, 'brands': self.brands, 'models': self.models}
def __repr__(self):
return repr(self.serialize()) |
class Identifier(object):
def __init__(self, name, value, declared=False, id_type=None, constant=False):
self.name = name
self.value = value
self.declared = declared
self.type = id_type
self.constant = constant
def __str__(self):
return self.name | class Identifier(object):
def __init__(self, name, value, declared=False, id_type=None, constant=False):
self.name = name
self.value = value
self.declared = declared
self.type = id_type
self.constant = constant
def __str__(self):
return self.name |
def mostra_adicionais(*args):
telaProduto = args[0]
cursor = args[1]
QtWidgets = args[2]
telaProduto.frame_adc.show()
listaAdc = []
sql1 = ("select * from adcBroto")
cursor.execute(sql1)
dados1 = cursor.fetchall()
sql2 = ("select * from adcSeis ")
cursor.execute(sql2)
dados2 = cursor.fetchall()
sql3 = ("select * from adcOito")
cursor.execute(sql3)
dados3 = cursor.fetchall()
sql4 = ("select * from adcDez")
cursor.execute(sql4)
dados4 = cursor.fetchall()
slq5 = ("select * from adcSem")
cursor.execute(slq5)
dados5 = cursor.fetchall()
for i, j, k, l in zip(dados1, dados2, dados3, dados4):
listaAdc.append(i)
listaAdc.append(j)
listaAdc.append(k)
listaAdc.append(l)
for m in dados5:
listaAdc.append(m)
telaProduto.tableWidget_cadastro_2.setRowCount(len(listaAdc))
telaProduto.tableWidget_cadastro_2.setColumnCount(4)
for i in range(0, len(listaAdc)):
for j in range(4):
telaProduto.tableWidget_cadastro_2.setItem(i, j, QtWidgets.QTableWidgetItem(str(listaAdc[i][j]))) | def mostra_adicionais(*args):
tela_produto = args[0]
cursor = args[1]
qt_widgets = args[2]
telaProduto.frame_adc.show()
lista_adc = []
sql1 = 'select * from adcBroto'
cursor.execute(sql1)
dados1 = cursor.fetchall()
sql2 = 'select * from adcSeis '
cursor.execute(sql2)
dados2 = cursor.fetchall()
sql3 = 'select * from adcOito'
cursor.execute(sql3)
dados3 = cursor.fetchall()
sql4 = 'select * from adcDez'
cursor.execute(sql4)
dados4 = cursor.fetchall()
slq5 = 'select * from adcSem'
cursor.execute(slq5)
dados5 = cursor.fetchall()
for (i, j, k, l) in zip(dados1, dados2, dados3, dados4):
listaAdc.append(i)
listaAdc.append(j)
listaAdc.append(k)
listaAdc.append(l)
for m in dados5:
listaAdc.append(m)
telaProduto.tableWidget_cadastro_2.setRowCount(len(listaAdc))
telaProduto.tableWidget_cadastro_2.setColumnCount(4)
for i in range(0, len(listaAdc)):
for j in range(4):
telaProduto.tableWidget_cadastro_2.setItem(i, j, QtWidgets.QTableWidgetItem(str(listaAdc[i][j]))) |
#!/usr/bin/env pyrate
foo_obj = object_file('foo_obj', ['foo.cpp'], compiler_opts = '-O3')
executable('example07.bin', ['test.cpp', foo_obj])
| foo_obj = object_file('foo_obj', ['foo.cpp'], compiler_opts='-O3')
executable('example07.bin', ['test.cpp', foo_obj]) |
#! /usr/bin/python
Ada, C, GUI, SIMULINK, VHDL, OG, RTDS, SYSTEM_C, SCADE6, VDM, CPP = range(11)
thread, passive, unknown = range(3)
PI, RI = range(2)
synch, asynch = range(2)
param_in, param_out = range(2)
UPER, NATIVE, ACN = range(3)
cyclic, sporadic, variator, protected, unprotected = range(5)
enumerated, sequenceof, sequence, set, setof, integer, boolean, real, choice, octetstring, string = range(11)
functions = {}
functions['joystickdriver'] = {
'name_with_case' : 'JoystickDriver',
'runtime_nature': thread,
'language': OG,
'zipfile': '',
'interfaces': {},
'functional_states' : {}
}
functions['joystickdriver']['interfaces']['step'] = {
'port_name': 'step',
'parent_fv': 'joystickdriver',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': cyclic,
'period': 100,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['joystickdriver']['interfaces']['step']['paramsInOrdered'] = []
functions['joystickdriver']['interfaces']['step']['paramsOutOrdered'] = []
functions['joystickdriver']['interfaces']['cmd'] = {
'port_name': 'cmd',
'parent_fv': 'joystickdriver',
'direction': RI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 0,
'wcet_low': 0,
'wcet_low_unit': '',
'wcet_high': 0,
'wcet_high_unit': '',
'distant_fv': 'cmddispatcher',
'calling_threads': {},
'distant_name': 'cmd',
'queue_size': 1
}
functions['joystickdriver']['interfaces']['cmd']['paramsInOrdered'] = ['cmd_val']
functions['joystickdriver']['interfaces']['cmd']['paramsOutOrdered'] = []
functions['joystickdriver']['interfaces']['cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'cmd',
'param_direction': param_in
}
functions['cmddispatcher'] = {
'name_with_case' : 'CmdDispatcher',
'runtime_nature': thread,
'language': OG,
'zipfile': '',
'interfaces': {},
'functional_states' : {}
}
functions['cmddispatcher']['interfaces']['cmd'] = {
'port_name': 'cmd',
'parent_fv': 'cmddispatcher',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 10,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['cmddispatcher']['interfaces']['cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'cmd',
'param_direction': param_in
}
functions['cmddispatcher']['interfaces']['log_cmd'] = {
'port_name': 'log_cmd',
'parent_fv': 'cmddispatcher',
'direction': RI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 0,
'wcet_low': 0,
'wcet_low_unit': '',
'wcet_high': 0,
'wcet_high_unit': '',
'distant_fv': 'logger',
'calling_threads': {},
'distant_name': 'log_cmd',
'queue_size': 1
}
functions['cmddispatcher']['interfaces']['log_cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['log_cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['log_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'log_cmd',
'param_direction': param_in
}
functions['cmddispatcher']['interfaces']['test_cmd'] = {
'port_name': 'test_cmd',
'parent_fv': 'cmddispatcher',
'direction': RI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 0,
'wcet_low': 0,
'wcet_low_unit': '',
'wcet_high': 0,
'wcet_high_unit': '',
'distant_fv': 'watchdog',
'calling_threads': {},
'distant_name': 'test_cmd',
'queue_size': 1
}
functions['cmddispatcher']['interfaces']['test_cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['test_cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['test_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'test_cmd',
'param_direction': param_in
}
functions['watchdog'] = {
'name_with_case' : 'Watchdog',
'runtime_nature': thread,
'language': CPP,
'zipfile': '',
'interfaces': {},
'functional_states' : {}
}
functions['watchdog']['interfaces']['test_cmd'] = {
'port_name': 'test_cmd',
'parent_fv': 'watchdog',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 10,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['watchdog']['interfaces']['test_cmd']['paramsInOrdered'] = ['cmd_val']
functions['watchdog']['interfaces']['test_cmd']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['test_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'test_cmd',
'param_direction': param_in
}
functions['watchdog']['interfaces']['purge'] = {
'port_name': 'purge',
'parent_fv': 'watchdog',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': cyclic,
'period': 80,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['watchdog']['interfaces']['purge']['paramsInOrdered'] = []
functions['watchdog']['interfaces']['purge']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['mot_cmd'] = {
'port_name': 'mot_cmd',
'parent_fv': 'watchdog',
'direction': RI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 0,
'wcet_low': 0,
'wcet_low_unit': '',
'wcet_high': 0,
'wcet_high_unit': '',
'distant_fv': 'blsclient',
'calling_threads': {},
'distant_name': 'mot_cmd',
'queue_size': 1
}
functions['watchdog']['interfaces']['mot_cmd']['paramsInOrdered'] = ['cmd_val']
functions['watchdog']['interfaces']['mot_cmd']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['mot_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'mot_cmd',
'param_direction': param_in
}
functions['logger'] = {
'name_with_case' : 'Logger',
'runtime_nature': thread,
'language': OG,
'zipfile': '',
'interfaces': {},
'functional_states' : {}
}
functions['logger']['interfaces']['log_cmd'] = {
'port_name': 'log_cmd',
'parent_fv': 'logger',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 10,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['logger']['interfaces']['log_cmd']['paramsInOrdered'] = ['cmd_val']
functions['logger']['interfaces']['log_cmd']['paramsOutOrdered'] = []
functions['logger']['interfaces']['log_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'log_cmd',
'param_direction': param_in
}
functions['blsclient'] = {
'name_with_case' : 'BLSClient',
'runtime_nature': thread,
'language': OG,
'zipfile': '',
'interfaces': {},
'functional_states' : {}
}
functions['blsclient']['interfaces']['mot_cmd'] = {
'port_name': 'mot_cmd',
'parent_fv': 'blsclient',
'direction': PI,
'in': {},
'out': {},
'synchronism': asynch,
'rcm': sporadic,
'period': 10,
'wcet_low': 0,
'wcet_low_unit': 'ms',
'wcet_high': 10,
'wcet_high_unit': 'ms',
'distant_fv': '',
'calling_threads': {},
'distant_name': '',
'queue_size': 1
}
functions['blsclient']['interfaces']['mot_cmd']['paramsInOrdered'] = ['cmd_val']
functions['blsclient']['interfaces']['mot_cmd']['paramsOutOrdered'] = []
functions['blsclient']['interfaces']['mot_cmd']['in']['cmd_val'] = {
'type': 'Base_commands_Motion2D',
'asn1_module': 'Base_Types',
'basic_type': sequence,
'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn',
'encoding': NATIVE,
'interface': 'mot_cmd',
'param_direction': param_in
}
| (ada, c, gui, simulink, vhdl, og, rtds, system_c, scade6, vdm, cpp) = range(11)
(thread, passive, unknown) = range(3)
(pi, ri) = range(2)
(synch, asynch) = range(2)
(param_in, param_out) = range(2)
(uper, native, acn) = range(3)
(cyclic, sporadic, variator, protected, unprotected) = range(5)
(enumerated, sequenceof, sequence, set, setof, integer, boolean, real, choice, octetstring, string) = range(11)
functions = {}
functions['joystickdriver'] = {'name_with_case': 'JoystickDriver', 'runtime_nature': thread, 'language': OG, 'zipfile': '', 'interfaces': {}, 'functional_states': {}}
functions['joystickdriver']['interfaces']['step'] = {'port_name': 'step', 'parent_fv': 'joystickdriver', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': cyclic, 'period': 100, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['joystickdriver']['interfaces']['step']['paramsInOrdered'] = []
functions['joystickdriver']['interfaces']['step']['paramsOutOrdered'] = []
functions['joystickdriver']['interfaces']['cmd'] = {'port_name': 'cmd', 'parent_fv': 'joystickdriver', 'direction': RI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 0, 'wcet_low': 0, 'wcet_low_unit': '', 'wcet_high': 0, 'wcet_high_unit': '', 'distant_fv': 'cmddispatcher', 'calling_threads': {}, 'distant_name': 'cmd', 'queue_size': 1}
functions['joystickdriver']['interfaces']['cmd']['paramsInOrdered'] = ['cmd_val']
functions['joystickdriver']['interfaces']['cmd']['paramsOutOrdered'] = []
functions['joystickdriver']['interfaces']['cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'cmd', 'param_direction': param_in}
functions['cmddispatcher'] = {'name_with_case': 'CmdDispatcher', 'runtime_nature': thread, 'language': OG, 'zipfile': '', 'interfaces': {}, 'functional_states': {}}
functions['cmddispatcher']['interfaces']['cmd'] = {'port_name': 'cmd', 'parent_fv': 'cmddispatcher', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 10, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['cmddispatcher']['interfaces']['cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'cmd', 'param_direction': param_in}
functions['cmddispatcher']['interfaces']['log_cmd'] = {'port_name': 'log_cmd', 'parent_fv': 'cmddispatcher', 'direction': RI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 0, 'wcet_low': 0, 'wcet_low_unit': '', 'wcet_high': 0, 'wcet_high_unit': '', 'distant_fv': 'logger', 'calling_threads': {}, 'distant_name': 'log_cmd', 'queue_size': 1}
functions['cmddispatcher']['interfaces']['log_cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['log_cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['log_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'log_cmd', 'param_direction': param_in}
functions['cmddispatcher']['interfaces']['test_cmd'] = {'port_name': 'test_cmd', 'parent_fv': 'cmddispatcher', 'direction': RI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 0, 'wcet_low': 0, 'wcet_low_unit': '', 'wcet_high': 0, 'wcet_high_unit': '', 'distant_fv': 'watchdog', 'calling_threads': {}, 'distant_name': 'test_cmd', 'queue_size': 1}
functions['cmddispatcher']['interfaces']['test_cmd']['paramsInOrdered'] = ['cmd_val']
functions['cmddispatcher']['interfaces']['test_cmd']['paramsOutOrdered'] = []
functions['cmddispatcher']['interfaces']['test_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'test_cmd', 'param_direction': param_in}
functions['watchdog'] = {'name_with_case': 'Watchdog', 'runtime_nature': thread, 'language': CPP, 'zipfile': '', 'interfaces': {}, 'functional_states': {}}
functions['watchdog']['interfaces']['test_cmd'] = {'port_name': 'test_cmd', 'parent_fv': 'watchdog', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 10, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['watchdog']['interfaces']['test_cmd']['paramsInOrdered'] = ['cmd_val']
functions['watchdog']['interfaces']['test_cmd']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['test_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'test_cmd', 'param_direction': param_in}
functions['watchdog']['interfaces']['purge'] = {'port_name': 'purge', 'parent_fv': 'watchdog', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': cyclic, 'period': 80, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['watchdog']['interfaces']['purge']['paramsInOrdered'] = []
functions['watchdog']['interfaces']['purge']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['mot_cmd'] = {'port_name': 'mot_cmd', 'parent_fv': 'watchdog', 'direction': RI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 0, 'wcet_low': 0, 'wcet_low_unit': '', 'wcet_high': 0, 'wcet_high_unit': '', 'distant_fv': 'blsclient', 'calling_threads': {}, 'distant_name': 'mot_cmd', 'queue_size': 1}
functions['watchdog']['interfaces']['mot_cmd']['paramsInOrdered'] = ['cmd_val']
functions['watchdog']['interfaces']['mot_cmd']['paramsOutOrdered'] = []
functions['watchdog']['interfaces']['mot_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'mot_cmd', 'param_direction': param_in}
functions['logger'] = {'name_with_case': 'Logger', 'runtime_nature': thread, 'language': OG, 'zipfile': '', 'interfaces': {}, 'functional_states': {}}
functions['logger']['interfaces']['log_cmd'] = {'port_name': 'log_cmd', 'parent_fv': 'logger', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 10, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['logger']['interfaces']['log_cmd']['paramsInOrdered'] = ['cmd_val']
functions['logger']['interfaces']['log_cmd']['paramsOutOrdered'] = []
functions['logger']['interfaces']['log_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'log_cmd', 'param_direction': param_in}
functions['blsclient'] = {'name_with_case': 'BLSClient', 'runtime_nature': thread, 'language': OG, 'zipfile': '', 'interfaces': {}, 'functional_states': {}}
functions['blsclient']['interfaces']['mot_cmd'] = {'port_name': 'mot_cmd', 'parent_fv': 'blsclient', 'direction': PI, 'in': {}, 'out': {}, 'synchronism': asynch, 'rcm': sporadic, 'period': 10, 'wcet_low': 0, 'wcet_low_unit': 'ms', 'wcet_high': 10, 'wcet_high_unit': 'ms', 'distant_fv': '', 'calling_threads': {}, 'distant_name': '', 'queue_size': 1}
functions['blsclient']['interfaces']['mot_cmd']['paramsInOrdered'] = ['cmd_val']
functions['blsclient']['interfaces']['mot_cmd']['paramsOutOrdered'] = []
functions['blsclient']['interfaces']['mot_cmd']['in']['cmd_val'] = {'type': 'Base_commands_Motion2D', 'asn1_module': 'Base_Types', 'basic_type': sequence, 'asn1_filename': '/home/taste/esrocos_workspace/tutorial_integration_bip/dataview-uniq.asn', 'encoding': NATIVE, 'interface': 'mot_cmd', 'param_direction': param_in} |
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'futures',
'step',
]
def RunSteps(api):
futures = []
for i in range(10):
def _runner(i):
api.step(
'sleep loop [%d]' % (i+1),
['python3', '-u', api.resource('sleep_loop.py'), i],
cost=api.step.ResourceCost(),
)
return i + 1
futures.append(api.futures.spawn(_runner, i))
for helper in api.futures.iwait(futures):
api.step('Sleeper %d complete' % helper.result(), cmd=None)
def GenTests(api):
yield api.test('basic')
| python_version_compatibility = 'PY2+3'
deps = ['futures', 'step']
def run_steps(api):
futures = []
for i in range(10):
def _runner(i):
api.step('sleep loop [%d]' % (i + 1), ['python3', '-u', api.resource('sleep_loop.py'), i], cost=api.step.ResourceCost())
return i + 1
futures.append(api.futures.spawn(_runner, i))
for helper in api.futures.iwait(futures):
api.step('Sleeper %d complete' % helper.result(), cmd=None)
def gen_tests(api):
yield api.test('basic') |
'''Defines the `google_java_format_toolchain` rule.
'''
GoogleJavaFormatToolchainInfo = provider(
fields = {
"google_java_format_deploy_jar": "A JAR `File` containing Google Java Format and all of its run-time dependencies.",
"colordiff_executable": "A `File` pointing to `colordiff` executable (in the host configuration)."
},
)
def _google_java_format_toolchain_impl(ctx):
toolchain_info = platform_common.ToolchainInfo(
google_java_format_toolchain_info = GoogleJavaFormatToolchainInfo(
google_java_format_deploy_jar = ctx.file.google_java_format_deploy_jar,
colordiff_executable = ctx.file.colordiff_executable,
),
)
return [toolchain_info]
google_java_format_toolchain = rule(
implementation = _google_java_format_toolchain_impl,
attrs = {
"google_java_format_deploy_jar": attr.label(
allow_single_file = True,
mandatory = True,
executable = True,
cfg = "host",
),
"colordiff_executable": attr.label(
allow_single_file = True,
mandatory = True,
executable = True,
cfg = "host",
),
},
)
| """Defines the `google_java_format_toolchain` rule.
"""
google_java_format_toolchain_info = provider(fields={'google_java_format_deploy_jar': 'A JAR `File` containing Google Java Format and all of its run-time dependencies.', 'colordiff_executable': 'A `File` pointing to `colordiff` executable (in the host configuration).'})
def _google_java_format_toolchain_impl(ctx):
toolchain_info = platform_common.ToolchainInfo(google_java_format_toolchain_info=google_java_format_toolchain_info(google_java_format_deploy_jar=ctx.file.google_java_format_deploy_jar, colordiff_executable=ctx.file.colordiff_executable))
return [toolchain_info]
google_java_format_toolchain = rule(implementation=_google_java_format_toolchain_impl, attrs={'google_java_format_deploy_jar': attr.label(allow_single_file=True, mandatory=True, executable=True, cfg='host'), 'colordiff_executable': attr.label(allow_single_file=True, mandatory=True, executable=True, cfg='host')}) |
def getScore(savings, monthly, bills, cost, payDay):
score = 0
if cost > savings:
score = 0
elif savings < 1000:
score = savings/pow(cost,1.1)
else:
a = savings/(cost*1.1)
score += (1300*(monthly-bills))/(max(1,a)*pow(cost,1.1)*pow(payDay,0.8)) + (30*savings)/(pow(cost,1.1))
score = round(score/100,2)
if score > 10:
score = 9.99
return score
'''
while True:
savings = int(input("savings"))
monthly = int(input("monthly"))
bills = int(input("bills per month"))
cost = int(input("cost"))
payDay = int(input("days until next pay")) #days until next payday
print(getScore(savings, monthly, bills, cost, payDay))
#score += ((monthly - bills)/(max(1,(pow(a,1.5))*1.2))/cost)*(700/payDay)
#score = (4840*monthly)/(savings*pow(payDay,0.8)*pow(cost,0.1)) + (70*savings) / (cost*1.1)
'''
| def get_score(savings, monthly, bills, cost, payDay):
score = 0
if cost > savings:
score = 0
elif savings < 1000:
score = savings / pow(cost, 1.1)
else:
a = savings / (cost * 1.1)
score += 1300 * (monthly - bills) / (max(1, a) * pow(cost, 1.1) * pow(payDay, 0.8)) + 30 * savings / pow(cost, 1.1)
score = round(score / 100, 2)
if score > 10:
score = 9.99
return score
'\nwhile True:\n savings = int(input("savings"))\n monthly = int(input("monthly"))\n bills = int(input("bills per month"))\n cost = int(input("cost"))\n payDay = int(input("days until next pay")) #days until next payday\n print(getScore(savings, monthly, bills, cost, payDay))\n\n #score += ((monthly - bills)/(max(1,(pow(a,1.5))*1.2))/cost)*(700/payDay)\n #score = (4840*monthly)/(savings*pow(payDay,0.8)*pow(cost,0.1)) + (70*savings) / (cost*1.1)\n' |
#!/usr/bin/env python
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''Test instances data.'''
FAKE_API_RESPONSE1 = [
{
'kind': 'compute#instance',
'id': '6440513679799924564',
'creationTimestamp': '2017-05-26T22:08:11.094-07:00',
'name': 'iap-ig-79bj',
'tags': {
'items': [
'iap-tag'
],
'fingerprint': 'gilEhx3hEXk='
},
'machineType': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro',
'status': 'RUNNING',
'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c',
'canIpForward': False,
'networkInterfaces': [
{
'kind': 'compute#networkInterface',
'network': 'https://www.googleapis.com/compute/v1/projects/project1/global/networks/default',
'subnetwork': 'https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default',
'networkIP': '10.128.0.2',
'name': 'nic0',
'accessConfigs': [
{
'kind': 'compute#accessConfig',
'type': 'ONE_TO_ONE_NAT',
'name': 'External NAT',
'natIP': '104.198.131.130'
}
]
}
],
'disks': [
{
'kind': 'compute#attachedDisk',
'type': 'PERSISTENT',
'mode': 'READ_WRITE',
'source': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj',
'deviceName': 'iap-it-1',
'index': 0,
'boot': True,
'autoDelete': True,
'licenses': [
'https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie'
],
'interface': 'SCSI'
}
],
'metadata': {
'kind': 'compute#metadata',
'fingerprint': '3MpZMMvDTyo=',
'items': [
{
'key': 'instance-template',
'value': 'projects/600687511243/global/instanceTemplates/iap-it-1'
},
{
'key': 'created-by',
'value': 'projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig'
}
]
},
'serviceAccounts': [
{
'email': '600687511243-compute@developer.gserviceaccount.com',
'scopes': [
'https://www.googleapis.com/auth/devstorage.read_only',
'https://www.googleapis.com/auth/logging.write',
'https://www.googleapis.com/auth/monitoring.write',
'https://www.googleapis.com/auth/servicecontrol',
'https://www.googleapis.com/auth/service.management.readonly',
'https://www.googleapis.com/auth/trace.append'
]
}
],
'selfLink': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj',
'scheduling': {
'onHostMaintenance': 'MIGRATE',
'automaticRestart': True,
'preemptible': False
},
'cpuPlatform': 'Intel Haswell'
}
]
FAKE_API_RESPONSE2 = []
FAKE_PROJECT_INSTANCES_MAP = {
'project1': [
{
'kind': 'compute#instance',
'id': '6440513679799924564',
'creationTimestamp': '2017-05-26T22:08:11.094-07:00',
'name': 'iap-ig-79bj',
'tags': {
'items': [
'iap-tag'
],
'fingerprint': 'gilEhx3hEXk='
},
'machineType': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro',
'status': 'RUNNING',
'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c',
'canIpForward': False,
'networkInterfaces': [
{
'kind': 'compute#networkInterface',
'network': 'https://www.googleapis.com/compute/v1/projects/project1/global/networks/default',
'subnetwork': 'https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default',
'networkIP': '10.128.0.2',
'name': 'nic0',
'accessConfigs': [
{
'kind': 'compute#accessConfig',
'type': 'ONE_TO_ONE_NAT',
'name': 'External NAT',
'natIP': '104.198.131.130'
}
]
}
],
'disks': [
{
'kind': 'compute#attachedDisk',
'type': 'PERSISTENT',
'mode': 'READ_WRITE',
'source': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj',
'deviceName': 'iap-it-1',
'index': 0,
'boot': True,
'autoDelete': True,
'licenses': [
'https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie'
],
'interface': 'SCSI'
}
],
'metadata': {
'kind': 'compute#metadata',
'fingerprint': '3MpZMMvDTyo=',
'items': [
{
'key': 'instance-template',
'value': 'projects/600687511243/global/instanceTemplates/iap-it-1'
},
{
'key': 'created-by',
'value': 'projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig'
}
]
},
'serviceAccounts': [
{
'email': '600687511243-compute@developer.gserviceaccount.com',
'scopes': [
'https://www.googleapis.com/auth/devstorage.read_only',
'https://www.googleapis.com/auth/logging.write',
'https://www.googleapis.com/auth/monitoring.write',
'https://www.googleapis.com/auth/servicecontrol',
'https://www.googleapis.com/auth/service.management.readonly',
'https://www.googleapis.com/auth/trace.append'
]
}
],
'selfLink': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj',
'scheduling': {
'onHostMaintenance': 'MIGRATE',
'automaticRestart': True,
'preemptible': False
},
'cpuPlatform': 'Intel Haswell'
}
],
}
EXPECTED_LOADABLE_INSTANCES = [
{
'can_ip_forward': False,
'cpu_platform': 'Intel Haswell',
'creation_timestamp': '2017-05-26 22:08:11',
'description': None,
'disks': '[{"source": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj", "kind": "compute#attachedDisk", "mode": "READ_WRITE", "autoDelete": true, "deviceName": "iap-it-1", "licenses": ["https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie"], "index": 0, "interface": "SCSI", "boot": true, "type": "PERSISTENT"}]',
'id': '6440513679799924564',
'machine_type': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro',
'metadata': '{"items": [{"value": "projects/600687511243/global/instanceTemplates/iap-it-1", "key": "instance-template"}, {"value": "projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig", "key": "created-by"}], "kind": "compute#metadata", "fingerprint": "3MpZMMvDTyo="}',
'name': 'iap-ig-79bj',
'network_interfaces': '[{"kind": "compute#networkInterface", "network": "https://www.googleapis.com/compute/v1/projects/project1/global/networks/default", "accessConfigs": [{"kind": "compute#accessConfig", "type": "ONE_TO_ONE_NAT", "name": "External NAT", "natIP": "104.198.131.130"}], "networkIP": "10.128.0.2", "subnetwork": "https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default", "name": "nic0"}]',
'project_id': 'project1',
'scheduling': '{"automaticRestart": true, "preemptible": false, "onHostMaintenance": "MIGRATE"}',
'service_accounts': '[{"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring.write", "https://www.googleapis.com/auth/servicecontrol", "https://www.googleapis.com/auth/service.management.readonly", "https://www.googleapis.com/auth/trace.append"], "email": "600687511243-compute@developer.gserviceaccount.com"}]',
'status': 'RUNNING',
'status_message': None,
'tags': '{"items": ["iap-tag"], "fingerprint": "gilEhx3hEXk="}',
'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c',
'raw_instance': '{"status": "RUNNING", "cpuPlatform": "Intel Haswell", "kind": "compute#instance", "machineType": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro", "name": "iap-ig-79bj", "zone": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c", "tags": {"items": ["iap-tag"], "fingerprint": "gilEhx3hEXk="}, "disks": [{"source": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj", "kind": "compute#attachedDisk", "mode": "READ_WRITE", "autoDelete": true, "deviceName": "iap-it-1", "licenses": ["https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie"], "index": 0, "interface": "SCSI", "boot": true, "type": "PERSISTENT"}], "scheduling": {"automaticRestart": true, "preemptible": false, "onHostMaintenance": "MIGRATE"}, "canIpForward": false, "serviceAccounts": [{"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring.write", "https://www.googleapis.com/auth/servicecontrol", "https://www.googleapis.com/auth/service.management.readonly", "https://www.googleapis.com/auth/trace.append"], "email": "600687511243-compute@developer.gserviceaccount.com"}], "metadata": {"items": [{"value": "projects/600687511243/global/instanceTemplates/iap-it-1", "key": "instance-template"}, {"value": "projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig", "key": "created-by"}], "kind": "compute#metadata", "fingerprint": "3MpZMMvDTyo="}, "creationTimestamp": "2017-05-26T22:08:11.094-07:00", "id": "6440513679799924564", "selfLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj", "networkInterfaces": [{"kind": "compute#networkInterface", "network": "https://www.googleapis.com/compute/v1/projects/project1/global/networks/default", "accessConfigs": [{"kind": "compute#accessConfig", "type": "ONE_TO_ONE_NAT", "name": "External NAT", "natIP": "104.198.131.130"}], "networkIP": "10.128.0.2", "subnetwork": "https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default", "name": "nic0"}]}',
}
]
| """Test instances data."""
fake_api_response1 = [{'kind': 'compute#instance', 'id': '6440513679799924564', 'creationTimestamp': '2017-05-26T22:08:11.094-07:00', 'name': 'iap-ig-79bj', 'tags': {'items': ['iap-tag'], 'fingerprint': 'gilEhx3hEXk='}, 'machineType': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro', 'status': 'RUNNING', 'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c', 'canIpForward': False, 'networkInterfaces': [{'kind': 'compute#networkInterface', 'network': 'https://www.googleapis.com/compute/v1/projects/project1/global/networks/default', 'subnetwork': 'https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default', 'networkIP': '10.128.0.2', 'name': 'nic0', 'accessConfigs': [{'kind': 'compute#accessConfig', 'type': 'ONE_TO_ONE_NAT', 'name': 'External NAT', 'natIP': '104.198.131.130'}]}], 'disks': [{'kind': 'compute#attachedDisk', 'type': 'PERSISTENT', 'mode': 'READ_WRITE', 'source': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj', 'deviceName': 'iap-it-1', 'index': 0, 'boot': True, 'autoDelete': True, 'licenses': ['https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie'], 'interface': 'SCSI'}], 'metadata': {'kind': 'compute#metadata', 'fingerprint': '3MpZMMvDTyo=', 'items': [{'key': 'instance-template', 'value': 'projects/600687511243/global/instanceTemplates/iap-it-1'}, {'key': 'created-by', 'value': 'projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig'}]}, 'serviceAccounts': [{'email': '600687511243-compute@developer.gserviceaccount.com', 'scopes': ['https://www.googleapis.com/auth/devstorage.read_only', 'https://www.googleapis.com/auth/logging.write', 'https://www.googleapis.com/auth/monitoring.write', 'https://www.googleapis.com/auth/servicecontrol', 'https://www.googleapis.com/auth/service.management.readonly', 'https://www.googleapis.com/auth/trace.append']}], 'selfLink': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj', 'scheduling': {'onHostMaintenance': 'MIGRATE', 'automaticRestart': True, 'preemptible': False}, 'cpuPlatform': 'Intel Haswell'}]
fake_api_response2 = []
fake_project_instances_map = {'project1': [{'kind': 'compute#instance', 'id': '6440513679799924564', 'creationTimestamp': '2017-05-26T22:08:11.094-07:00', 'name': 'iap-ig-79bj', 'tags': {'items': ['iap-tag'], 'fingerprint': 'gilEhx3hEXk='}, 'machineType': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro', 'status': 'RUNNING', 'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c', 'canIpForward': False, 'networkInterfaces': [{'kind': 'compute#networkInterface', 'network': 'https://www.googleapis.com/compute/v1/projects/project1/global/networks/default', 'subnetwork': 'https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default', 'networkIP': '10.128.0.2', 'name': 'nic0', 'accessConfigs': [{'kind': 'compute#accessConfig', 'type': 'ONE_TO_ONE_NAT', 'name': 'External NAT', 'natIP': '104.198.131.130'}]}], 'disks': [{'kind': 'compute#attachedDisk', 'type': 'PERSISTENT', 'mode': 'READ_WRITE', 'source': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj', 'deviceName': 'iap-it-1', 'index': 0, 'boot': True, 'autoDelete': True, 'licenses': ['https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie'], 'interface': 'SCSI'}], 'metadata': {'kind': 'compute#metadata', 'fingerprint': '3MpZMMvDTyo=', 'items': [{'key': 'instance-template', 'value': 'projects/600687511243/global/instanceTemplates/iap-it-1'}, {'key': 'created-by', 'value': 'projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig'}]}, 'serviceAccounts': [{'email': '600687511243-compute@developer.gserviceaccount.com', 'scopes': ['https://www.googleapis.com/auth/devstorage.read_only', 'https://www.googleapis.com/auth/logging.write', 'https://www.googleapis.com/auth/monitoring.write', 'https://www.googleapis.com/auth/servicecontrol', 'https://www.googleapis.com/auth/service.management.readonly', 'https://www.googleapis.com/auth/trace.append']}], 'selfLink': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj', 'scheduling': {'onHostMaintenance': 'MIGRATE', 'automaticRestart': True, 'preemptible': False}, 'cpuPlatform': 'Intel Haswell'}]}
expected_loadable_instances = [{'can_ip_forward': False, 'cpu_platform': 'Intel Haswell', 'creation_timestamp': '2017-05-26 22:08:11', 'description': None, 'disks': '[{"source": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj", "kind": "compute#attachedDisk", "mode": "READ_WRITE", "autoDelete": true, "deviceName": "iap-it-1", "licenses": ["https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie"], "index": 0, "interface": "SCSI", "boot": true, "type": "PERSISTENT"}]', 'id': '6440513679799924564', 'machine_type': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro', 'metadata': '{"items": [{"value": "projects/600687511243/global/instanceTemplates/iap-it-1", "key": "instance-template"}, {"value": "projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig", "key": "created-by"}], "kind": "compute#metadata", "fingerprint": "3MpZMMvDTyo="}', 'name': 'iap-ig-79bj', 'network_interfaces': '[{"kind": "compute#networkInterface", "network": "https://www.googleapis.com/compute/v1/projects/project1/global/networks/default", "accessConfigs": [{"kind": "compute#accessConfig", "type": "ONE_TO_ONE_NAT", "name": "External NAT", "natIP": "104.198.131.130"}], "networkIP": "10.128.0.2", "subnetwork": "https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default", "name": "nic0"}]', 'project_id': 'project1', 'scheduling': '{"automaticRestart": true, "preemptible": false, "onHostMaintenance": "MIGRATE"}', 'service_accounts': '[{"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring.write", "https://www.googleapis.com/auth/servicecontrol", "https://www.googleapis.com/auth/service.management.readonly", "https://www.googleapis.com/auth/trace.append"], "email": "600687511243-compute@developer.gserviceaccount.com"}]', 'status': 'RUNNING', 'status_message': None, 'tags': '{"items": ["iap-tag"], "fingerprint": "gilEhx3hEXk="}', 'zone': 'https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c', 'raw_instance': '{"status": "RUNNING", "cpuPlatform": "Intel Haswell", "kind": "compute#instance", "machineType": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/machineTypes/f1-micro", "name": "iap-ig-79bj", "zone": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c", "tags": {"items": ["iap-tag"], "fingerprint": "gilEhx3hEXk="}, "disks": [{"source": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/disks/iap-ig-79bj", "kind": "compute#attachedDisk", "mode": "READ_WRITE", "autoDelete": true, "deviceName": "iap-it-1", "licenses": ["https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-8-jessie"], "index": 0, "interface": "SCSI", "boot": true, "type": "PERSISTENT"}], "scheduling": {"automaticRestart": true, "preemptible": false, "onHostMaintenance": "MIGRATE"}, "canIpForward": false, "serviceAccounts": [{"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring.write", "https://www.googleapis.com/auth/servicecontrol", "https://www.googleapis.com/auth/service.management.readonly", "https://www.googleapis.com/auth/trace.append"], "email": "600687511243-compute@developer.gserviceaccount.com"}], "metadata": {"items": [{"value": "projects/600687511243/global/instanceTemplates/iap-it-1", "key": "instance-template"}, {"value": "projects/600687511243/zones/us-central1-c/instanceGroupManagers/iap-ig", "key": "created-by"}], "kind": "compute#metadata", "fingerprint": "3MpZMMvDTyo="}, "creationTimestamp": "2017-05-26T22:08:11.094-07:00", "id": "6440513679799924564", "selfLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-c/instances/iap-ig-79bj", "networkInterfaces": [{"kind": "compute#networkInterface", "network": "https://www.googleapis.com/compute/v1/projects/project1/global/networks/default", "accessConfigs": [{"kind": "compute#accessConfig", "type": "ONE_TO_ONE_NAT", "name": "External NAT", "natIP": "104.198.131.130"}], "networkIP": "10.128.0.2", "subnetwork": "https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1/subnetworks/default", "name": "nic0"}]}'}] |
s=input("Enter string: ")
word=s.split()
word=list(reversed(word))
print("OUTPUT: ",end="")
print(" ".join(word)) | s = input('Enter string: ')
word = s.split()
word = list(reversed(word))
print('OUTPUT: ', end='')
print(' '.join(word)) |
# encoding: utf-8
__author__ = "Patrick Lampe"
__email__ = "uni at lampep.de"
class Point:
def __init__(self, id, location):
self.id = id
self.location = location
def getId(self):
return self.id
def get_distance_in_m(self, snd_node):
return self.get_distance_in_km(snd_node) * 1000
def get_distance_in_km(self, snd_node):
return self.location.get_distance_in_km(snd_node.location)
def get_heading(self, snd_node):
return self.location.get_heading(snd_node.location)
def get_lat(self):
return self.location.get_lat_lon().to_string()[0]
def get_lon(self):
return self.location.get_lat_lon().to_string()[1]
| __author__ = 'Patrick Lampe'
__email__ = 'uni at lampep.de'
class Point:
def __init__(self, id, location):
self.id = id
self.location = location
def get_id(self):
return self.id
def get_distance_in_m(self, snd_node):
return self.get_distance_in_km(snd_node) * 1000
def get_distance_in_km(self, snd_node):
return self.location.get_distance_in_km(snd_node.location)
def get_heading(self, snd_node):
return self.location.get_heading(snd_node.location)
def get_lat(self):
return self.location.get_lat_lon().to_string()[0]
def get_lon(self):
return self.location.get_lat_lon().to_string()[1] |
# Given a linked list, remove the n-th node from the end of list and return its head.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def removeNthFromEnd(self, head: ListNode, n: int):
# maintaining dummy to resolve edge cases
dummy = ListNode(0)
dummy.next = head
# this is a two pointer technique.
# Here we will be advancing one of the pointer to the n number of nodes and then advancing them equally
prevPtr, nextPtr = dummy, dummy
for i in range(n+1):
nextPtr = nextPtr.next
while nextPtr:
prevPtr = prevPtr.next
nextPtr = nextPtr.next
prevPtr.next = prevPtr.next.next
return dummy.next
if __name__ == "__main__":
a = ListNode(1)
b = ListNode(2)
c = ListNode(3)
d = ListNode(4)
e = ListNode(5)
a.next = b
b.next = c
c.next = d
d.next = e
head = Solution().removeNthFromEnd(a, 2)
while head:
print(head.val)
head = head.next
| class Listnode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def remove_nth_from_end(self, head: ListNode, n: int):
dummy = list_node(0)
dummy.next = head
(prev_ptr, next_ptr) = (dummy, dummy)
for i in range(n + 1):
next_ptr = nextPtr.next
while nextPtr:
prev_ptr = prevPtr.next
next_ptr = nextPtr.next
prevPtr.next = prevPtr.next.next
return dummy.next
if __name__ == '__main__':
a = list_node(1)
b = list_node(2)
c = list_node(3)
d = list_node(4)
e = list_node(5)
a.next = b
b.next = c
c.next = d
d.next = e
head = solution().removeNthFromEnd(a, 2)
while head:
print(head.val)
head = head.next |
def bmi_calculator(weight, height):
'''
Function calculates bmi according to passed arguments
weight (int or float) = weight of the person; ex: 61 or 61.0 kg
height (float) = height of the person, in meter; ex: 1.7 m
'''
bmi = weight / (height**2)
return bmi | def bmi_calculator(weight, height):
"""
Function calculates bmi according to passed arguments
weight (int or float) = weight of the person; ex: 61 or 61.0 kg
height (float) = height of the person, in meter; ex: 1.7 m
"""
bmi = weight / height ** 2
return bmi |
class VertexWeightProximityModifier:
falloff_type = None
mask_constant = None
mask_tex_map_object = None
mask_tex_mapping = None
mask_tex_use_channel = None
mask_tex_uv_layer = None
mask_texture = None
mask_vertex_group = None
max_dist = None
min_dist = None
proximity_geometry = None
proximity_mode = None
target = None
vertex_group = None
| class Vertexweightproximitymodifier:
falloff_type = None
mask_constant = None
mask_tex_map_object = None
mask_tex_mapping = None
mask_tex_use_channel = None
mask_tex_uv_layer = None
mask_texture = None
mask_vertex_group = None
max_dist = None
min_dist = None
proximity_geometry = None
proximity_mode = None
target = None
vertex_group = None |
class Solution:
def trimMean(self, arr: List[int]) -> float:
count = int(len(arr) * 0.05)
arr = sorted(arr)[count:-count]
return sum(arr) / len(arr)
| class Solution:
def trim_mean(self, arr: List[int]) -> float:
count = int(len(arr) * 0.05)
arr = sorted(arr)[count:-count]
return sum(arr) / len(arr) |
class Solution:
# @return a list of integers
def getRow(self, rowIndex):
row = []
for i in range(rowIndex+1):
n = i+1
tmp = [1]*n
for j in range(1, n-1):
tmp[j] = row[j-1] + row[j]
row = tmp
return row
| class Solution:
def get_row(self, rowIndex):
row = []
for i in range(rowIndex + 1):
n = i + 1
tmp = [1] * n
for j in range(1, n - 1):
tmp[j] = row[j - 1] + row[j]
row = tmp
return row |
def get_twos_sum(result, arr):
i, k = 0, len(arr) - 1
while i < k:
a, b = arr[i], arr[k]
res = a + b
if res == result:
return (a, b)
elif res < result:
i += 1
else:
k -= 1
def get_threes_sum(result, arr):
arr.sort()
for i in range(len(arr)):
c = arr[i]
if c > result:
continue
twos = get_twos_sum(result - c, arr[:i] + arr[i+1:])
if twos:
return True
return get_twos_sum(result, arr)
# Tests
assert get_threes_sum(49, [20, 303, 3, 4, 25])
assert not get_threes_sum(50, [20, 303, 3, 4, 25])
| def get_twos_sum(result, arr):
(i, k) = (0, len(arr) - 1)
while i < k:
(a, b) = (arr[i], arr[k])
res = a + b
if res == result:
return (a, b)
elif res < result:
i += 1
else:
k -= 1
def get_threes_sum(result, arr):
arr.sort()
for i in range(len(arr)):
c = arr[i]
if c > result:
continue
twos = get_twos_sum(result - c, arr[:i] + arr[i + 1:])
if twos:
return True
return get_twos_sum(result, arr)
assert get_threes_sum(49, [20, 303, 3, 4, 25])
assert not get_threes_sum(50, [20, 303, 3, 4, 25]) |
# Skill: Bitwise XOR
#Given an array of integers, arr, where all numbers occur twice except one number which occurs once, find the number. Your solution should ideally be O(n) time and use constant extra space.
#Example:
#Input: arr = [7, 3, 5, 5, 4, 3, 4, 8, 8]
#Output: 7
#Analysis
# Exploit the question of all numbers occurs twice except one number
# we use chain of bitwise operator XOR to "zero" the duplicate
# With XOR property, it allow single occur number remain
# Example:
# 1 ^ 3 ^ 5 ^ 1 ^ 5 = 3
# Time complexity O(N) space complexity O(1)
class Solution(object):
def findSingle(self, nums):
# Fill this in.
tmp = 0
for n in nums:
tmp = tmp ^ n
return tmp
if __name__ == "__main__":
nums = [1, 1, 3, 4, 4, 5, 6, 5, 6]
print(Solution().findSingle(nums))
# 3 | class Solution(object):
def find_single(self, nums):
tmp = 0
for n in nums:
tmp = tmp ^ n
return tmp
if __name__ == '__main__':
nums = [1, 1, 3, 4, 4, 5, 6, 5, 6]
print(solution().findSingle(nums)) |
email = input("What is your email id ").strip()
user_name = email[:email.index('@')]
domain_name = email[email.index('@')+1:]
result = "Your username is '{}' and your domain is '{}'".format(user_name, domain_name)
print(result)
| email = input('What is your email id ').strip()
user_name = email[:email.index('@')]
domain_name = email[email.index('@') + 1:]
result = "Your username is '{}' and your domain is '{}'".format(user_name, domain_name)
print(result) |
def step(part, instruction, pos, dir):
c, n = instruction
if c in "FNEWS":
change = {"N": 1j, "E": 1, "W": -1, "S": -1j, "F": dir}[c] * n
if c == "F" or part == 1:
return pos + change, dir
else:
return pos, dir + change
else:
return pos, dir * (1j - 2j * (c == "R")) ** (n // 90)
def dist_to_endpoint(part, steps, pos, dir):
if not steps:
return int(abs(pos.real) + abs(pos.imag))
return dist_to_endpoint(part, steps[1:], *step(part, steps[0], pos, dir))
with open("input.txt") as f:
instructions = [(line[0], int(line[1:])) for line in f]
print("Part 1:", dist_to_endpoint(part=1, steps=instructions, pos=0, dir=1))
print("Part 2:", dist_to_endpoint(part=2, steps=instructions, pos=0, dir=10 + 1j))
| def step(part, instruction, pos, dir):
(c, n) = instruction
if c in 'FNEWS':
change = {'N': 1j, 'E': 1, 'W': -1, 'S': -1j, 'F': dir}[c] * n
if c == 'F' or part == 1:
return (pos + change, dir)
else:
return (pos, dir + change)
else:
return (pos, dir * (1j - 2j * (c == 'R')) ** (n // 90))
def dist_to_endpoint(part, steps, pos, dir):
if not steps:
return int(abs(pos.real) + abs(pos.imag))
return dist_to_endpoint(part, steps[1:], *step(part, steps[0], pos, dir))
with open('input.txt') as f:
instructions = [(line[0], int(line[1:])) for line in f]
print('Part 1:', dist_to_endpoint(part=1, steps=instructions, pos=0, dir=1))
print('Part 2:', dist_to_endpoint(part=2, steps=instructions, pos=0, dir=10 + 1j)) |
#!/usr/bin/env python
# coding: utf-8
def mi_funcion():
print("una funcion")
class MiClase:
def __init__(self):
print ("una clase")
print ("un modulo") | def mi_funcion():
print('una funcion')
class Miclase:
def __init__(self):
print('una clase')
print('un modulo') |
NON_RELATION_TAG = "NonRel"
BRAT_REL_TEMPLATE = "R{}\t{} Arg1:{} Arg2:{}"
EN1_START = "[s1]"
EN1_END = "[e1]"
EN2_START = "[s2]"
EN2_END = "[e2]"
SPEC_TAGS = [EN1_START, EN1_END, EN2_START, EN2_END] | non_relation_tag = 'NonRel'
brat_rel_template = 'R{}\t{} Arg1:{} Arg2:{}'
en1_start = '[s1]'
en1_end = '[e1]'
en2_start = '[s2]'
en2_end = '[e2]'
spec_tags = [EN1_START, EN1_END, EN2_START, EN2_END] |
class InvalidEpubException(Exception):
'''Exception class to hold errors that occur during processing of an ePub file'''
archive = None
def __init__(self, *args, **kwargs):
if 'archive' in kwargs:
self.archive = kwargs['archive']
super(InvalidEpubException, self).__init__(*args)
| class Invalidepubexception(Exception):
"""Exception class to hold errors that occur during processing of an ePub file"""
archive = None
def __init__(self, *args, **kwargs):
if 'archive' in kwargs:
self.archive = kwargs['archive']
super(InvalidEpubException, self).__init__(*args) |
S = input()
if S == 'RRR':
print(3)
elif S.find('RR') != -1:
print(2)
elif S == 'SSS':
print(0)
else:
print(1) | s = input()
if S == 'RRR':
print(3)
elif S.find('RR') != -1:
print(2)
elif S == 'SSS':
print(0)
else:
print(1) |
# These are the compilation flags that will be used in case there's no
# compilation database set.
flags = [
'-Wall',
'-Wextra',
'-std=c++14',
'-stdlib=libc++',
'-x', 'c++',
'-I', '.',
'-I', 'include',
'-isystem', '/usr/include/c++/v1',
'-isystem', '/usr/include'
]
def FlagsForFile(filename):
return {
'flags': flags,
'do_cache': True
}
| flags = ['-Wall', '-Wextra', '-std=c++14', '-stdlib=libc++', '-x', 'c++', '-I', '.', '-I', 'include', '-isystem', '/usr/include/c++/v1', '-isystem', '/usr/include']
def flags_for_file(filename):
return {'flags': flags, 'do_cache': True} |
# Link to the problem: http://www.spoj.com/problems/ANARC09A/
def main():
n = input()
count = 1
while n[0] != '-':
o, c, ans = 0, 0, 0
for i in n:
if i == '{':
o += 1
elif i == '}':
if o > 0:
o -= 1
else:
c += 1
ans += (o // 2) + (c // 2)
if o % 2 == 1 and c % 2 == 1:
ans += 2
print('{}. {}'.format(count, ans))
count += 1
n = input()
if __name__ == '__main__':
main()
| def main():
n = input()
count = 1
while n[0] != '-':
(o, c, ans) = (0, 0, 0)
for i in n:
if i == '{':
o += 1
elif i == '}':
if o > 0:
o -= 1
else:
c += 1
ans += o // 2 + c // 2
if o % 2 == 1 and c % 2 == 1:
ans += 2
print('{}. {}'.format(count, ans))
count += 1
n = input()
if __name__ == '__main__':
main() |
# Credits:
# 1) https://gist.github.com/evansneath/4650991
# 2) https://www.tutorialspoint.com/How-to-convert-string-to-binary-in-Python
def crc(msg, div, code='000'):
# Append the code to the message. If no code is given, default to '000'
msg = msg + code
# Convert msg and div into list form for easier handling
msg = list(msg)
div = list(div)
# Loop over every message bit (minus the appended code)
for i in range(len(msg)-len(code)):
# If that messsage bit is 1, perform modulo 2 multiplication
if msg[i] == '1':
for j in range(len(div)):
# Perform modulo 2 multiplication on each index of the divisor
# msg[i+j] = str((int(msg[i+j])+int(div[j])) % 2)
msg[i+j] = str(int(msg[i+j]) ^ int(div[j]))
# Output the last error-checking code portion of the message generated
return ''.join(msg[-len(code):])
print("Sender's side....")
# Use a divisor that simulates: x^3 + x + 1
div = '1011'
msg = input('Enter message: ')
msg = ''.join(format(ord(x), 'b') for x in msg)
print(f'Binary encoded input message: {msg}')
print(f'Binary encoded G(x): {div}')
code = crc(msg, div)
print(f"Remaider calculated at sender's side: {code}")
print("\nReceiver's side....")
def printCheck(msg, div, code):
remainder = crc(msg, div, code)
print(f'Remainder is: {remainder}')
print('Success:', remainder == '000')
def errorFunc(msg, div, code):
Error = input("Introduce error(T/F): ")
if Error in ('T', 't'):
msg = list(msg)
msg[7] = str(int(msg[7]) ^ 1)
msg = ''.join(msg)
printCheck(msg, div, code)
else:
printCheck(msg, div, code)
errorFunc(msg, div, code)
| def crc(msg, div, code='000'):
msg = msg + code
msg = list(msg)
div = list(div)
for i in range(len(msg) - len(code)):
if msg[i] == '1':
for j in range(len(div)):
msg[i + j] = str(int(msg[i + j]) ^ int(div[j]))
return ''.join(msg[-len(code):])
print("Sender's side....")
div = '1011'
msg = input('Enter message: ')
msg = ''.join((format(ord(x), 'b') for x in msg))
print(f'Binary encoded input message: {msg}')
print(f'Binary encoded G(x): {div}')
code = crc(msg, div)
print(f"Remaider calculated at sender's side: {code}")
print("\nReceiver's side....")
def print_check(msg, div, code):
remainder = crc(msg, div, code)
print(f'Remainder is: {remainder}')
print('Success:', remainder == '000')
def error_func(msg, div, code):
error = input('Introduce error(T/F): ')
if Error in ('T', 't'):
msg = list(msg)
msg[7] = str(int(msg[7]) ^ 1)
msg = ''.join(msg)
print_check(msg, div, code)
else:
print_check(msg, div, code)
error_func(msg, div, code) |
class HDateException(Exception):
pass
class HMoneyException(Exception):
pass
class Dict_Exception(Exception):
pass
| class Hdateexception(Exception):
pass
class Hmoneyexception(Exception):
pass
class Dict_Exception(Exception):
pass |
# -*- coding: utf-8 -*-
__author__ = 'PCPC'
sumList = [n for n in range(1000) if n%3==0 or n%5==0]
print(sum(sumList)) | __author__ = 'PCPC'
sum_list = [n for n in range(1000) if n % 3 == 0 or n % 5 == 0]
print(sum(sumList)) |
def factory(x):
def fn():
return x
return fn
a1 = factory("foo")
a2 = factory("bar")
print(a1())
print(a2())
| def factory(x):
def fn():
return x
return fn
a1 = factory('foo')
a2 = factory('bar')
print(a1())
print(a2()) |
def find_pivot(arr, low, high):
if high < low:
return -1
if high == low:
return low
mid = int((low + high)/2)
if mid < high and arr[mid] > arr[mid + 1]:
return mid
if mid > low and arr[mid] < arr[mid - 1]:
return mid-1
if arr[low] >= arr[mid]:
return find_pivot(arr, low, mid-1)
return find_pivot(arr, mid+1, high)
def binary_search(arr, low, high, key):
if high < low:
return -1
mid = int((low+high)/2)
if key == arr[mid]:
return mid
if key > arr[mid]:
return binary_search(arr, mid+1, high, key)
return binary_search(arr, low, mid-1,key)
def pivoted_search(arr, low, high, key):
pivot = find_pivot(arr, 0, n-1)
if pivot == -1:
return binary_search(arr, 0, n-1, key)
if arr[pivot] == key:
return pivot
if arr[0] <= key:
return binary_search(arr, 0, pivot-1, key)
return binary_search(arr, pivot+1, n-1, key)
| def find_pivot(arr, low, high):
if high < low:
return -1
if high == low:
return low
mid = int((low + high) / 2)
if mid < high and arr[mid] > arr[mid + 1]:
return mid
if mid > low and arr[mid] < arr[mid - 1]:
return mid - 1
if arr[low] >= arr[mid]:
return find_pivot(arr, low, mid - 1)
return find_pivot(arr, mid + 1, high)
def binary_search(arr, low, high, key):
if high < low:
return -1
mid = int((low + high) / 2)
if key == arr[mid]:
return mid
if key > arr[mid]:
return binary_search(arr, mid + 1, high, key)
return binary_search(arr, low, mid - 1, key)
def pivoted_search(arr, low, high, key):
pivot = find_pivot(arr, 0, n - 1)
if pivot == -1:
return binary_search(arr, 0, n - 1, key)
if arr[pivot] == key:
return pivot
if arr[0] <= key:
return binary_search(arr, 0, pivot - 1, key)
return binary_search(arr, pivot + 1, n - 1, key) |
_base_ = './pascal_voc12.py'
# dataset settings
data = dict(
train=dict(
ann_dir='SegmentationClassAug',
split=[
'ImageSets/Segmentation/train.txt',
'ImageSets/Segmentation/aug.txt'
]
),
val=dict(
ann_dir='SegmentationClassAug',
),
test=dict(
ann_dir='SegmentationClassAug',
)
)
| _base_ = './pascal_voc12.py'
data = dict(train=dict(ann_dir='SegmentationClassAug', split=['ImageSets/Segmentation/train.txt', 'ImageSets/Segmentation/aug.txt']), val=dict(ann_dir='SegmentationClassAug'), test=dict(ann_dir='SegmentationClassAug')) |
def out(status, message, padding=0, custom=None):
if status == '?':
return input(
' ' * padding
+ '\033[1;36m'
+ '[?]'
+ '\033[0;0m'
+ ' ' + message
+ ': '
)
elif status == 'I':
print(
' ' * padding
+ '\033[1;32m['
+ (str(custom) if custom != None else 'I')
+ ']\033[0;0m'
+ ' '
+ message
)
elif status == 'E':
print(
' ' * padding
+ '\033[1;31m['
+ (str(custom) if custom != None else 'E')
+ ']\033[0;0m'
+ ' '
+ message
)
elif status == 'W':
print(
' ' * padding
+ '\033[1;33m['
+ (str(custom) if custom != None else 'W')
+ ']\033[0;0m'
+ ' '
+ message
)
| def out(status, message, padding=0, custom=None):
if status == '?':
return input(' ' * padding + '\x1b[1;36m' + '[?]' + '\x1b[0;0m' + ' ' + message + ': ')
elif status == 'I':
print(' ' * padding + '\x1b[1;32m[' + (str(custom) if custom != None else 'I') + ']\x1b[0;0m' + ' ' + message)
elif status == 'E':
print(' ' * padding + '\x1b[1;31m[' + (str(custom) if custom != None else 'E') + ']\x1b[0;0m' + ' ' + message)
elif status == 'W':
print(' ' * padding + '\x1b[1;33m[' + (str(custom) if custom != None else 'W') + ']\x1b[0;0m' + ' ' + message) |
description = ''
pages = ['header']
def setup(data):
pass
def test(data):
navigate('http://store.demoqa.com/')
header.verify_product_categories('Accessories, iMacs, iPads, iPhones, iPods, MacBooks')
capture('Verify product categories')
def teardown(data):
pass
| description = ''
pages = ['header']
def setup(data):
pass
def test(data):
navigate('http://store.demoqa.com/')
header.verify_product_categories('Accessories, iMacs, iPads, iPhones, iPods, MacBooks')
capture('Verify product categories')
def teardown(data):
pass |
while True:
e = str(input()).split()
a = int(e[0])
b = int(e[1])
if a == 0 == b: break
print(2 * a - b)
| while True:
e = str(input()).split()
a = int(e[0])
b = int(e[1])
if a == 0 == b:
break
print(2 * a - b) |
#
# PySNMP MIB module CISCO-LWAPP-LINKTEST-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-LINKTEST-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:05:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
Counter32, Counter64, Bits, iso, ObjectIdentity, ModuleIdentity, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, Integer32, TimeTicks, IpAddress, NotificationType, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "Bits", "iso", "ObjectIdentity", "ModuleIdentity", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "Integer32", "TimeTicks", "IpAddress", "NotificationType", "MibIdentifier")
MacAddress, TruthValue, DisplayString, TimeInterval, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TruthValue", "DisplayString", "TimeInterval", "TextualConvention", "RowStatus")
ciscoLwappLinkTestMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 516))
ciscoLwappLinkTestMIB.setRevisions(('2006-04-06 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoLwappLinkTestMIB.setRevisionsDescriptions(('Initial version of this MIB module. ',))
if mibBuilder.loadTexts: ciscoLwappLinkTestMIB.setLastUpdated('200604060000Z')
if mibBuilder.loadTexts: ciscoLwappLinkTestMIB.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts: ciscoLwappLinkTestMIB.setContactInfo(' Cisco Systems, Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS Email: cs-wnbu-snmp@cisco.com')
if mibBuilder.loadTexts: ciscoLwappLinkTestMIB.setDescription("This MIB is intended to be implemented on all those devices operating as Central controllers, that terminate the Light Weight Access Point Protocol tunnel from Cisco Light-weight LWAPP Access Points. Link Test is performed to learn the radio link quality between AP and Client. CCX linktest is performed for CCX clients. With CCX linktest radio link can be measured in both direction i.e. AP->Client(downLink) and Client->AP(uplink). When client does not support CCX or CCX linktest fails,ping is done between AP and Client. In ping test, only uplink (client->AP) quality can be measured. The relationship between the controller and the LWAPP APs is depicted as follows. +......+ +......+ +......+ +......+ + + + + + + + + + CC + + CC + + CC + + CC + + + + + + + + + +......+ +......+ +......+ +......+ .. . . . .. . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + AP + + AP + + AP + + AP + + AP + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ . . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + MN + + MN + + MN + + MN + + MN + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ The LWAPP tunnel exists between the controller and the APs. The MNs communicate with the APs through the protocol defined by the 802.11 standard. LWAPP APs, upon bootup, discover and join one of the controllers and forward all the 802.11 frames to them encapsulated inside LWAPP frames. GLOSSARY Access Point ( AP ) An entity that contains an 802.11 medium access control ( MAC ) and physical layer ( PHY ) interface and provides access to the distribution services via the wireless medium for associated clients. LWAPP APs encapsulate all the 802.11 frames in LWAPP frames and sends them to the controller to which it is logically connected. Central Controller ( CC ) The central entity that terminates the LWAPP protocol tunnel from the LWAPP APs. Throughout this MIB, this entity also referred to as 'controller'. Cisco Compatible eXtensions (CCX) Wireless LAN Access Points (APs) manufactured by Cisco Systems have features and capabilities beyond those in related standards (e.g., IEEE 802.11 suite of standards, Wi-Fi recommendations by WECA, 802.1X security suite, etc). A number of features provide higher performance. For example, Cisco AP transmits a specific Information Element, which the clients adapt to for enhanced performance. Similarly, a number of features are implemented by means of proprietary Information Elements, which Cisco clients use in specific ways to carry out tasks above and beyond the standard.Other examples of feature categories are roaming and power saving. Light Weight Access Point Protocol ( LWAPP ) This is a generic protocol that defines the communication between the Access Points and the Central controller. Mobile Node ( MN ) A roaming 802.11 wireless device in a wireless network associated with an access point. Mobile Node and client are used interchangeably. Received Signal Strength Indicator ( RSSI ) A measure of the strength of the signal as observed by the entity that received it, expressed in 'dbm'. Signal-Noise Ratio ( SNR ) A measure of the quality of the signal relative to the strength of noise expressed in 'dB'. REFERENCE [1] Wireless LAN Medium Access Control ( MAC ) and Physical Layer ( PHY ) Specifications. [2] Draft-obara-capwap-lwapp-00.txt, IETF Light Weight Access Point Protocol ")
ciscoLwappLinkTestMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 0))
ciscoLwappLinkTestMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1))
ciscoLwappLinkTestMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2))
ciscoLwappLinkTestConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1))
ciscoLwappLinkTestRun = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2))
ciscoLwappLinkTestStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3))
cLLtResponder = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 1), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cLLtResponder.setStatus('current')
if mibBuilder.loadTexts: cLLtResponder.setDescription("This object is used to control the AP's response to the linktests initiated by the client. When set to 'true', the AP is expected to respond to the linktests performed by the client. The AP won't respond to the linktests initiated by the client, when this object is set to 'false'. ")
cLLtPacketSize = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 1500)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cLLtPacketSize.setStatus('current')
if mibBuilder.loadTexts: cLLtPacketSize.setDescription('This object indicates the number of bytes to be sent by the AP to the client in one linktest packet. ')
cLLtNumberOfPackets = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cLLtNumberOfPackets.setStatus('current')
if mibBuilder.loadTexts: cLLtNumberOfPackets.setDescription('This object indicates the number of linktest packets sent by the AP to the client. ')
cLLtTestPurgeTime = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(15, 1800)).clone(15)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cLLtTestPurgeTime.setStatus('current')
if mibBuilder.loadTexts: cLLtTestPurgeTime.setDescription('This object indicates the duration for which the results of a particular run of linktest is available in cLLtClientLtResultsTable from the time of completion of that run of linktest. At the expiry of this time after the completion of the linktest, the entries corresponding to the linktest and the corresponding results are removed from cLLtClientLinkTestTable and cLLtClientLtResultsTable respectively. ')
cLLtClientLinkTestTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1), )
if mibBuilder.loadTexts: cLLtClientLinkTestTable.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLinkTestTable.setDescription("This table is used to initiate linktests between an AP and one of its associated clients. CCX linktests are done on clients that support CCX. For all non-CCX clients, ping test is done. Note that ping test is also done when the CCX linktests fail. With CCX LinkTest support, the controller can test the link quality in downstream (direction of traffic from AP to client) direction by issuing LinkTest requests towards the client and let client record in the response packet the RF parameters like received signal strength, signal-to-noise etc., of the received request packet. With ping test only those RF parameters that are seen by the AP are measured. User initiates one run of linktest by adding a row to this table through explicit management action from the network manager. A row is created by specifying cLLtClientLtIndex, cLLtClientLtMacAddress and setting the RowStatus object to 'createAndGo'. This indicates the the request made to start the linktest on the client identified by cLLtClientLtMacAddress. cLLtClientLtIndex identifies the particular instance of the test. The added row is deleted by setting the corresponding instance of the RowStatus object to 'destroy'. In case if the agent finds that the time duration represented by cLLtTestPurgeTime has elapsed since the completion of the linktest, it proceeds to delete the row automatically, if the row exists at that point of time. The results of the linktest identified by cLLtClientLtIndex can be obtained from the queries to cLLtClientLtResultsTable. ")
cLLtClientLinkTestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtIndex"))
if mibBuilder.loadTexts: cLLtClientLinkTestEntry.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLinkTestEntry.setDescription('Each entry in this table represents one instance of the linktest initiated by the user through a network manager. ')
cLLtClientLtIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 32)))
if mibBuilder.loadTexts: cLLtClientLtIndex.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtIndex.setDescription('This object uniquely identifies one particular run of the linktest initiated between the client identified by cLLtClientLtMacAddress and the AP it is currently associated with. ')
cLLtClientLtMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 2), MacAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cLLtClientLtMacAddress.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtMacAddress.setDescription("This object represents the mac address of the client involved in the particular run of linktest. This object must be set to a valid value when setting cLLtClientRowStatus to 'createAndGo' to initiate a run of linktest. ")
cLLtClientLtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cLLtClientLtRowStatus.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtRowStatus.setDescription('This object is the status column used for creating and deleting instances of the columnar objects in this table. ')
cLLtClientLTResultsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2), )
if mibBuilder.loadTexts: cLLtClientLTResultsTable.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLTResultsTable.setDescription('This table populates the results of the linktests initiated by the user through the cLLtClientLinkTestTable. This table has a sparse dependent relationship with cLLtClientLinkTestTable. There exists a row in this table corresponding to the row for each row in cLLtClientLinkTestTable identified by cLLtClientLtIndex. A row is added to this table when user, through the network manager, adds a row to cLLtClientLinkTestTable and initiates one run of linktest. A row is deleted by the agent when the corresponding row of cLLtClientLinkTestTable is deleted. The manager is expected to poll cLLtClientLtStatus to check the status of the linktest. Depending on the status read through this object cLLtClientLtStatus, the appropriate columns for CCX or ping tests are read and linktest statistics are gathered. ')
cLLtClientLTResultsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtIndex"))
if mibBuilder.loadTexts: cLLtClientLTResultsEntry.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLTResultsEntry.setDescription('Each entry in this table represents the results of the linktest identified by cLLtClientLtIndex. ')
cLLtClientLtPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 1), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtPacketsSent.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtPacketsSent.setDescription('The number of packets sent to the target client specified by cLLtClientLtMacAddress by the AP it is associated to. ')
cLLtClientLtPacketsRx = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtPacketsRx.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtPacketsRx.setDescription('The number of packets sent by the client specified by cLLtClientLtMacAddress to the AP it is associated to. ')
cLLtClientLtTotalPacketsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtTotalPacketsLost.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtTotalPacketsLost.setDescription('The total number of packets lost during the linktest in both the upstream and downstream directions. ')
cLLtClientLtApToClientPktsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 4), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtApToClientPktsLost.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtApToClientPktsLost.setDescription('The number of packets lost during the linktest in the downstream (direction of traffic from AP to client) direction. ')
cLLtClientLtClientToApPktsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 5), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtClientToApPktsLost.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtClientToApPktsLost.setDescription('The number of packets lost during the linktest in the upstream (direction of traffic from client to AP) direction. ')
cLLtClientLtMinRoundTripTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 6), TimeInterval()).setUnits('hundredths-seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtMinRoundTripTime.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtMinRoundTripTime.setDescription('The minimum round trip time observed on the linktest packet between the AP and the client. ')
cLLtClientLtMaxRoundTripTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 7), TimeInterval()).setUnits('hundredths-seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtMaxRoundTripTime.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtMaxRoundTripTime.setDescription('The maximum round trip time observed on the linktest packet between the AP and the client. ')
cLLtClientLtAvgRoundTripTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 8), TimeInterval()).setUnits('hundredths-seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtAvgRoundTripTime.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtAvgRoundTripTime.setDescription('The average round trip time observed on the linktest packet between the AP and the client. ')
cLLtClientLtUplinkMinRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 9), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkMinRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkMinRSSI.setDescription('The minimum RSSI value as observed at the AP. ')
cLLtClientLtUplinkMaxRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 10), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkMaxRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkMaxRSSI.setDescription('The maximum RSSI value as observed at the AP. ')
cLLtClientLtUplinkAvgRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 11), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkAvgRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkAvgRSSI.setDescription('The average RSSI value as observed at the AP. ')
cLLtClientLtDownlinkMinRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 12), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkMinRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkMinRSSI.setDescription('The minimum RSSI value as observed at the client. ')
cLLtClientLtDownlinkMaxRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 13), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkMaxRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkMaxRSSI.setDescription('The maximum RSSI value as observed at the client. ')
cLLtClientLtDownlinkAvgRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 14), Integer32()).setUnits('dBm').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkAvgRSSI.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkAvgRSSI.setDescription('The average RSSI value as observed at the client. ')
cLLtClientLtUplinkMinSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 15), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkMinSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkMinSNR.setDescription('The minimum SNR value as observed at the AP. ')
cLLtClientLtUplinkMaxSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 16), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkMaxSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkMaxSNR.setDescription('The maximum SNR value as observed at the AP. ')
cLLtClientLtUplinkAvgSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 17), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtUplinkAvgSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtUplinkAvgSNR.setDescription('The average SNR value as observed at the AP. ')
cLLtClientLtDownlinkMinSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 18), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkMinSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkMinSNR.setDescription('The minimum SNR value as observed at the client. ')
cLLtClientLtDownlinkMaxSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 19), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkMaxSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkMaxSNR.setDescription('The maximum SNR value as observed at the client. ')
cLLtClientLtDownlinkAvgSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 20), Integer32()).setUnits('dB').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtDownlinkAvgSNR.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDownlinkAvgSNR.setDescription('The average SNR value as observed at the client. ')
cLLtClientLtTotalTxRetriesAP = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 21), Counter32()).setUnits('retries').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtTotalTxRetriesAP.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtTotalTxRetriesAP.setDescription('The total number of linktest packet transmission retries as observed at the AP. ')
cLLtClientLtMaxTxRetriesAP = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 22), Counter32()).setUnits('retries').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtMaxTxRetriesAP.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtMaxTxRetriesAP.setDescription('The maximum number of linktest packet transmission retries observed at the AP. ')
cLLtClientLtTotalTxRetriesClient = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 23), Counter32()).setUnits('retries').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtTotalTxRetriesClient.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtTotalTxRetriesClient.setDescription('The total number of linktest packet transmission retries at the client. ')
cLLtClientLtMaxTxRetriesClient = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 24), Counter32()).setUnits('retries').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtMaxTxRetriesClient.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtMaxTxRetriesClient.setDescription('The maximum number of linktest packet transmission retries observed at the client. ')
cLLtClientLtStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("cLLtClientLtStatusFailed", 0), ("cLLtClientLtStatusCcxInProgress", 1), ("cLLtClientLtStatusPngInProgress", 2), ("cLLtClientLtStatusPingSuccess", 3), ("cLLtClientLtStatusCcxLtSuccess", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtStatus.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtStatus.setDescription("This object indicates the status of the linktest this particular entry corresponds to. The semantics as follows. 'cLLtClientLtStatusFailed' - This value indicates that this particular linktest has failed. 'cLLtClientLtCcxStatusInProgress' - This value indicates that the CCX linktest is in progress. 'cLLtClientLtPngStatusInProgress' - This value indicates that the Ping-based linktest is in progress. 'cLLtClientLtStatusPingSuccess' - This value indicates that ping-based linktest between AP and client has succeeded. Only the following columns of this table should be considered for collecting data from the ping responses. cLLtClientLtPacketsSent, cLLtClientLtPacketsRx, cLLtClientLtUplinkAvgRSSI, cLLtClientLtUplinkAvgSNR cLLtClientLtStatusCcxLtSuccess - This value indicates that CCX linktest done to test the link between the client and the AP is successful. All the columns of this table are applicable and valid for collecting data from the CCX responses. ")
cLLtClientLtDataRateTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1), )
if mibBuilder.loadTexts: cLLtClientLtDataRateTable.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDataRateTable.setDescription('This table provides the results of CCX Link tests classified on different data rates between AP and clients. A row is added to this table automatically by the agent corresponding to one linktest identified by cLLtClientLtIndex and deleted when the corresponding row in cLLtClientLinkTestTable is deleted. ')
cLLtClientLtDataRateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtIndex"), (0, "CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDataRate"))
if mibBuilder.loadTexts: cLLtClientLtDataRateEntry.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDataRateEntry.setDescription('Each entry represents a conceptual row and populates the number of packets sent in the linktest identified by cLLtClientLtIndex. The statistics of the linktest are classified based on the respective data rates identified by cLLtClientLtDataRate. ')
cLLtClientLtDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255)))
if mibBuilder.loadTexts: cLLtClientLtDataRate.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtDataRate.setDescription('This object identifies the rate at which packets are transmitted. The rates are defined in Mbps with the following being the possible values. Rates - 1,2,5.5,6,9,11,12,18,24,36,48,54,108. ')
cLLtClientLtRateDownlinkPktsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtRateDownlinkPktsSent.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtRateDownlinkPktsSent.setDescription('The number of packets sent by the AP at the rate identified by cLLtClientLtDataRate. ')
cLLtClientLtRateUplinkPktsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cLLtClientLtRateUplinkPktsSent.setStatus('current')
if mibBuilder.loadTexts: cLLtClientLtRateUplinkPktsSent.setDescription('The number of packets sent by the client at the rate identified by cLLtClientLtDataRate. ')
ciscoLwappLinkTestMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 1))
ciscoLwappLinkTestMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2))
ciscoLwappLinkTestMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 1, 1)).setObjects(("CISCO-LWAPP-LINKTEST-MIB", "cLLinkTestConfigGroup"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLinkTestRunsGroup"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLinkTestStatusGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappLinkTestMIBCompliance = ciscoLwappLinkTestMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: ciscoLwappLinkTestMIBCompliance.setDescription('The compliance statement for the SNMP entities that implement the ciscoLwappLinkTestMIB module.')
cLLinkTestConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 1)).setObjects(("CISCO-LWAPP-LINKTEST-MIB", "cLLtResponder"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtPacketSize"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtNumberOfPackets"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtTestPurgeTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cLLinkTestConfigGroup = cLLinkTestConfigGroup.setStatus('current')
if mibBuilder.loadTexts: cLLinkTestConfigGroup.setDescription('This collection of objects represent the linktest parameters for use during the various of the tests. ')
cLLinkTestRunsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 2)).setObjects(("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtMacAddress"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtPacketsSent"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtPacketsRx"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtTotalPacketsLost"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtApToClientPktsLost"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtClientToApPktsLost"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtMinRoundTripTime"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtMaxRoundTripTime"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtAvgRoundTripTime"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkMinRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkMaxRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkAvgRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkMinRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkMaxRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkAvgRSSI"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkMinSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkMaxSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtUplinkAvgSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkMinSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkMaxSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtDownlinkAvgSNR"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtTotalTxRetriesAP"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtMaxTxRetriesAP"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtTotalTxRetriesClient"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtMaxTxRetriesClient"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtStatus"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cLLinkTestRunsGroup = cLLinkTestRunsGroup.setStatus('current')
if mibBuilder.loadTexts: cLLinkTestRunsGroup.setDescription('This collection of objects is used to initiate linktests and retrieve the results of the respective runs of the tests. ')
cLLinkTestStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 3)).setObjects(("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtRateDownlinkPktsSent"), ("CISCO-LWAPP-LINKTEST-MIB", "cLLtClientLtRateUplinkPktsSent"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cLLinkTestStatusGroup = cLLinkTestStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cLLinkTestStatusGroup.setDescription('This collection of objects provide information about the linktest results. ')
mibBuilder.exportSymbols("CISCO-LWAPP-LINKTEST-MIB", ciscoLwappLinkTestMIBCompliances=ciscoLwappLinkTestMIBCompliances, cLLtClientLtTotalTxRetriesClient=cLLtClientLtTotalTxRetriesClient, cLLtClientLtUplinkMinSNR=cLLtClientLtUplinkMinSNR, cLLtClientLinkTestTable=cLLtClientLinkTestTable, cLLtClientLtRateUplinkPktsSent=cLLtClientLtRateUplinkPktsSent, cLLtClientLTResultsTable=cLLtClientLTResultsTable, PYSNMP_MODULE_ID=ciscoLwappLinkTestMIB, cLLtResponder=cLLtResponder, cLLtClientLTResultsEntry=cLLtClientLTResultsEntry, cLLtClientLtUplinkAvgRSSI=cLLtClientLtUplinkAvgRSSI, cLLtClientLtUplinkMaxSNR=cLLtClientLtUplinkMaxSNR, cLLtNumberOfPackets=cLLtNumberOfPackets, cLLtClientLtUplinkAvgSNR=cLLtClientLtUplinkAvgSNR, cLLtClientLtDataRateTable=cLLtClientLtDataRateTable, ciscoLwappLinkTestRun=ciscoLwappLinkTestRun, cLLtClientLtUplinkMinRSSI=cLLtClientLtUplinkMinRSSI, cLLtClientLtPacketsRx=cLLtClientLtPacketsRx, cLLtClientLtDownlinkAvgSNR=cLLtClientLtDownlinkAvgSNR, cLLtClientLtClientToApPktsLost=cLLtClientLtClientToApPktsLost, cLLtClientLtDataRateEntry=cLLtClientLtDataRateEntry, cLLtClientLtRateDownlinkPktsSent=cLLtClientLtRateDownlinkPktsSent, cLLtClientLtMacAddress=cLLtClientLtMacAddress, cLLtClientLtMaxRoundTripTime=cLLtClientLtMaxRoundTripTime, cLLtClientLtMinRoundTripTime=cLLtClientLtMinRoundTripTime, cLLtClientLtPacketsSent=cLLtClientLtPacketsSent, cLLtClientLtAvgRoundTripTime=cLLtClientLtAvgRoundTripTime, cLLtClientLtDownlinkAvgRSSI=cLLtClientLtDownlinkAvgRSSI, cLLtClientLtMaxTxRetriesClient=cLLtClientLtMaxTxRetriesClient, cLLtClientLtDataRate=cLLtClientLtDataRate, cLLtClientLtApToClientPktsLost=cLLtClientLtApToClientPktsLost, cLLtPacketSize=cLLtPacketSize, cLLtClientLtDownlinkMinRSSI=cLLtClientLtDownlinkMinRSSI, ciscoLwappLinkTestStatus=ciscoLwappLinkTestStatus, cLLtClientLtDownlinkMaxRSSI=cLLtClientLtDownlinkMaxRSSI, cLLtClientLtIndex=cLLtClientLtIndex, cLLtClientLtDownlinkMinSNR=cLLtClientLtDownlinkMinSNR, cLLinkTestRunsGroup=cLLinkTestRunsGroup, ciscoLwappLinkTestMIBNotifs=ciscoLwappLinkTestMIBNotifs, ciscoLwappLinkTestConfig=ciscoLwappLinkTestConfig, cLLtClientLtUplinkMaxRSSI=cLLtClientLtUplinkMaxRSSI, ciscoLwappLinkTestMIBCompliance=ciscoLwappLinkTestMIBCompliance, cLLtClientLinkTestEntry=cLLtClientLinkTestEntry, ciscoLwappLinkTestMIBObjects=ciscoLwappLinkTestMIBObjects, cLLtTestPurgeTime=cLLtTestPurgeTime, cLLtClientLtRowStatus=cLLtClientLtRowStatus, cLLtClientLtDownlinkMaxSNR=cLLtClientLtDownlinkMaxSNR, cLLtClientLtMaxTxRetriesAP=cLLtClientLtMaxTxRetriesAP, cLLinkTestStatusGroup=cLLinkTestStatusGroup, ciscoLwappLinkTestMIB=ciscoLwappLinkTestMIB, cLLinkTestConfigGroup=cLLinkTestConfigGroup, cLLtClientLtTotalPacketsLost=cLLtClientLtTotalPacketsLost, ciscoLwappLinkTestMIBGroups=ciscoLwappLinkTestMIBGroups, cLLtClientLtTotalTxRetriesAP=cLLtClientLtTotalTxRetriesAP, cLLtClientLtStatus=cLLtClientLtStatus, ciscoLwappLinkTestMIBConform=ciscoLwappLinkTestMIBConform)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_range_constraint, constraints_intersection, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance')
(counter32, counter64, bits, iso, object_identity, module_identity, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, integer32, time_ticks, ip_address, notification_type, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Counter64', 'Bits', 'iso', 'ObjectIdentity', 'ModuleIdentity', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'Integer32', 'TimeTicks', 'IpAddress', 'NotificationType', 'MibIdentifier')
(mac_address, truth_value, display_string, time_interval, textual_convention, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'MacAddress', 'TruthValue', 'DisplayString', 'TimeInterval', 'TextualConvention', 'RowStatus')
cisco_lwapp_link_test_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 516))
ciscoLwappLinkTestMIB.setRevisions(('2006-04-06 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIB.setRevisionsDescriptions(('Initial version of this MIB module. ',))
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIB.setLastUpdated('200604060000Z')
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIB.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIB.setContactInfo(' Cisco Systems, Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS Email: cs-wnbu-snmp@cisco.com')
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIB.setDescription("This MIB is intended to be implemented on all those devices operating as Central controllers, that terminate the Light Weight Access Point Protocol tunnel from Cisco Light-weight LWAPP Access Points. Link Test is performed to learn the radio link quality between AP and Client. CCX linktest is performed for CCX clients. With CCX linktest radio link can be measured in both direction i.e. AP->Client(downLink) and Client->AP(uplink). When client does not support CCX or CCX linktest fails,ping is done between AP and Client. In ping test, only uplink (client->AP) quality can be measured. The relationship between the controller and the LWAPP APs is depicted as follows. +......+ +......+ +......+ +......+ + + + + + + + + + CC + + CC + + CC + + CC + + + + + + + + + +......+ +......+ +......+ +......+ .. . . . .. . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + AP + + AP + + AP + + AP + + AP + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ . . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + MN + + MN + + MN + + MN + + MN + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ The LWAPP tunnel exists between the controller and the APs. The MNs communicate with the APs through the protocol defined by the 802.11 standard. LWAPP APs, upon bootup, discover and join one of the controllers and forward all the 802.11 frames to them encapsulated inside LWAPP frames. GLOSSARY Access Point ( AP ) An entity that contains an 802.11 medium access control ( MAC ) and physical layer ( PHY ) interface and provides access to the distribution services via the wireless medium for associated clients. LWAPP APs encapsulate all the 802.11 frames in LWAPP frames and sends them to the controller to which it is logically connected. Central Controller ( CC ) The central entity that terminates the LWAPP protocol tunnel from the LWAPP APs. Throughout this MIB, this entity also referred to as 'controller'. Cisco Compatible eXtensions (CCX) Wireless LAN Access Points (APs) manufactured by Cisco Systems have features and capabilities beyond those in related standards (e.g., IEEE 802.11 suite of standards, Wi-Fi recommendations by WECA, 802.1X security suite, etc). A number of features provide higher performance. For example, Cisco AP transmits a specific Information Element, which the clients adapt to for enhanced performance. Similarly, a number of features are implemented by means of proprietary Information Elements, which Cisco clients use in specific ways to carry out tasks above and beyond the standard.Other examples of feature categories are roaming and power saving. Light Weight Access Point Protocol ( LWAPP ) This is a generic protocol that defines the communication between the Access Points and the Central controller. Mobile Node ( MN ) A roaming 802.11 wireless device in a wireless network associated with an access point. Mobile Node and client are used interchangeably. Received Signal Strength Indicator ( RSSI ) A measure of the strength of the signal as observed by the entity that received it, expressed in 'dbm'. Signal-Noise Ratio ( SNR ) A measure of the quality of the signal relative to the strength of noise expressed in 'dB'. REFERENCE [1] Wireless LAN Medium Access Control ( MAC ) and Physical Layer ( PHY ) Specifications. [2] Draft-obara-capwap-lwapp-00.txt, IETF Light Weight Access Point Protocol ")
cisco_lwapp_link_test_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 0))
cisco_lwapp_link_test_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1))
cisco_lwapp_link_test_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2))
cisco_lwapp_link_test_config = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1))
cisco_lwapp_link_test_run = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2))
cisco_lwapp_link_test_status = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3))
c_l_lt_responder = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 1), truth_value().clone('true')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cLLtResponder.setStatus('current')
if mibBuilder.loadTexts:
cLLtResponder.setDescription("This object is used to control the AP's response to the linktests initiated by the client. When set to 'true', the AP is expected to respond to the linktests performed by the client. The AP won't respond to the linktests initiated by the client, when this object is set to 'false'. ")
c_l_lt_packet_size = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 1500)).clone(50)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cLLtPacketSize.setStatus('current')
if mibBuilder.loadTexts:
cLLtPacketSize.setDescription('This object indicates the number of bytes to be sent by the AP to the client in one linktest packet. ')
c_l_lt_number_of_packets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 100)).clone(20)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cLLtNumberOfPackets.setStatus('current')
if mibBuilder.loadTexts:
cLLtNumberOfPackets.setDescription('This object indicates the number of linktest packets sent by the AP to the client. ')
c_l_lt_test_purge_time = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(15, 1800)).clone(15)).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cLLtTestPurgeTime.setStatus('current')
if mibBuilder.loadTexts:
cLLtTestPurgeTime.setDescription('This object indicates the duration for which the results of a particular run of linktest is available in cLLtClientLtResultsTable from the time of completion of that run of linktest. At the expiry of this time after the completion of the linktest, the entries corresponding to the linktest and the corresponding results are removed from cLLtClientLinkTestTable and cLLtClientLtResultsTable respectively. ')
c_l_lt_client_link_test_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1))
if mibBuilder.loadTexts:
cLLtClientLinkTestTable.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLinkTestTable.setDescription("This table is used to initiate linktests between an AP and one of its associated clients. CCX linktests are done on clients that support CCX. For all non-CCX clients, ping test is done. Note that ping test is also done when the CCX linktests fail. With CCX LinkTest support, the controller can test the link quality in downstream (direction of traffic from AP to client) direction by issuing LinkTest requests towards the client and let client record in the response packet the RF parameters like received signal strength, signal-to-noise etc., of the received request packet. With ping test only those RF parameters that are seen by the AP are measured. User initiates one run of linktest by adding a row to this table through explicit management action from the network manager. A row is created by specifying cLLtClientLtIndex, cLLtClientLtMacAddress and setting the RowStatus object to 'createAndGo'. This indicates the the request made to start the linktest on the client identified by cLLtClientLtMacAddress. cLLtClientLtIndex identifies the particular instance of the test. The added row is deleted by setting the corresponding instance of the RowStatus object to 'destroy'. In case if the agent finds that the time duration represented by cLLtTestPurgeTime has elapsed since the completion of the linktest, it proceeds to delete the row automatically, if the row exists at that point of time. The results of the linktest identified by cLLtClientLtIndex can be obtained from the queries to cLLtClientLtResultsTable. ")
c_l_lt_client_link_test_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1)).setIndexNames((0, 'CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtIndex'))
if mibBuilder.loadTexts:
cLLtClientLinkTestEntry.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLinkTestEntry.setDescription('Each entry in this table represents one instance of the linktest initiated by the user through a network manager. ')
c_l_lt_client_lt_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 32)))
if mibBuilder.loadTexts:
cLLtClientLtIndex.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtIndex.setDescription('This object uniquely identifies one particular run of the linktest initiated between the client identified by cLLtClientLtMacAddress and the AP it is currently associated with. ')
c_l_lt_client_lt_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 2), mac_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cLLtClientLtMacAddress.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtMacAddress.setDescription("This object represents the mac address of the client involved in the particular run of linktest. This object must be set to a valid value when setting cLLtClientRowStatus to 'createAndGo' to initiate a run of linktest. ")
c_l_lt_client_lt_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 1, 1, 3), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cLLtClientLtRowStatus.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtRowStatus.setDescription('This object is the status column used for creating and deleting instances of the columnar objects in this table. ')
c_l_lt_client_lt_results_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2))
if mibBuilder.loadTexts:
cLLtClientLTResultsTable.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLTResultsTable.setDescription('This table populates the results of the linktests initiated by the user through the cLLtClientLinkTestTable. This table has a sparse dependent relationship with cLLtClientLinkTestTable. There exists a row in this table corresponding to the row for each row in cLLtClientLinkTestTable identified by cLLtClientLtIndex. A row is added to this table when user, through the network manager, adds a row to cLLtClientLinkTestTable and initiates one run of linktest. A row is deleted by the agent when the corresponding row of cLLtClientLinkTestTable is deleted. The manager is expected to poll cLLtClientLtStatus to check the status of the linktest. Depending on the status read through this object cLLtClientLtStatus, the appropriate columns for CCX or ping tests are read and linktest statistics are gathered. ')
c_l_lt_client_lt_results_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1)).setIndexNames((0, 'CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtIndex'))
if mibBuilder.loadTexts:
cLLtClientLTResultsEntry.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLTResultsEntry.setDescription('Each entry in this table represents the results of the linktest identified by cLLtClientLtIndex. ')
c_l_lt_client_lt_packets_sent = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 1), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtPacketsSent.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtPacketsSent.setDescription('The number of packets sent to the target client specified by cLLtClientLtMacAddress by the AP it is associated to. ')
c_l_lt_client_lt_packets_rx = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 2), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtPacketsRx.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtPacketsRx.setDescription('The number of packets sent by the client specified by cLLtClientLtMacAddress to the AP it is associated to. ')
c_l_lt_client_lt_total_packets_lost = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 3), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtTotalPacketsLost.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtTotalPacketsLost.setDescription('The total number of packets lost during the linktest in both the upstream and downstream directions. ')
c_l_lt_client_lt_ap_to_client_pkts_lost = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 4), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtApToClientPktsLost.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtApToClientPktsLost.setDescription('The number of packets lost during the linktest in the downstream (direction of traffic from AP to client) direction. ')
c_l_lt_client_lt_client_to_ap_pkts_lost = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 5), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtClientToApPktsLost.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtClientToApPktsLost.setDescription('The number of packets lost during the linktest in the upstream (direction of traffic from client to AP) direction. ')
c_l_lt_client_lt_min_round_trip_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 6), time_interval()).setUnits('hundredths-seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtMinRoundTripTime.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtMinRoundTripTime.setDescription('The minimum round trip time observed on the linktest packet between the AP and the client. ')
c_l_lt_client_lt_max_round_trip_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 7), time_interval()).setUnits('hundredths-seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtMaxRoundTripTime.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtMaxRoundTripTime.setDescription('The maximum round trip time observed on the linktest packet between the AP and the client. ')
c_l_lt_client_lt_avg_round_trip_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 8), time_interval()).setUnits('hundredths-seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtAvgRoundTripTime.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtAvgRoundTripTime.setDescription('The average round trip time observed on the linktest packet between the AP and the client. ')
c_l_lt_client_lt_uplink_min_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 9), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMinRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMinRSSI.setDescription('The minimum RSSI value as observed at the AP. ')
c_l_lt_client_lt_uplink_max_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 10), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMaxRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMaxRSSI.setDescription('The maximum RSSI value as observed at the AP. ')
c_l_lt_client_lt_uplink_avg_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 11), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkAvgRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkAvgRSSI.setDescription('The average RSSI value as observed at the AP. ')
c_l_lt_client_lt_downlink_min_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 12), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMinRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMinRSSI.setDescription('The minimum RSSI value as observed at the client. ')
c_l_lt_client_lt_downlink_max_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 13), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMaxRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMaxRSSI.setDescription('The maximum RSSI value as observed at the client. ')
c_l_lt_client_lt_downlink_avg_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 14), integer32()).setUnits('dBm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkAvgRSSI.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkAvgRSSI.setDescription('The average RSSI value as observed at the client. ')
c_l_lt_client_lt_uplink_min_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 15), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMinSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMinSNR.setDescription('The minimum SNR value as observed at the AP. ')
c_l_lt_client_lt_uplink_max_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 16), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMaxSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkMaxSNR.setDescription('The maximum SNR value as observed at the AP. ')
c_l_lt_client_lt_uplink_avg_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 17), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtUplinkAvgSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtUplinkAvgSNR.setDescription('The average SNR value as observed at the AP. ')
c_l_lt_client_lt_downlink_min_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 18), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMinSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMinSNR.setDescription('The minimum SNR value as observed at the client. ')
c_l_lt_client_lt_downlink_max_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 19), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMaxSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkMaxSNR.setDescription('The maximum SNR value as observed at the client. ')
c_l_lt_client_lt_downlink_avg_snr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 20), integer32()).setUnits('dB').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkAvgSNR.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDownlinkAvgSNR.setDescription('The average SNR value as observed at the client. ')
c_l_lt_client_lt_total_tx_retries_ap = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 21), counter32()).setUnits('retries').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtTotalTxRetriesAP.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtTotalTxRetriesAP.setDescription('The total number of linktest packet transmission retries as observed at the AP. ')
c_l_lt_client_lt_max_tx_retries_ap = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 22), counter32()).setUnits('retries').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtMaxTxRetriesAP.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtMaxTxRetriesAP.setDescription('The maximum number of linktest packet transmission retries observed at the AP. ')
c_l_lt_client_lt_total_tx_retries_client = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 23), counter32()).setUnits('retries').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtTotalTxRetriesClient.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtTotalTxRetriesClient.setDescription('The total number of linktest packet transmission retries at the client. ')
c_l_lt_client_lt_max_tx_retries_client = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 24), counter32()).setUnits('retries').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtMaxTxRetriesClient.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtMaxTxRetriesClient.setDescription('The maximum number of linktest packet transmission retries observed at the client. ')
c_l_lt_client_lt_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 2, 2, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4))).clone(namedValues=named_values(('cLLtClientLtStatusFailed', 0), ('cLLtClientLtStatusCcxInProgress', 1), ('cLLtClientLtStatusPngInProgress', 2), ('cLLtClientLtStatusPingSuccess', 3), ('cLLtClientLtStatusCcxLtSuccess', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtStatus.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtStatus.setDescription("This object indicates the status of the linktest this particular entry corresponds to. The semantics as follows. 'cLLtClientLtStatusFailed' - This value indicates that this particular linktest has failed. 'cLLtClientLtCcxStatusInProgress' - This value indicates that the CCX linktest is in progress. 'cLLtClientLtPngStatusInProgress' - This value indicates that the Ping-based linktest is in progress. 'cLLtClientLtStatusPingSuccess' - This value indicates that ping-based linktest between AP and client has succeeded. Only the following columns of this table should be considered for collecting data from the ping responses. cLLtClientLtPacketsSent, cLLtClientLtPacketsRx, cLLtClientLtUplinkAvgRSSI, cLLtClientLtUplinkAvgSNR cLLtClientLtStatusCcxLtSuccess - This value indicates that CCX linktest done to test the link between the client and the AP is successful. All the columns of this table are applicable and valid for collecting data from the CCX responses. ")
c_l_lt_client_lt_data_rate_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1))
if mibBuilder.loadTexts:
cLLtClientLtDataRateTable.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDataRateTable.setDescription('This table provides the results of CCX Link tests classified on different data rates between AP and clients. A row is added to this table automatically by the agent corresponding to one linktest identified by cLLtClientLtIndex and deleted when the corresponding row in cLLtClientLinkTestTable is deleted. ')
c_l_lt_client_lt_data_rate_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1)).setIndexNames((0, 'CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtIndex'), (0, 'CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDataRate'))
if mibBuilder.loadTexts:
cLLtClientLtDataRateEntry.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDataRateEntry.setDescription('Each entry represents a conceptual row and populates the number of packets sent in the linktest identified by cLLtClientLtIndex. The statistics of the linktest are classified based on the respective data rates identified by cLLtClientLtDataRate. ')
c_l_lt_client_lt_data_rate = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 255)))
if mibBuilder.loadTexts:
cLLtClientLtDataRate.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtDataRate.setDescription('This object identifies the rate at which packets are transmitted. The rates are defined in Mbps with the following being the possible values. Rates - 1,2,5.5,6,9,11,12,18,24,36,48,54,108. ')
c_l_lt_client_lt_rate_downlink_pkts_sent = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 2), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtRateDownlinkPktsSent.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtRateDownlinkPktsSent.setDescription('The number of packets sent by the AP at the rate identified by cLLtClientLtDataRate. ')
c_l_lt_client_lt_rate_uplink_pkts_sent = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 516, 1, 3, 1, 1, 3), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cLLtClientLtRateUplinkPktsSent.setStatus('current')
if mibBuilder.loadTexts:
cLLtClientLtRateUplinkPktsSent.setDescription('The number of packets sent by the client at the rate identified by cLLtClientLtDataRate. ')
cisco_lwapp_link_test_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 1))
cisco_lwapp_link_test_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2))
cisco_lwapp_link_test_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 1, 1)).setObjects(('CISCO-LWAPP-LINKTEST-MIB', 'cLLinkTestConfigGroup'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLinkTestRunsGroup'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLinkTestStatusGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_lwapp_link_test_mib_compliance = ciscoLwappLinkTestMIBCompliance.setStatus('current')
if mibBuilder.loadTexts:
ciscoLwappLinkTestMIBCompliance.setDescription('The compliance statement for the SNMP entities that implement the ciscoLwappLinkTestMIB module.')
c_l_link_test_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 1)).setObjects(('CISCO-LWAPP-LINKTEST-MIB', 'cLLtResponder'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtPacketSize'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtNumberOfPackets'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtTestPurgeTime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
c_l_link_test_config_group = cLLinkTestConfigGroup.setStatus('current')
if mibBuilder.loadTexts:
cLLinkTestConfigGroup.setDescription('This collection of objects represent the linktest parameters for use during the various of the tests. ')
c_l_link_test_runs_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 2)).setObjects(('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtMacAddress'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtPacketsSent'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtPacketsRx'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtTotalPacketsLost'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtApToClientPktsLost'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtClientToApPktsLost'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtMinRoundTripTime'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtMaxRoundTripTime'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtAvgRoundTripTime'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkMinRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkMaxRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkAvgRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkMinRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkMaxRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkAvgRSSI'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkMinSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkMaxSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtUplinkAvgSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkMinSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkMaxSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtDownlinkAvgSNR'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtTotalTxRetriesAP'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtMaxTxRetriesAP'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtTotalTxRetriesClient'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtMaxTxRetriesClient'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtStatus'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
c_l_link_test_runs_group = cLLinkTestRunsGroup.setStatus('current')
if mibBuilder.loadTexts:
cLLinkTestRunsGroup.setDescription('This collection of objects is used to initiate linktests and retrieve the results of the respective runs of the tests. ')
c_l_link_test_status_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 516, 2, 2, 3)).setObjects(('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtRateDownlinkPktsSent'), ('CISCO-LWAPP-LINKTEST-MIB', 'cLLtClientLtRateUplinkPktsSent'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
c_l_link_test_status_group = cLLinkTestStatusGroup.setStatus('current')
if mibBuilder.loadTexts:
cLLinkTestStatusGroup.setDescription('This collection of objects provide information about the linktest results. ')
mibBuilder.exportSymbols('CISCO-LWAPP-LINKTEST-MIB', ciscoLwappLinkTestMIBCompliances=ciscoLwappLinkTestMIBCompliances, cLLtClientLtTotalTxRetriesClient=cLLtClientLtTotalTxRetriesClient, cLLtClientLtUplinkMinSNR=cLLtClientLtUplinkMinSNR, cLLtClientLinkTestTable=cLLtClientLinkTestTable, cLLtClientLtRateUplinkPktsSent=cLLtClientLtRateUplinkPktsSent, cLLtClientLTResultsTable=cLLtClientLTResultsTable, PYSNMP_MODULE_ID=ciscoLwappLinkTestMIB, cLLtResponder=cLLtResponder, cLLtClientLTResultsEntry=cLLtClientLTResultsEntry, cLLtClientLtUplinkAvgRSSI=cLLtClientLtUplinkAvgRSSI, cLLtClientLtUplinkMaxSNR=cLLtClientLtUplinkMaxSNR, cLLtNumberOfPackets=cLLtNumberOfPackets, cLLtClientLtUplinkAvgSNR=cLLtClientLtUplinkAvgSNR, cLLtClientLtDataRateTable=cLLtClientLtDataRateTable, ciscoLwappLinkTestRun=ciscoLwappLinkTestRun, cLLtClientLtUplinkMinRSSI=cLLtClientLtUplinkMinRSSI, cLLtClientLtPacketsRx=cLLtClientLtPacketsRx, cLLtClientLtDownlinkAvgSNR=cLLtClientLtDownlinkAvgSNR, cLLtClientLtClientToApPktsLost=cLLtClientLtClientToApPktsLost, cLLtClientLtDataRateEntry=cLLtClientLtDataRateEntry, cLLtClientLtRateDownlinkPktsSent=cLLtClientLtRateDownlinkPktsSent, cLLtClientLtMacAddress=cLLtClientLtMacAddress, cLLtClientLtMaxRoundTripTime=cLLtClientLtMaxRoundTripTime, cLLtClientLtMinRoundTripTime=cLLtClientLtMinRoundTripTime, cLLtClientLtPacketsSent=cLLtClientLtPacketsSent, cLLtClientLtAvgRoundTripTime=cLLtClientLtAvgRoundTripTime, cLLtClientLtDownlinkAvgRSSI=cLLtClientLtDownlinkAvgRSSI, cLLtClientLtMaxTxRetriesClient=cLLtClientLtMaxTxRetriesClient, cLLtClientLtDataRate=cLLtClientLtDataRate, cLLtClientLtApToClientPktsLost=cLLtClientLtApToClientPktsLost, cLLtPacketSize=cLLtPacketSize, cLLtClientLtDownlinkMinRSSI=cLLtClientLtDownlinkMinRSSI, ciscoLwappLinkTestStatus=ciscoLwappLinkTestStatus, cLLtClientLtDownlinkMaxRSSI=cLLtClientLtDownlinkMaxRSSI, cLLtClientLtIndex=cLLtClientLtIndex, cLLtClientLtDownlinkMinSNR=cLLtClientLtDownlinkMinSNR, cLLinkTestRunsGroup=cLLinkTestRunsGroup, ciscoLwappLinkTestMIBNotifs=ciscoLwappLinkTestMIBNotifs, ciscoLwappLinkTestConfig=ciscoLwappLinkTestConfig, cLLtClientLtUplinkMaxRSSI=cLLtClientLtUplinkMaxRSSI, ciscoLwappLinkTestMIBCompliance=ciscoLwappLinkTestMIBCompliance, cLLtClientLinkTestEntry=cLLtClientLinkTestEntry, ciscoLwappLinkTestMIBObjects=ciscoLwappLinkTestMIBObjects, cLLtTestPurgeTime=cLLtTestPurgeTime, cLLtClientLtRowStatus=cLLtClientLtRowStatus, cLLtClientLtDownlinkMaxSNR=cLLtClientLtDownlinkMaxSNR, cLLtClientLtMaxTxRetriesAP=cLLtClientLtMaxTxRetriesAP, cLLinkTestStatusGroup=cLLinkTestStatusGroup, ciscoLwappLinkTestMIB=ciscoLwappLinkTestMIB, cLLinkTestConfigGroup=cLLinkTestConfigGroup, cLLtClientLtTotalPacketsLost=cLLtClientLtTotalPacketsLost, ciscoLwappLinkTestMIBGroups=ciscoLwappLinkTestMIBGroups, cLLtClientLtTotalTxRetriesAP=cLLtClientLtTotalTxRetriesAP, cLLtClientLtStatus=cLLtClientLtStatus, ciscoLwappLinkTestMIBConform=ciscoLwappLinkTestMIBConform) |
# Test that returning of NotImplemented from binary op methods leads to
# TypeError.
try:
NotImplemented
except NameError:
print("SKIP")
raise SystemExit
class C:
def __init__(self, value):
self.value = value
def __str__(self):
return "C({})".format(self.value)
def __add__(self, rhs):
print(self, '+', rhs)
return NotImplemented
def __sub__(self, rhs):
print(self, '-', rhs)
return NotImplemented
def __lt__(self, rhs):
print(self, '<', rhs)
return NotImplemented
def __neg__(self):
print('-', self)
return NotImplemented
c = C(0)
try:
c + 1
except TypeError:
print("TypeError")
try:
c - 2
except TypeError:
print("TypeError")
try:
c < 1
except TypeError:
print("TypeError")
# NotImplemented isn't handled specially in unary methods
print(-c)
# Test that NotImplemented can be hashed
print(type(hash(NotImplemented)))
| try:
NotImplemented
except NameError:
print('SKIP')
raise SystemExit
class C:
def __init__(self, value):
self.value = value
def __str__(self):
return 'C({})'.format(self.value)
def __add__(self, rhs):
print(self, '+', rhs)
return NotImplemented
def __sub__(self, rhs):
print(self, '-', rhs)
return NotImplemented
def __lt__(self, rhs):
print(self, '<', rhs)
return NotImplemented
def __neg__(self):
print('-', self)
return NotImplemented
c = c(0)
try:
c + 1
except TypeError:
print('TypeError')
try:
c - 2
except TypeError:
print('TypeError')
try:
c < 1
except TypeError:
print('TypeError')
print(-c)
print(type(hash(NotImplemented))) |
# POWER OF THREE LEETCODE SOLUTION:
# creating a class.
class Solution(object):
# creating a function to solve the problem.
def isPowerOfThree(self, n):
# creating a variable to track the exponent.
i = 0
# creating a while-loop to iterate until the desired number.
while 3 ** i <= n:
# creating a nested if-statement to check if the desired number is met.
if 3 ** i == n:
# returning true if the condition is met.
return True
# code to increment the exponent by one after each iteration.
i += 1
# returning False if the condition is not met.
return False | class Solution(object):
def is_power_of_three(self, n):
i = 0
while 3 ** i <= n:
if 3 ** i == n:
return True
i += 1
return False |
if False:
print("Really, really false.")
elif False:
print("nested")
else:
if "seems rediculous":
print("it is.")
| if False:
print('Really, really false.')
elif False:
print('nested')
elif 'seems rediculous':
print('it is.') |
nome = str(input('Qual e o seu nome?'))
if nome =='Gustavo':
print('Que nome lindo voce tem!')
else:
print('Seu nome e tao normal!')
print('Bom dia {}!'.format(nome))
| nome = str(input('Qual e o seu nome?'))
if nome == 'Gustavo':
print('Que nome lindo voce tem!')
else:
print('Seu nome e tao normal!')
print('Bom dia {}!'.format(nome)) |
class DescriptorTypesEnum():
_ECFP = "ecfp"
_ECFP_COUNTS = "ecfp_counts"
_MACCS_KEYS = "maccs_keys"
_AVALON = "avalon"
@property
def ECFP(self):
return self._ECFP
@ECFP.setter
def ECFP(self, value):
raise ValueError("Do not assign value to a DescriptorTypesEnum field")
@property
def ECFP_COUNTS(self):
return self._ECFP_COUNTS
@ECFP_COUNTS.setter
def ECFP_COUNTS(self, value):
raise ValueError("Do not assign value to a DescriptorTypesEnum field")
@property
def MACCS_KEYS(self):
return self._MACCS_KEYS
@MACCS_KEYS.setter
def MACCS_KEYS(self, value):
raise ValueError("Do not assign value to a DescriptorTypesEnum field")
@property
def AVALON(self):
return self._AVALON
@AVALON.setter
def AVALON(self, value):
raise ValueError("Do not assign value to a DescriptorTypesEnum field") | class Descriptortypesenum:
_ecfp = 'ecfp'
_ecfp_counts = 'ecfp_counts'
_maccs_keys = 'maccs_keys'
_avalon = 'avalon'
@property
def ecfp(self):
return self._ECFP
@ECFP.setter
def ecfp(self, value):
raise value_error('Do not assign value to a DescriptorTypesEnum field')
@property
def ecfp_counts(self):
return self._ECFP_COUNTS
@ECFP_COUNTS.setter
def ecfp_counts(self, value):
raise value_error('Do not assign value to a DescriptorTypesEnum field')
@property
def maccs_keys(self):
return self._MACCS_KEYS
@MACCS_KEYS.setter
def maccs_keys(self, value):
raise value_error('Do not assign value to a DescriptorTypesEnum field')
@property
def avalon(self):
return self._AVALON
@AVALON.setter
def avalon(self, value):
raise value_error('Do not assign value to a DescriptorTypesEnum field') |
day_events_list = input().split("|")
MAX_ENERGY = 100
ORDER_ENERGY = 30
REST_ENERGY = 50
energy = 100
coins = 100
is_not_bankrupt = True
for event in day_events_list:
single_events_list = event.split("-")
name = single_events_list[0]
value = int(single_events_list[1])
if name == "rest":
gained_energy = 0
if energy + value > MAX_ENERGY:
gained_energy = MAX_ENERGY - energy
energy = MAX_ENERGY
else:
energy += value
gained_energy = value
print(f"You gained {gained_energy} energy.")
print(f"Current energy: {energy}.")
elif name == "order":
if energy >= ORDER_ENERGY:
energy -= ORDER_ENERGY
coins += value
print(f"You earned {value} coins.")
else:
energy += REST_ENERGY
print("You had to rest!")
continue
else:
if coins > value:
coins -= value
print(f"You bought {name}.")
else:
print(f"Closed! Cannot afford {name}.")
is_not_bankrupt = False
break
if is_not_bankrupt:
print("Day completed!")
print(f"Coins: {coins}")
print(f"Energy: {energy}")
| day_events_list = input().split('|')
max_energy = 100
order_energy = 30
rest_energy = 50
energy = 100
coins = 100
is_not_bankrupt = True
for event in day_events_list:
single_events_list = event.split('-')
name = single_events_list[0]
value = int(single_events_list[1])
if name == 'rest':
gained_energy = 0
if energy + value > MAX_ENERGY:
gained_energy = MAX_ENERGY - energy
energy = MAX_ENERGY
else:
energy += value
gained_energy = value
print(f'You gained {gained_energy} energy.')
print(f'Current energy: {energy}.')
elif name == 'order':
if energy >= ORDER_ENERGY:
energy -= ORDER_ENERGY
coins += value
print(f'You earned {value} coins.')
else:
energy += REST_ENERGY
print('You had to rest!')
continue
elif coins > value:
coins -= value
print(f'You bought {name}.')
else:
print(f'Closed! Cannot afford {name}.')
is_not_bankrupt = False
break
if is_not_bankrupt:
print('Day completed!')
print(f'Coins: {coins}')
print(f'Energy: {energy}') |
def main(j, args, params, tags, tasklet):
params.merge(args)
doc = params.doc
# tags = params.tags
actor=j.apps.actorsloader.getActor("system","gridmanager")
organization = args.getTag("organization")
name = args.getTag("jsname")
out = ''
missing = False
for k,v in {'organization':organization, 'name':name}.items():
if not v:
out += 'Missing param %s.\n' % k
missing = True
if not missing:
obj = actor.getJumpscript(organization=organization, name=name)
out = ['||Property||Value||']
for k,v in obj.items():
if k in ('args', 'roles'):
v = ' ,'.join(v)
if k == 'source':
continue
v = j.data.text.toStr(v)
out.append("|%s|%s|" % (k.capitalize(), v.replace('\n', '') if v else v))
out.append('\n{{code:\n%s\n}}' % obj['source'])
out = '\n'.join(out)
doc.applyTemplate({'name': name})
params.result = (out, doc)
return params
def match(j, args, params, tags, tasklet):
return True
| def main(j, args, params, tags, tasklet):
params.merge(args)
doc = params.doc
actor = j.apps.actorsloader.getActor('system', 'gridmanager')
organization = args.getTag('organization')
name = args.getTag('jsname')
out = ''
missing = False
for (k, v) in {'organization': organization, 'name': name}.items():
if not v:
out += 'Missing param %s.\n' % k
missing = True
if not missing:
obj = actor.getJumpscript(organization=organization, name=name)
out = ['||Property||Value||']
for (k, v) in obj.items():
if k in ('args', 'roles'):
v = ' ,'.join(v)
if k == 'source':
continue
v = j.data.text.toStr(v)
out.append('|%s|%s|' % (k.capitalize(), v.replace('\n', '') if v else v))
out.append('\n{{code:\n%s\n}}' % obj['source'])
out = '\n'.join(out)
doc.applyTemplate({'name': name})
params.result = (out, doc)
return params
def match(j, args, params, tags, tasklet):
return True |
class color:
black = "\033[30m"
red = "\033[31m"
green = "\033[32m"
yellow = "\033[33m"
blue = "\033[34m"
magenta = "\033[35m"
cyan = "\033[36m"
white = "\033[37m"
class bright:
black_1 = "\033[1;30m"
red_1 = "\033[1;31m"
green_1 = "\033[1;32m"
yellow_1 = "\033[1;33m"
blue_1 = "\033[1;34m"
magenta_1 = "\033[1;35m"
cyan_1 = "\033[1;36m"
white_1 = "\033[1;37m" | class Color:
black = '\x1b[30m'
red = '\x1b[31m'
green = '\x1b[32m'
yellow = '\x1b[33m'
blue = '\x1b[34m'
magenta = '\x1b[35m'
cyan = '\x1b[36m'
white = '\x1b[37m'
class Bright:
black_1 = '\x1b[1;30m'
red_1 = '\x1b[1;31m'
green_1 = '\x1b[1;32m'
yellow_1 = '\x1b[1;33m'
blue_1 = '\x1b[1;34m'
magenta_1 = '\x1b[1;35m'
cyan_1 = '\x1b[1;36m'
white_1 = '\x1b[1;37m' |
##This does nothing yet...
class Broker(object):
def __init__(self):
self.name = 'ETrade'
self.tradeFee = 4.95
| class Broker(object):
def __init__(self):
self.name = 'ETrade'
self.tradeFee = 4.95 |
class Neuron(object):
def __init__(self, *args, **kwargs):
super(Neuron, self).__init__() | class Neuron(object):
def __init__(self, *args, **kwargs):
super(Neuron, self).__init__() |
num = int(input('Digite uma numero:'))
b = bin(num)
o = oct(num)
h = hex(num)
print('''Escolha
[1] binario
[2] octal
[3] hex ''')
opcao = int(input('sua Opcao: '))
if opcao == 1:
print('{} convertido {}'.format(num,b[2:]))
elif opcao == 2:
print('{} convertido {}'.format(num,o[2:]))
elif opcao == 3:
print('{} convertido {}'.format(num,h[2:]))
| num = int(input('Digite uma numero:'))
b = bin(num)
o = oct(num)
h = hex(num)
print('Escolha\n[1] binario\n[2] octal\n[3] hex ')
opcao = int(input('sua Opcao: '))
if opcao == 1:
print('{} convertido {}'.format(num, b[2:]))
elif opcao == 2:
print('{} convertido {}'.format(num, o[2:]))
elif opcao == 3:
print('{} convertido {}'.format(num, h[2:])) |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the commercial license agreement provided with the
# Software or, alternatively, in accordance with the terms contained in
# a written agreement between you and The Qt Company. For licensing terms
# and conditions see https://www.qt.io/terms-conditions. For further
# information use the contact form at https://www.qt.io/contact-us.
#
# GNU General Public License Usage
# Alternatively, this file may be used under the terms of the GNU
# General Public License version 3 as published by the Free Software
# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
# included in the packaging of this file. Please review the following
# information to ensure the GNU General Public License requirements will
# be met: https://www.gnu.org/licenses/gpl-3.0.html.
#
############################################################################
source("../../shared/qtcreator.py")
qmlEditor = ":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"
outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView"
treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus."
def main():
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
"quick", "keyinteraction")
proFile = "keyinteraction.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return
templateDir = prepareTemplate(sourceExample)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_6_1_DEFAULT])
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles)
testModify()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def checkOutlineFor(qmlFiles):
for qmlFile in qmlFiles:
if not openDocument(qmlFile):
test.fatal("Failed to open file '%s'" % simpleFileName(qmlFile))
continue
selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Outline")
pseudoTree = buildTreeFromOutline()
# __writeOutlineFile__(pseudoTree, simpleFileName(qmlFile)+"_outline.tsv")
verifyOutline(pseudoTree, simpleFileName(qmlFile) + "_outline.tsv")
def buildTreeFromOutline():
global outline
model = waitForObject(outline).model()
waitFor("model.rowCount() > 0")
snooze(1) # if model updates delayed processChildren() results in AUT crash
return processChildren(model, QModelIndex(), 0)
def processChildren(model, startIndex, level):
children = []
for index in dumpIndices(model, startIndex):
annotationData = str(index.data(Qt.UserRole + 3)) # HACK - taken from source
children.append((str(index.data()), level, annotationData))
if model.hasChildren(index):
children.extend(processChildren(model, index, level + 1))
return children
def testModify():
global qmlEditor
if not openDocument(treebase + "focus\\.qml"):
test.fatal("Failed to open file focus.qml")
return
test.log("Testing whether modifications show up inside outline.")
if not placeCursorToLine(qmlEditor, 'color: "#3E606F"'):
return
test.log("Modification: adding a QML element")
typeLines(qmlEditor, ['', '', 'Text {', 'id: addedText', 'text: "Squish QML outline test"',
'color: "darkcyan"', 'font.bold: true', 'anchors.centerIn: parent'])
selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Outline")
snooze(1) # no way to wait for a private signal
pseudoTree = buildTreeFromOutline()
# __writeOutlineFile__(pseudoTree, "focus.qml_mod1_outline.tsv")
verifyOutline(pseudoTree, "focus.qml_mod1_outline.tsv")
test.log("Modification: change existing content")
performModification('color: "#3E606F"', "<Left>", 7, "Left", "white")
performModification('color: "black"', "<Left>", 5, "Left", "#cc00bb")
performModification('rotation: 90', None, 2, "Left", "180")
snooze(1) # no way to wait for a private signal
pseudoTree = buildTreeFromOutline()
# __writeOutlineFile__(pseudoTree, "focus.qml_mod2_outline.tsv")
verifyOutline(pseudoTree, "focus.qml_mod2_outline.tsv")
test.log("Modification: add special elements")
placeCursorToLine(qmlEditor, 'id: window')
typeLines(qmlEditor, ['', '', 'property string txtCnt: "Property"', 'signal clicked', '',
'function clicked() {','console.log("click")'])
performModification('onClicked: contextMenu.focus = true', None, 24, "Left", '{')
performModification('onClicked: {contextMenu.focus = true}', "<Left>", 0, None,
';window.clicked()')
snooze(1) # no way to wait for a private signal
pseudoTree = buildTreeFromOutline()
# __writeOutlineFile__(pseudoTree, "focus.qml_mod3_outline.tsv")
verifyOutline(pseudoTree, "focus.qml_mod3_outline.tsv")
def performModification(afterLine, typing, markCount, markDirection, newText):
global qmlEditor
if not placeCursorToLine(qmlEditor, afterLine):
return
if typing:
type(qmlEditor, typing)
markText(qmlEditor, markDirection, markCount)
type(qmlEditor, newText)
# used to create the tsv file(s)
def __writeOutlineFile__(outlinePseudoTree, filename):
f = open(filename, "w+")
f.write('"element"\t"nestinglevel"\t"value"\n')
for elem in outlinePseudoTree:
f.write('"%s"\t"%s"\t"%s"\n' % (elem[0], elem[1], elem[2].replace('"', '\"\"')))
f.close()
def retrieveData(record):
return (testData.field(record, "element"),
__builtin__.int(testData.field(record, "nestinglevel")),
testData.field(record, "value"))
def verifyOutline(outlinePseudoTree, datasetFileName):
fileName = datasetFileName[:datasetFileName.index("_")]
expected = map(retrieveData, testData.dataset(datasetFileName))
if len(expected) != len(outlinePseudoTree):
test.fail("Mismatch in length of expected and found elements of outline. Skipping "
"verification of nodes.",
"Found %d elements, but expected %d" % (len(outlinePseudoTree), len(expected)))
return
for counter, (expectedItem, foundItem) in enumerate(zip(expected, outlinePseudoTree)):
if expectedItem != foundItem:
test.fail("Mismatch in element number %d for '%s'" % (counter + 1, fileName),
"%s != %s" % (str(expectedItem), str(foundItem)))
return
test.passes("All nodes (%d) inside outline match expected nodes for '%s'."
% (len(expected), fileName))
| source('../../shared/qtcreator.py')
qml_editor = ':Qt Creator_QmlJSEditor::QmlJSTextEditorWidget'
outline = ':Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView'
treebase = 'keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus.'
def main():
source_example = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), 'quick', 'keyinteraction')
pro_file = 'keyinteraction.pro'
if not needed_file_present(os.path.join(sourceExample, proFile)):
return
template_dir = prepare_template(sourceExample)
start_application('qtcreator' + SettingsPath)
if not started_without_plugin_error():
return
open_qmake_project(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_6_1_DEFAULT])
qml_files = [treebase + 'focus\\.qml', treebase + 'Core.ListMenu\\.qml']
check_outline_for(qmlFiles)
test_modify()
invoke_menu_item('File', 'Save All')
invoke_menu_item('File', 'Exit')
def check_outline_for(qmlFiles):
for qml_file in qmlFiles:
if not open_document(qmlFile):
test.fatal("Failed to open file '%s'" % simple_file_name(qmlFile))
continue
select_from_combo(':Qt Creator_Core::Internal::NavComboBox', 'Outline')
pseudo_tree = build_tree_from_outline()
verify_outline(pseudoTree, simple_file_name(qmlFile) + '_outline.tsv')
def build_tree_from_outline():
global outline
model = wait_for_object(outline).model()
wait_for('model.rowCount() > 0')
snooze(1)
return process_children(model, q_model_index(), 0)
def process_children(model, startIndex, level):
children = []
for index in dump_indices(model, startIndex):
annotation_data = str(index.data(Qt.UserRole + 3))
children.append((str(index.data()), level, annotationData))
if model.hasChildren(index):
children.extend(process_children(model, index, level + 1))
return children
def test_modify():
global qmlEditor
if not open_document(treebase + 'focus\\.qml'):
test.fatal('Failed to open file focus.qml')
return
test.log('Testing whether modifications show up inside outline.')
if not place_cursor_to_line(qmlEditor, 'color: "#3E606F"'):
return
test.log('Modification: adding a QML element')
type_lines(qmlEditor, ['', '', 'Text {', 'id: addedText', 'text: "Squish QML outline test"', 'color: "darkcyan"', 'font.bold: true', 'anchors.centerIn: parent'])
select_from_combo(':Qt Creator_Core::Internal::NavComboBox', 'Outline')
snooze(1)
pseudo_tree = build_tree_from_outline()
verify_outline(pseudoTree, 'focus.qml_mod1_outline.tsv')
test.log('Modification: change existing content')
perform_modification('color: "#3E606F"', '<Left>', 7, 'Left', 'white')
perform_modification('color: "black"', '<Left>', 5, 'Left', '#cc00bb')
perform_modification('rotation: 90', None, 2, 'Left', '180')
snooze(1)
pseudo_tree = build_tree_from_outline()
verify_outline(pseudoTree, 'focus.qml_mod2_outline.tsv')
test.log('Modification: add special elements')
place_cursor_to_line(qmlEditor, 'id: window')
type_lines(qmlEditor, ['', '', 'property string txtCnt: "Property"', 'signal clicked', '', 'function clicked() {', 'console.log("click")'])
perform_modification('onClicked: contextMenu.focus = true', None, 24, 'Left', '{')
perform_modification('onClicked: {contextMenu.focus = true}', '<Left>', 0, None, ';window.clicked()')
snooze(1)
pseudo_tree = build_tree_from_outline()
verify_outline(pseudoTree, 'focus.qml_mod3_outline.tsv')
def perform_modification(afterLine, typing, markCount, markDirection, newText):
global qmlEditor
if not place_cursor_to_line(qmlEditor, afterLine):
return
if typing:
type(qmlEditor, typing)
mark_text(qmlEditor, markDirection, markCount)
type(qmlEditor, newText)
def __write_outline_file__(outlinePseudoTree, filename):
f = open(filename, 'w+')
f.write('"element"\t"nestinglevel"\t"value"\n')
for elem in outlinePseudoTree:
f.write('"%s"\t"%s"\t"%s"\n' % (elem[0], elem[1], elem[2].replace('"', '""')))
f.close()
def retrieve_data(record):
return (testData.field(record, 'element'), __builtin__.int(testData.field(record, 'nestinglevel')), testData.field(record, 'value'))
def verify_outline(outlinePseudoTree, datasetFileName):
file_name = datasetFileName[:datasetFileName.index('_')]
expected = map(retrieveData, testData.dataset(datasetFileName))
if len(expected) != len(outlinePseudoTree):
test.fail('Mismatch in length of expected and found elements of outline. Skipping verification of nodes.', 'Found %d elements, but expected %d' % (len(outlinePseudoTree), len(expected)))
return
for (counter, (expected_item, found_item)) in enumerate(zip(expected, outlinePseudoTree)):
if expectedItem != foundItem:
test.fail("Mismatch in element number %d for '%s'" % (counter + 1, fileName), '%s != %s' % (str(expectedItem), str(foundItem)))
return
test.passes("All nodes (%d) inside outline match expected nodes for '%s'." % (len(expected), fileName)) |
def extra_end(str):
if len(str) <= 2:
return (str * 3)
return (str[-2:]*3)
| def extra_end(str):
if len(str) <= 2:
return str * 3
return str[-2:] * 3 |
class Obstacle(object):
def __init__(self, position):
self.position = position
self.positionHistory = [position]
self.ObstaclePotentialForces = [] | class Obstacle(object):
def __init__(self, position):
self.position = position
self.positionHistory = [position]
self.ObstaclePotentialForces = [] |
#
# PySNMP MIB module CISCO-UNIFIED-COMPUTING-LLDP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-UNIFIED-COMPUTING-LLDP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:16:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
CiscoNetworkAddress, CiscoAlarmSeverity, CiscoInetAddressMask, Unsigned64, TimeIntervalSec = mibBuilder.importSymbols("CISCO-TC", "CiscoNetworkAddress", "CiscoAlarmSeverity", "CiscoInetAddressMask", "Unsigned64", "TimeIntervalSec")
ciscoUnifiedComputingMIBObjects, CucsManagedObjectDn, CucsManagedObjectId = mibBuilder.importSymbols("CISCO-UNIFIED-COMPUTING-MIB", "ciscoUnifiedComputingMIBObjects", "CucsManagedObjectDn", "CucsManagedObjectId")
InetAddressIPv6, InetAddressIPv4 = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv6", "InetAddressIPv4")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, ModuleIdentity, Unsigned32, Bits, ObjectIdentity, Counter64, MibIdentifier, TimeTicks, iso, IpAddress, Integer32, Gauge32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "ModuleIdentity", "Unsigned32", "Bits", "ObjectIdentity", "Counter64", "MibIdentifier", "TimeTicks", "iso", "IpAddress", "Integer32", "Gauge32", "Counter32")
RowPointer, TimeInterval, TimeStamp, TruthValue, MacAddress, DisplayString, TextualConvention, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "RowPointer", "TimeInterval", "TimeStamp", "TruthValue", "MacAddress", "DisplayString", "TextualConvention", "DateAndTime")
cucsLldpObjects = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58))
if mibBuilder.loadTexts: cucsLldpObjects.setLastUpdated('201601180000Z')
if mibBuilder.loadTexts: cucsLldpObjects.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts: cucsLldpObjects.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553 -NETS E-mail: cs-san@cisco.com, cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts: cucsLldpObjects.setDescription('MIB representation of the Cisco Unified Computing System LLDP management information model package')
cucsLldpAcquiredTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1), )
if mibBuilder.loadTexts: cucsLldpAcquiredTable.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredTable.setDescription('Cisco UCS lldp:Acquired managed object table')
cucsLldpAcquiredEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-LLDP-MIB", "cucsLldpAcquiredInstanceId"))
if mibBuilder.loadTexts: cucsLldpAcquiredEntry.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredEntry.setDescription('Entry for the cucsLldpAcquiredTable table.')
cucsLldpAcquiredInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsLldpAcquiredInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredInstanceId.setDescription('Instance identifier of the managed object.')
cucsLldpAcquiredDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredDn.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredDn.setDescription('Cisco UCS lldp:Acquired:dn managed object property')
cucsLldpAcquiredRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredRn.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredRn.setDescription('Cisco UCS lldp:Acquired:rn managed object property')
cucsLldpAcquiredAcqts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 4), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredAcqts.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredAcqts.setDescription('Cisco UCS lldp:Acquired:acqts managed object property')
cucsLldpAcquiredChassisMac = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 5), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredChassisMac.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredChassisMac.setDescription('Cisco UCS lldp:Acquired:chassisMac managed object property')
cucsLldpAcquiredPeerDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredPeerDn.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredPeerDn.setDescription('Cisco UCS lldp:Acquired:peerDn managed object property')
cucsLldpAcquiredPortMac = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 7), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsLldpAcquiredPortMac.setStatus('current')
if mibBuilder.loadTexts: cucsLldpAcquiredPortMac.setDescription('Cisco UCS lldp:Acquired:portMac managed object property')
mibBuilder.exportSymbols("CISCO-UNIFIED-COMPUTING-LLDP-MIB", cucsLldpObjects=cucsLldpObjects, cucsLldpAcquiredAcqts=cucsLldpAcquiredAcqts, cucsLldpAcquiredTable=cucsLldpAcquiredTable, cucsLldpAcquiredPeerDn=cucsLldpAcquiredPeerDn, cucsLldpAcquiredEntry=cucsLldpAcquiredEntry, cucsLldpAcquiredPortMac=cucsLldpAcquiredPortMac, cucsLldpAcquiredInstanceId=cucsLldpAcquiredInstanceId, PYSNMP_MODULE_ID=cucsLldpObjects, cucsLldpAcquiredRn=cucsLldpAcquiredRn, cucsLldpAcquiredDn=cucsLldpAcquiredDn, cucsLldpAcquiredChassisMac=cucsLldpAcquiredChassisMac)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, single_value_constraint, constraints_intersection, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(cisco_network_address, cisco_alarm_severity, cisco_inet_address_mask, unsigned64, time_interval_sec) = mibBuilder.importSymbols('CISCO-TC', 'CiscoNetworkAddress', 'CiscoAlarmSeverity', 'CiscoInetAddressMask', 'Unsigned64', 'TimeIntervalSec')
(cisco_unified_computing_mib_objects, cucs_managed_object_dn, cucs_managed_object_id) = mibBuilder.importSymbols('CISCO-UNIFIED-COMPUTING-MIB', 'ciscoUnifiedComputingMIBObjects', 'CucsManagedObjectDn', 'CucsManagedObjectId')
(inet_address_i_pv6, inet_address_i_pv4) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressIPv6', 'InetAddressIPv4')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, module_identity, unsigned32, bits, object_identity, counter64, mib_identifier, time_ticks, iso, ip_address, integer32, gauge32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'ModuleIdentity', 'Unsigned32', 'Bits', 'ObjectIdentity', 'Counter64', 'MibIdentifier', 'TimeTicks', 'iso', 'IpAddress', 'Integer32', 'Gauge32', 'Counter32')
(row_pointer, time_interval, time_stamp, truth_value, mac_address, display_string, textual_convention, date_and_time) = mibBuilder.importSymbols('SNMPv2-TC', 'RowPointer', 'TimeInterval', 'TimeStamp', 'TruthValue', 'MacAddress', 'DisplayString', 'TextualConvention', 'DateAndTime')
cucs_lldp_objects = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58))
if mibBuilder.loadTexts:
cucsLldpObjects.setLastUpdated('201601180000Z')
if mibBuilder.loadTexts:
cucsLldpObjects.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts:
cucsLldpObjects.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553 -NETS E-mail: cs-san@cisco.com, cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts:
cucsLldpObjects.setDescription('MIB representation of the Cisco Unified Computing System LLDP management information model package')
cucs_lldp_acquired_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1))
if mibBuilder.loadTexts:
cucsLldpAcquiredTable.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredTable.setDescription('Cisco UCS lldp:Acquired managed object table')
cucs_lldp_acquired_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-LLDP-MIB', 'cucsLldpAcquiredInstanceId'))
if mibBuilder.loadTexts:
cucsLldpAcquiredEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredEntry.setDescription('Entry for the cucsLldpAcquiredTable table.')
cucs_lldp_acquired_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsLldpAcquiredInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredInstanceId.setDescription('Instance identifier of the managed object.')
cucs_lldp_acquired_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredDn.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredDn.setDescription('Cisco UCS lldp:Acquired:dn managed object property')
cucs_lldp_acquired_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredRn.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredRn.setDescription('Cisco UCS lldp:Acquired:rn managed object property')
cucs_lldp_acquired_acqts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 4), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredAcqts.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredAcqts.setDescription('Cisco UCS lldp:Acquired:acqts managed object property')
cucs_lldp_acquired_chassis_mac = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 5), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredChassisMac.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredChassisMac.setDescription('Cisco UCS lldp:Acquired:chassisMac managed object property')
cucs_lldp_acquired_peer_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredPeerDn.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredPeerDn.setDescription('Cisco UCS lldp:Acquired:peerDn managed object property')
cucs_lldp_acquired_port_mac = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 58, 1, 1, 7), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsLldpAcquiredPortMac.setStatus('current')
if mibBuilder.loadTexts:
cucsLldpAcquiredPortMac.setDescription('Cisco UCS lldp:Acquired:portMac managed object property')
mibBuilder.exportSymbols('CISCO-UNIFIED-COMPUTING-LLDP-MIB', cucsLldpObjects=cucsLldpObjects, cucsLldpAcquiredAcqts=cucsLldpAcquiredAcqts, cucsLldpAcquiredTable=cucsLldpAcquiredTable, cucsLldpAcquiredPeerDn=cucsLldpAcquiredPeerDn, cucsLldpAcquiredEntry=cucsLldpAcquiredEntry, cucsLldpAcquiredPortMac=cucsLldpAcquiredPortMac, cucsLldpAcquiredInstanceId=cucsLldpAcquiredInstanceId, PYSNMP_MODULE_ID=cucsLldpObjects, cucsLldpAcquiredRn=cucsLldpAcquiredRn, cucsLldpAcquiredDn=cucsLldpAcquiredDn, cucsLldpAcquiredChassisMac=cucsLldpAcquiredChassisMac) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# input
input_data = []
with open('input.txt', 'r') as f:
lines = f.readlines()
input_data = [l.strip().split(')') for l in lines]
# structures
orbits_down = dict(zip([inp[1] for inp in input_data], [inp[0] for inp in input_data]))
# task 1
total = 0
all_centers = orbits_down.values()
for center, satellite in orbits_down.items():
current = 0
current += satellite not in all_centers
next_center = center
while next_center != 'COM':
current += 1
next_center = orbits_down[next_center]
total += current
print(total)
# task 2
def track(satellite):
trace = []
center = orbits_down[satellite]
while center != 'COM':
trace.append(center)
center = orbits_down[center]
return trace
trace_you = track('YOU')
trace_san = track('SAN')
last_common = 'COM'
while True:
if trace_you[-1] == trace_san[-1]:
last_common = trace_san[-1]
trace_you.pop()
trace_san.pop()
else:
break
print(len(trace_you) + len(trace_san)) | input_data = []
with open('input.txt', 'r') as f:
lines = f.readlines()
input_data = [l.strip().split(')') for l in lines]
orbits_down = dict(zip([inp[1] for inp in input_data], [inp[0] for inp in input_data]))
total = 0
all_centers = orbits_down.values()
for (center, satellite) in orbits_down.items():
current = 0
current += satellite not in all_centers
next_center = center
while next_center != 'COM':
current += 1
next_center = orbits_down[next_center]
total += current
print(total)
def track(satellite):
trace = []
center = orbits_down[satellite]
while center != 'COM':
trace.append(center)
center = orbits_down[center]
return trace
trace_you = track('YOU')
trace_san = track('SAN')
last_common = 'COM'
while True:
if trace_you[-1] == trace_san[-1]:
last_common = trace_san[-1]
trace_you.pop()
trace_san.pop()
else:
break
print(len(trace_you) + len(trace_san)) |
def Num14681():
x = int(input())
y = int(input())
result = 0
if x > 0:
if y > 0:
result = 1
else:
result = 4
else:
if y < 0:
result = 3
else:
result = 2
print(str(result))
Num14681() | def num14681():
x = int(input())
y = int(input())
result = 0
if x > 0:
if y > 0:
result = 1
else:
result = 4
elif y < 0:
result = 3
else:
result = 2
print(str(result))
num14681() |
#Given an array of integers, find the one that appears an odd number of times.
#There will always be only one integer that appears an odd number of times.
def find_it(arr):
res = 0
for element in arr:
res = res ^ element
return res
| def find_it(arr):
res = 0
for element in arr:
res = res ^ element
return res |
__author__ = 'samantha'
def checkio(words):
#l = list()
#for word in words.split():
# l.append(word.isalpha())
print(words)
res = False
l = [wd.isalpha() for wd in words.split()]
#r = [l[i:i+3] for i in range(0,len(l)-3) ]
#print ('r=',r)
print ('l=',l)
if len(l)>3:
print ('len(l)=', len(l))
print('range', range(0,len(l)-2))
for i in range(0,(len(l)-2)):
print ('i=', i)
l2 = l[i:i+3]
print('l2=', l2)
res = all(x == True for x in l2)
print ('res=', res)
elif len(l) == 3:
res = all(x == True for x in l)
return res
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio("Hello World hello") == True, "Hello"
assert checkio("He is 123 man") == False, "123 man"
assert checkio("1 2 3 4") == False, "Digits"
assert checkio("bla bla bla bla") == True, "Bla Bla"
assert checkio("Hi") == False, "Hi"
assert checkio("0 qwerty iddqd asdfg") == True, "0 qwert"
| __author__ = 'samantha'
def checkio(words):
print(words)
res = False
l = [wd.isalpha() for wd in words.split()]
print('l=', l)
if len(l) > 3:
print('len(l)=', len(l))
print('range', range(0, len(l) - 2))
for i in range(0, len(l) - 2):
print('i=', i)
l2 = l[i:i + 3]
print('l2=', l2)
res = all((x == True for x in l2))
print('res=', res)
elif len(l) == 3:
res = all((x == True for x in l))
return res
if __name__ == '__main__':
assert checkio('Hello World hello') == True, 'Hello'
assert checkio('He is 123 man') == False, '123 man'
assert checkio('1 2 3 4') == False, 'Digits'
assert checkio('bla bla bla bla') == True, 'Bla Bla'
assert checkio('Hi') == False, 'Hi'
assert checkio('0 qwerty iddqd asdfg') == True, '0 qwert' |
class FrontendPortTotalThroughput(object):
def read_get(self, name, idx_name, unity_client):
return unity_client.get_frontend_port_total_iops(idx_name)
class FrontendPortTotalThroughputColumn(object):
def get_idx(self, name, idx, unity_client):
return unity_client.get_frontend_ports()
| class Frontendporttotalthroughput(object):
def read_get(self, name, idx_name, unity_client):
return unity_client.get_frontend_port_total_iops(idx_name)
class Frontendporttotalthroughputcolumn(object):
def get_idx(self, name, idx, unity_client):
return unity_client.get_frontend_ports() |
DEBUG = True
MOLLIE_API_KEY = ''
REDIS_HOST = 'localhost'
COOKIE_NAME = 'Paywall-Voucher'
CSRF_SECRET_KEY = 'NeVeR WoUnD a SnAke KiLl It'
| debug = True
mollie_api_key = ''
redis_host = 'localhost'
cookie_name = 'Paywall-Voucher'
csrf_secret_key = 'NeVeR WoUnD a SnAke KiLl It' |
# Copyright 2017 Rice University
#
# 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.
LABELS = ['swing', 'awt', 'security', 'sql', 'net', 'xml', 'crypto', 'math']
def get_api(config, calls, apiOrNot):
apis = []
for call, api_bool in zip(calls, apiOrNot):
if api_bool and call > 0:
api = config.vocab.chars_api[call]
apis.append(api)
apis_ = []
for api in apis:
try:
api_mid = api.split('.')[1]
except:
api_mid = []
apis_.append(api_mid)
guard = []
for api in apis_:
if api in LABELS:
label = api
guard.append(label)
if len(set(guard)) != 1:
return 'N/A'
else:
return guard[0]
| labels = ['swing', 'awt', 'security', 'sql', 'net', 'xml', 'crypto', 'math']
def get_api(config, calls, apiOrNot):
apis = []
for (call, api_bool) in zip(calls, apiOrNot):
if api_bool and call > 0:
api = config.vocab.chars_api[call]
apis.append(api)
apis_ = []
for api in apis:
try:
api_mid = api.split('.')[1]
except:
api_mid = []
apis_.append(api_mid)
guard = []
for api in apis_:
if api in LABELS:
label = api
guard.append(label)
if len(set(guard)) != 1:
return 'N/A'
else:
return guard[0] |
__all__ = ['VERSION']
VERSION = '7.6.0'
SAVE_PATH = '~/.spotifydl'
SPOTIPY_CLIENT_ID = "4fe3fecfe5334023a1472516cc99d805"
SPOTIPY_CLIENT_SECRET = "0f02b7c483c04257984695007a4a8d5c"
| __all__ = ['VERSION']
version = '7.6.0'
save_path = '~/.spotifydl'
spotipy_client_id = '4fe3fecfe5334023a1472516cc99d805'
spotipy_client_secret = '0f02b7c483c04257984695007a4a8d5c' |
#!/usr/bin/env python3
print("Hello Inderpal Singh!")
print("Welcome to python scripting.")
print("Learning python opens new doors of opportunity.")
| print('Hello Inderpal Singh!')
print('Welcome to python scripting.')
print('Learning python opens new doors of opportunity.') |
while True:
try:
bil = input("masukan bilangan: ")
bil = int(bil)
break
except ValueError:
print("anda salah memasukan bilangan")
print("anda memasukan bilangan %s, data harus angka" % bil )
print("anda memasukan bilangan", bil) | while True:
try:
bil = input('masukan bilangan: ')
bil = int(bil)
break
except ValueError:
print('anda salah memasukan bilangan')
print('anda memasukan bilangan %s, data harus angka' % bil)
print('anda memasukan bilangan', bil) |
# Comma Code
# Say you have a list value like this:
# spam = ['apples', 'bananas', 'tofu', 'cats']
# Write a function that takes a list value as an argument and returns a string wit
# h all the items separated by a comma and a space, with and inserted before the l
# ast item. For example, passing the previous spam list to the function would retu
# rn 'apples, bananas, tofu, and cats'. But your function should be able to work w
# ith any list value passed to it. Be sure to test the case where an empty list []
# is passed to your function.
spam = ['apples', 'bananas', 'tofu', 'cats']
def comma_code(l):
if (len(l) <= 0):
return ""
elif (len(l) == 1):
return l[0]
else:
return ', '.join(l[:-1]) + " and " + l[-1]
print(comma_code(spam)) | spam = ['apples', 'bananas', 'tofu', 'cats']
def comma_code(l):
if len(l) <= 0:
return ''
elif len(l) == 1:
return l[0]
else:
return ', '.join(l[:-1]) + ' and ' + l[-1]
print(comma_code(spam)) |
a = [1, 0, 5, -2, -5, 7]
soma = a[0] + a[1] + a[5]
print(soma)
a[4] = 100
print(a)
for v in a:
print(v)
| a = [1, 0, 5, -2, -5, 7]
soma = a[0] + a[1] + a[5]
print(soma)
a[4] = 100
print(a)
for v in a:
print(v) |
sums_new_methodology = {
"Total revenue": {
"A01",
"A03",
"A09",
"A10",
"A12",
"A16",
"A18",
"A21",
"A36",
"A44",
"A45",
"A50",
"A54",
"A56",
"A59",
"A60",
"A61",
"A80",
"A81",
"A87",
"A89",
"A90",
"A91",
"A92",
"A93",
"A94",
"B01",
"B21",
"B22",
"B30",
"B42",
"B43",
"B46",
"B50",
"B54",
"B59",
"B79",
"B80",
"B89",
"B91",
"B92",
"B93",
"B94",
"D21",
"D30",
"D42",
"D46",
"D50",
"D79",
"D80",
"D89",
"D91",
"D92",
"D93",
"D94",
"T01",
"T09",
"T10",
"T11",
"T12",
"T13",
"T14",
"T15",
"T16",
"T19",
"T20",
"T21",
"T22",
"T23",
"T24",
"T25",
"T27",
"T28",
"T29",
"T40",
"T41",
"T50",
"T51",
"T53",
"T99",
"U01",
"U11",
"U20",
"U21",
"U30",
"U40",
"U41",
"U50",
"U95",
"U99",
"X01",
"X02",
"X05",
"X08",
"Y01",
"Y02",
"Y04",
"Y11",
"Y12",
"Y51",
"Y52",
},
"General revenue": {
"A01",
"A03",
"A09",
"A10",
"A12",
"A16",
"A18",
"A21",
"A36",
"A44",
"A45",
"A50",
"A54",
"A56",
"A59",
"A60",
"A61",
"A80",
"A81",
"A87",
"A89",
"B01",
"B21",
"B22",
"B30",
"B42",
"B43",
"B46",
"B50",
"B54",
"B59",
"B79",
"B80",
"B89",
"B91",
"B92",
"B93",
"B94",
"D21",
"D30",
"D42",
"D46",
"D50",
"D79",
"D80",
"D89",
"D91",
"D92",
"D93",
"D94",
"T01",
"T09",
"T10",
"T11",
"T12",
"T13",
"T14",
"T15",
"T16",
"T19",
"T20",
"T21",
"T22",
"T23",
"T24",
"T25",
"T27",
"T28",
"T29",
"T40",
"T41",
"T50",
"T51",
"T53",
"T99",
"U01",
"U11",
"U20",
"U21",
"U30",
"U40",
"U41",
"U50",
"U95",
"U99",
},
"Intergovernmental revenue": {
"B01",
"B21",
"B22",
"B30",
"B42",
"B43",
"B46",
"B50",
"B54",
"B59",
"B79",
"B80",
"B89",
"B91",
"B92",
"B93",
"B94",
"D21",
"D30",
"D42",
"D46",
"D50",
"D79",
"D80",
"D89",
"D91",
"D92",
"D93",
"D94",
},
"Taxes": {
"T01",
"T09",
"T10",
"T11",
"T12",
"T13",
"T14",
"T15",
"T16",
"T19",
"T20",
"T21",
"T22",
"T23",
"T24",
"T25",
"T27",
"T28",
"T29",
"T40",
"T41",
"T50",
"T51",
"T53",
"T99",
},
"General sales": {"T09"},
"Selective sales": {"T10", "T11", "T12", "T13", "T14", "T15", "T16", "T19"},
"License taxes": {"T20", "T21", "T22", "T23", "T24", "T25", "T27", "T28", "T29"},
"Individual income tax": {"T40"},
"Corporate income tax": {"T41"},
"Other taxes": {"T01", "T50", "T51", "T53", "T99"},
"Current charge": {
"A01",
"A03",
"A09",
"A10",
"A12",
"A16",
"A18",
"A21",
"A36",
"A44",
"A45",
"A50",
"A54",
"A56",
"A59",
"A60",
"A61",
"A80",
"A81",
"A87",
"A89",
},
"Miscellaneous general revenue": {
"U01",
"U11",
"U20",
"U21",
"U30",
"U40",
"U41",
"U50",
"U95",
"U99",
},
"Utility revenue": {"A91", "A92", "A93", "A94"},
"Liquor stores revenue": {"A90"},
"Insurance trust revenue": {
"X01",
"X02",
"X05",
"X08",
"Y01",
"Y02",
"Y04",
"Y11",
"Y12",
"Y50",
"Y51",
"Y52",
},
"Total expenditure": {
"E01",
"E03",
"E04",
"E05",
"E12",
"E16",
"E18",
"E21",
"E22",
"E23",
"E25",
"E26",
"E27",
"E29",
"E31",
"E32",
"E36",
"E44",
"E45",
"E50",
"E52",
"E54",
"E55",
"E56",
"E59",
"E60",
"E61",
"E62",
"E66",
"E74",
"E75",
"E77",
"E79",
"E80",
"E81",
"E85",
"E87",
"E89",
"E90",
"E91",
"E92",
"E93",
"E94",
"F01",
"F03",
"F04",
"F05",
"F12",
"F16",
"F18",
"F21",
"F22",
"F23",
"F25",
"F26",
"F27",
"F29",
"F31",
"F32",
"F36",
"F44",
"F45",
"F50",
"F52",
"F54",
"F55",
"F56",
"F59",
"F60",
"F61",
"F62",
"F66",
"F77",
"F79",
"F80",
"F81",
"F85",
"F87",
"F89",
"F90",
"F91",
"F92",
"F93",
"F94",
"G01",
"G03",
"G04",
"G05",
"G12",
"G16",
"G18",
"G21",
"G22",
"G23",
"G25",
"G26",
"G27",
"G29",
"G31",
"G32",
"G36",
"G44",
"G45",
"G50",
"G52",
"G54",
"G55",
"G56",
"G59",
"G60",
"G61",
"G62",
"G66",
"G77",
"G79",
"G80",
"G81",
"G85",
"G87",
"G89",
"G90",
"G91",
"G92",
"G93",
"G94",
"I89",
"I91",
"I92",
"I93",
"I94",
"J19",
"J67",
"J68",
"J85",
"M01",
"M04",
"M05",
"M12",
"M18",
"M21",
"M23",
"M25",
"M27",
"M29",
"M30",
"M32",
"M36",
"M44",
"M50",
"M52",
"M54",
"M55",
"M56",
"M59",
"M60",
"M61",
"M62",
"M66",
"M67",
"M68",
"M79",
"M80",
"M81",
"M87",
"M89",
"M91",
"M92",
"M93",
"M94",
"Q12",
"Q18",
"S67",
"S89",
"X11",
"X12",
"Y05",
"Y06",
"Y14",
"Y53",
},
"Intergovernmental expenditure": {
"M01",
"M04",
"M05",
"M12",
"M18",
"M21",
"M23",
"M25",
"M27",
"M29",
"M30",
"M32",
"M36",
"M44",
"M50",
"M52",
"M54",
"M55",
"M56",
"M59",
"M60",
"M61",
"M62",
"M66",
"M67",
"M68",
"M79",
"M80",
"M81",
"M87",
"M89",
"M91",
"M92",
"M93",
"M94",
"Q12",
"Q18",
"S67",
"S89",
},
"Direct expenditure": {
"E01",
"E03",
"E04",
"E05",
"E12",
"E16",
"E18",
"E21",
"E22",
"E23",
"E25",
"E26",
"E27",
"E29",
"E31",
"E32",
"E36",
"E44",
"E45",
"E50",
"E52",
"E54",
"E55",
"E56",
"E59",
"E60",
"E61",
"E62",
"E66",
"E74",
"E75",
"E77",
"E79",
"E80",
"E81",
"E85",
"E87",
"E89",
"E90",
"E91",
"E92",
"E93",
"E94",
"F01",
"F03",
"F04",
"F05",
"F12",
"F16",
"F18",
"F21",
"F22",
"F23",
"F25",
"F26",
"F27",
"F29",
"F31",
"F32",
"F36",
"F44",
"F45",
"F50",
"F52",
"F54",
"F55",
"F56",
"F59",
"F60",
"F61",
"F62",
"F66",
"F77",
"F79",
"F80",
"F81",
"F85",
"F87",
"F89",
"F90",
"F91",
"F92",
"F93",
"F94",
"G01",
"G03",
"G04",
"G05",
"G12",
"G16",
"G18",
"G21",
"G22",
"G23",
"G25",
"G26",
"G27",
"G29",
"G31",
"G32",
"G36",
"G44",
"G45",
"G50",
"G52",
"G54",
"G55",
"G56",
"G59",
"G60",
"G61",
"G62",
"G66",
"G77",
"G79",
"G80",
"G81",
"G85",
"G87",
"G89",
"G90",
"G91",
"G92",
"G93",
"G94",
"I89",
"I91",
"I92",
"I93",
"I94",
"J19",
"J67",
"J68",
"J85",
"X11",
"X12",
"Y05",
"Y06",
"Y14",
"Y53",
},
"Current operation": {
"E01",
"E03",
"E04",
"E05",
"E12",
"E16",
"E18",
"E21",
"E22",
"E23",
"E25",
"E26",
"E27",
"E29",
"E31",
"E32",
"E36",
"E44",
"E45",
"E50",
"E52",
"E54",
"E55",
"E56",
"E59",
"E60",
"E61",
"E62",
"E66",
"E74",
"E75",
"E77",
"E79",
"E80",
"E81",
"E85",
"E87",
"E89",
"E90",
"E91",
"E92",
"E93",
"E94",
},
"Capital outlay": {
"F01",
"F03",
"F04",
"F05",
"F12",
"F16",
"F18",
"F21",
"F22",
"F23",
"F25",
"F26",
"F27",
"F29",
"F31",
"F32",
"F36",
"F44",
"F45",
"F50",
"F52",
"F54",
"F55",
"F56",
"F59",
"F60",
"F61",
"F62",
"F66",
"F77",
"F79",
"F80",
"F81",
"F85",
"F87",
"F89",
"F90",
"F91",
"F92",
"F93",
"F94",
"G01",
"G03",
"G04",
"G05",
"G12",
"G16",
"G18",
"G21",
"G22",
"G23",
"G25",
"G26",
"G27",
"G29",
"G31",
"G32",
"G36",
"G44",
"G45",
"G50",
"G52",
"G54",
"G55",
"G56",
"G59",
"G60",
"G61",
"G62",
"G66",
"G77",
"G79",
"G80",
"G81",
"G85",
"G87",
"G89",
"G90",
"G91",
"G92",
"G93",
"G94",
},
"Insurance benefits and repayments": {"X11", "X12", "Y05", "Y06", "Y14", "Y53",},
"Assistance and subsidies": {"J19", "J67", "J68", "J85"},
"Interest on debt": {"I89", "I91", "I92", "I93", "I94"},
"Exhibit: Salaries and wages": {"Z00"},
"General expenditure": {
"E01",
"E03",
"E04",
"E05",
"E12",
"E16",
"E18",
"E21",
"E22",
"E23",
"E25",
"E26",
"E27",
"E29",
"E31",
"E32",
"E36",
"E44",
"E45",
"E50",
"E52",
"E54",
"E55",
"E56",
"E59",
"E60",
"E61",
"E62",
"E66",
"E74",
"E75",
"E77",
"E79",
"E80",
"E81",
"E85",
"E87",
"E89",
"F01",
"F03",
"F04",
"F05",
"F12",
"F16",
"F18",
"F21",
"F22",
"F23",
"F25",
"F26",
"F27",
"F29",
"F31",
"F32",
"F36",
"F44",
"F45",
"F50",
"F52",
"F54",
"F55",
"F56",
"F59",
"F60",
"F61",
"F62",
"F66",
"F77",
"F79",
"F80",
"F81",
"F85",
"F87",
"F89",
"G01",
"G03",
"G04",
"G05",
"G12",
"G16",
"G18",
"G21",
"G22",
"G23",
"G25",
"G26",
"G27",
"G29",
"G31",
"G32",
"G36",
"G44",
"G45",
"G50",
"G52",
"G54",
"G55",
"G56",
"G59",
"G60",
"G61",
"G62",
"G66",
"G77",
"G79",
"G80",
"G81",
"G85",
"G87",
"G89",
"I89",
"J19",
"J67",
"J68",
"J85",
"M01",
"M04",
"M05",
"M12",
"M18",
"M21",
"M23",
"M25",
"M27",
"M29",
"M30",
"M32",
"M36",
"M44",
"M50",
"M52",
"M54",
"M55",
"M56",
"M59",
"M60",
"M61",
"M62",
"M66",
"M67",
"M68",
"M79",
"M80",
"M81",
"M87",
"M89",
"M91",
"M92",
"M93",
"M94",
"Q12",
"Q18",
"S67",
"S89",
},
"Direct general expenditure": {
"E01",
"E03",
"E04",
"E05",
"E12",
"E16",
"E18",
"E21",
"E22",
"E23",
"E25",
"E26",
"E27",
"E29",
"E31",
"E32",
"E36",
"E44",
"E45",
"E50",
"E52",
"E54",
"E55",
"E56",
"E59",
"E60",
"E61",
"E62",
"E66",
"E74",
"E75",
"E77",
"E79",
"E80",
"E81",
"E85",
"E87",
"E89",
"F01",
"F03",
"F04",
"F05",
"F12",
"F16",
"F18",
"F21",
"F22",
"F23",
"F25",
"F26",
"F27",
"F29",
"F31",
"F32",
"F36",
"F44",
"F45",
"F50",
"F52",
"F54",
"F55",
"F56",
"F59",
"F60",
"F61",
"F62",
"F66",
"F77",
"F79",
"F80",
"F81",
"F85",
"F87",
"F89",
"G01",
"G03",
"G04",
"G05",
"G12",
"G16",
"G18",
"G21",
"G22",
"G23",
"G25",
"G26",
"G27",
"G29",
"G31",
"G32",
"G36",
"G44",
"G45",
"G50",
"G52",
"G54",
"G55",
"G56",
"G59",
"G60",
"G61",
"G62",
"G66",
"G77",
"G79",
"G80",
"G81",
"G85",
"G87",
"G89",
"I89",
"J19",
"J67",
"J68",
"J85",
},
"Education": {
"E12",
"E16",
"E18",
"E21",
"F12",
"F16",
"F18",
"F21",
"G12",
"G16",
"G18",
"G21",
"J19",
"M12",
"M18",
"M21",
"Q12",
"Q18",
},
"Public welfare": {
"E74",
"E75",
"E77",
"E79",
"F77",
"F79",
"G77",
"G79",
"J67",
"J68",
"M67",
"M68",
"M79",
"S67",
},
"Hospitals": {"E36", "F36", "G36", "M36"},
"Health": {"E32", "F32", "G32", "M32"},
"Highways": {"E44", "M44", "F44", "G44", "E45", "F45", "G45"},
"Police protection": {"E62", "F62", "G62", "M62"},
"Correction": {"E04", "E05", "F04", "F05", "G04", "G05", "M04", "M05",},
"Natural resources": {
"E54",
"E55",
"E56",
"E59",
"F54",
"F55",
"F56",
"F59",
"G54",
"G55",
"G56",
"G59",
"M54",
"M55",
"M56",
"M59",
},
"Parks and recreation": {"E61", "F61", "G61", "M61"},
"Governmental administration": {
"E23",
"E25",
"E26",
"E29",
"E31",
"F23",
"F25",
"F26",
"F29",
"F31",
"G23",
"G25",
"G26",
"G29",
"G31",
"M23",
"M25",
"M29",
},
"Interest on general debt": {"I89"},
"Other and unallocable": {
"E01",
"E03",
"E22",
"E50",
"E52",
"E60",
"E66",
"E80",
"E81",
"E85",
"E87",
"E89",
"F01",
"F03",
"F22",
"F50",
"F52",
"F60",
"F66",
"F80",
"F81",
"F85",
"F87",
"F89",
"G01",
"G03",
"G22",
"G50",
"G52",
"G60",
"G66",
"G80",
"G81",
"G85",
"G87",
"G89",
"M01",
"M50",
"M52",
"M60",
"M66",
"M80",
"M81",
"M87",
"M89",
"S89",
},
"Utility expenditure": {
"E91",
"E92",
"E93",
"E94",
"F91",
"F92",
"F93",
"F94",
"G91",
"G92",
"G93",
"G94",
"I91",
"I92",
"I93",
"I94",
"M91",
"M92",
"M93",
"M94",
},
"Liquor stores expenditure": {"E90", "F90", "G90"},
"Insurance trust expenditure": {"X11", "X12", "Y05", "Y06", "Y14", "Y53",},
"Debt at end of fiscal year": {"64V", "44T", "49U"},
"Cash and security holdings": {
"W01",
"W31",
"W61",
"X21",
"X30",
"X42",
"X44",
"X47",
"Y07",
"Y08",
"Y21",
"Y61",
"Z77",
"Z78",
},
}
# sums_1992_2004 = {
# "Total revenue": {
# "T01",
# "T08",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A06",
# "A09",
# "A10",
# "A12",
# "A14",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U10",
# "U11",
# "U20",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# "B01",
# "B21",
# "B22",
# "B27",
# "B30",
# "B42",
# "B46",
# "B47",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "C21",
# "C28",
# "C30",
# "C42",
# "C46",
# "C47",
# "C50",
# "C67",
# "C79",
# "C80",
# "C89",
# "C91",
# "C92",
# "C93",
# "C94",
# "D11",
# "D21",
# "D30",
# "D42",
# "D46",
# "D47",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# "A91",
# "A92",
# "A93",
# "A94",
# "A90",
# "X01",
# "X02",
# "X05",
# "X08",
# "X09",
# "X03",
# "Y01",
# "Y02",
# "Y03",
# "Y04",
# "Y11",
# "Y12",
# "Y13",
# "Y51",
# "Y52",
# "Y20",
# "Y31",
# "Y41",
# "Y55",
# },
# "General revenue": {
# "T01",
# "T08",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A06",
# "A09",
# "A10",
# "A12",
# "A14",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U10",
# "U11",
# "U20",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# "B01",
# "B21",
# "B22",
# "B27",
# "B30",
# "B42",
# "B46",
# "B47",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "C21",
# "C28",
# "C30",
# "C42",
# "C46",
# "C47",
# "C50",
# "C67",
# "C79",
# "C80",
# "C89",
# "C91",
# "C92",
# "C93",
# "C94",
# "D11",
# "D21",
# "D30",
# "D42",
# "D46",
# "D47",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# },
# "Intergovernmental revenue": {
# "B01",
# "B21",
# "B22",
# "B27",
# "B30",
# "B42",
# "B46",
# "B47",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "C21",
# "C28",
# "C30",
# "C42",
# "C46",
# "C47",
# "C50",
# "C67",
# "C79",
# "C80",
# "C89",
# "C91",
# "C92",
# "C93",
# "C94",
# "D11",
# "D21",
# "D30",
# "D42",
# "D46",
# "D47",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# },
# "Taxes": {
# "T01",
# "T08",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# },
# "General sales": {"T09",},
# "Selective sales": {"T10", "T11", "T12", "T13", "T14", "T15", "T16", "T19"},
# "License taxes": {"T20", "T21", "T22", "T23", "T24", "T25", "T27", "T28", "T29",},
# "Individual income tax": {"T40"},
# "Corporate income tax": {"T41"},
# "Other taxes": {"T01", "T50", "T51", "T53", "T99"},
# "Current charge": {
# "A01",
# "A03",
# "A06",
# "A09",
# "A10",
# "A12",
# "A14",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# },
# "Miscellaneous general revenue": {
# "U01",
# "U10",
# "U11",
# "U20",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# },
# "Utility revenue": {"A91", "A92", "A93", "A94"},
# "Liquor stores revenue": {"A90"},
# "Insurance trust revenue": {
# "X01",
# "X02",
# "X05",
# "X08",
# "Y01",
# "Y02",
# "Y04",
# "Y10",
# "Y11",
# "Y12",
# "Y50",
# "Y51",
# "Y52",
# },
# "Total expenditure": {
# "E01",
# "F01",
# "G01",
# "I01",
# "L01",
# "M01",
# "N01",
# "O01",
# "P01",
# "R01",
# "E02",
# "F02",
# "G02",
# "I02",
# "L02",
# "M02",
# "E03",
# "F03",
# "G03",
# "E04",
# "F04",
# "G04",
# "I04",
# "L04",
# "M04",
# "E05",
# "F05",
# "G05",
# "L05",
# "M05",
# "N05",
# "O05",
# "P05",
# "S05",
# "E06",
# "F06",
# "G06",
# "I06",
# "L06",
# "M06",
# "E12",
# "F12",
# "G12",
# "L12",
# "M12",
# "N12",
# "O12",
# "P12",
# "Q12",
# "R12",
# "E14",
# "F14",
# "G14",
# "I14",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "L18",
# "M18",
# "N18",
# "O18",
# "P18",
# "Q18",
# "R18",
# "E19",
# "E20",
# "F20",
# "G20",
# "I20",
# "L20",
# "M20",
# "E21",
# "F21",
# "G21",
# "I21",
# "L21",
# "M21",
# "N21",
# "O21",
# "P21",
# "Q21",
# "S21",
# "E22",
# "F22",
# "G22",
# "I22",
# "L22",
# "M22",
# "E23",
# "F23",
# "G23",
# "I23",
# "L23",
# "M23",
# "N23",
# "O23",
# "P23",
# "E24",
# "F24",
# "G24",
# "L24",
# "M24",
# "N24",
# "O24",
# "P24",
# "R24",
# "E25",
# "F25",
# "G25",
# "I25",
# "L25",
# "M25",
# "N25",
# "O25",
# "P25",
# "S25",
# "E26",
# "F26",
# "G26",
# "E28",
# "F28",
# "G28",
# "I28",
# "L28",
# "M28",
# "E29",
# "F29",
# "G29",
# "I29",
# "L29",
# "M29",
# "N29",
# "O29",
# "P29",
# "M30",
# "N30",
# "O30",
# "P30",
# "R30",
# "E31",
# "F31",
# "G31",
# "E32",
# "F32",
# "G32",
# "I32",
# "L32",
# "M32",
# "N32",
# "O32",
# "P32",
# "R32",
# "E36",
# "F36",
# "G36",
# "E37",
# "F37",
# "G37",
# "I37",
# "L37",
# "M37",
# "E38",
# "F38",
# "G38",
# "I38",
# "L38",
# "M38",
# "N38",
# "O38",
# "P38",
# "R38",
# "E39",
# "F39",
# "G39",
# "I39",
# "L39",
# "M39",
# "E44",
# "F44",
# "G44",
# "I44",
# "L44",
# "M44",
# "N44",
# "O44",
# "P44",
# "R44",
# "E45",
# "F45",
# "G45",
# "E47",
# "I47",
# "L47",
# "M47",
# "N47",
# "O47",
# "P47",
# "R47",
# "E50",
# "F50",
# "G50",
# "I50",
# "L50",
# "M50",
# "N50",
# "O50",
# "P50",
# "R50",
# "E51",
# "I51",
# "L51",
# "M51",
# "E52",
# "F52",
# "G52",
# "I52",
# "L52",
# "M52",
# "N52",
# "O52",
# "P52",
# "R52",
# "E53",
# "F53",
# "G53",
# "I53",
# "L53",
# "M53",
# "E54",
# "F54",
# "G54",
# "I54",
# "L54",
# "M54",
# "N54",
# "O54",
# "P54",
# "R54",
# "E55",
# "F55",
# "G55",
# "M55",
# "N55",
# "O55",
# "P55",
# "R55",
# "E56",
# "F56",
# "G56",
# "I56",
# "L56",
# "M56",
# "N56",
# "O56",
# "P56",
# "R56",
# "E57",
# "F57",
# "G57",
# "I57",
# "L57",
# "M57",
# "E58",
# "F58",
# "G58",
# "I58",
# "L58",
# "M58",
# "E59",
# "F59",
# "G59",
# "I59",
# "L59",
# "M59",
# "N59",
# "O59",
# "P59",
# "R59",
# "S59",
# "E60",
# "F60",
# "G60",
# "I60",
# "L60",
# "M60",
# "N60",
# "O60",
# "P60",
# "R60",
# "E61",
# "F61",
# "G61",
# "I61",
# "L61",
# "M61",
# "N61",
# "O61",
# "P61",
# "R61",
# "E62",
# "F62",
# "G62",
# "I62",
# "L62",
# "M62",
# "N62",
# "O62",
# "P62",
# "R62",
# "E66",
# "F66",
# "G66",
# "I66",
# "L66",
# "M66",
# "N66",
# "O66",
# "P66",
# "R66",
# "E67",
# "I67",
# "L67",
# "M67",
# "N67",
# "O67",
# "P67",
# "S67",
# "E68",
# "I68",
# "M68",
# "N68",
# "O68",
# "P68",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "G79",
# "F79",
# "I79",
# "L79",
# "M79",
# "N79",
# "O79",
# "P79",
# "R79",
# "E80",
# "F80",
# "G80",
# "I80",
# "L80",
# "M80",
# "N80",
# "O80",
# "P80",
# "R80",
# "E81",
# "F81",
# "G81",
# "I81",
# "L81",
# "M81",
# "N81",
# "O81",
# "P81",
# "R81",
# "E84",
# "E85",
# "F85",
# "G85",
# "I85",
# "E87",
# "F87",
# "G87",
# "I87",
# "L87",
# "M87",
# "N87",
# "O87",
# "P87",
# "R87",
# "E89",
# "F89",
# "G89",
# "I89",
# "J89",
# "L89",
# "M89",
# "N89",
# "O89",
# "P89",
# "R89",
# "S89",
# "E90",
# "F90",
# "G90",
# "E91",
# "F91",
# "G91",
# "I91",
# "E92",
# "F92",
# "G92",
# "I92",
# "E93",
# "F93",
# "G93",
# "I93",
# "E94",
# "F94",
# "G94",
# "I94",
# "L91",
# "L92",
# "L93",
# "L94",
# "M91",
# "M92",
# "M93",
# "M94",
# "N91",
# "N92",
# "N93",
# "N94",
# "R91",
# "R92",
# "R93",
# "R94",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y53",
# "Y25",
# "Y34",
# "Y45",
# },
# "Intergovernmental expenditure": {
# "L01",
# "M01",
# "N01",
# "O01",
# "P01",
# "R01",
# "L02",
# "M02",
# "L04",
# "M04",
# "L05",
# "M05",
# "N05",
# "O05",
# "P05",
# "S05",
# "L06",
# "M06",
# "L12",
# "M12",
# "N12",
# "O12",
# "P12",
# "Q12",
# "R12",
# "L18",
# "M18",
# "N18",
# "O18",
# "P18",
# "Q18",
# "R18",
# "L20",
# "M20",
# "L21",
# "M21",
# "N21",
# "O21",
# "P21",
# "Q21",
# "S21",
# "L22",
# "M22",
# "L23",
# "M23",
# "N23",
# "O23",
# "P23",
# "L24",
# "M24",
# "N24",
# "O24",
# "P24",
# "R24",
# "L25",
# "M25",
# "N25",
# "O25",
# "P25",
# "S25",
# "L28",
# "M28",
# "L29",
# "M29",
# "N29",
# "O29",
# "P29",
# "M30",
# "N30",
# "O30",
# "P30",
# "R30",
# "L32",
# "M32",
# "N32",
# "O32",
# "P32",
# "R32",
# "L37",
# "M37",
# "L38",
# "M38",
# "N38",
# "O38",
# "P38",
# "R38",
# "L39",
# "M39",
# "L44",
# "M44",
# "N44",
# "O44",
# "P44",
# "R44",
# "L47",
# "M47",
# "N47",
# "O47",
# "P47",
# "R47",
# "L50",
# "M50",
# "N50",
# "O50",
# "P50",
# "R50",
# "L51",
# "M51",
# "L52",
# "M52",
# "N52",
# "O52",
# "P52",
# "R52",
# "L53",
# "M53",
# "L54",
# "M54",
# "N54",
# "O54",
# "P54",
# "R54",
# "M55",
# "N55",
# "O55",
# "P55",
# "R55",
# "L56",
# "M56",
# "N56",
# "O56",
# "P56",
# "R56",
# "L57",
# "M57",
# "L58",
# "M58",
# "L59",
# "M59",
# "N59",
# "O59",
# "P59",
# "R59",
# "S59",
# "L60",
# "M60",
# "N60",
# "O60",
# "P60",
# "R60",
# "L61",
# "M61",
# "N61",
# "O61",
# "P61",
# "R61",
# "L62",
# "M62",
# "N62",
# "O62",
# "P62",
# "R62",
# "L66",
# "M66",
# "N66",
# "O66",
# "P66",
# "R66",
# "L67",
# "M67",
# "N67",
# "O67",
# "P67",
# "S67",
# "M68",
# "N68",
# "O68",
# "P68",
# "L79",
# "M79",
# "N79",
# "O79",
# "P79",
# "R79",
# "L80",
# "M80",
# "N80",
# "O80",
# "P80",
# "R80",
# "L81",
# "M81",
# "N81",
# "O81",
# "P81",
# "R81",
# "L87",
# "M87",
# "N87",
# "O87",
# "P87",
# "R87",
# "L89",
# "M89",
# "N89",
# "O89",
# "P89",
# "R89",
# "S89",
# "L91",
# "L92",
# "L93",
# "L94",
# "M91",
# "M92",
# "M93",
# "M94",
# "N91",
# "N92",
# "N93",
# "N94",
# "R91",
# "R92",
# "R93",
# "R94",
# },
# "Direct expenditure": {
# "E01",
# "G01",
# "F01",
# "I01",
# "I02",
# "E02",
# "G02",
# "F02",
# "E03",
# "F03",
# "G03",
# "E04",
# "F04",
# "G04",
# "I04",
# "E05",
# "F05",
# "G05",
# "E06",
# "F06",
# "G06",
# "I06",
# "E12",
# "F12",
# "G12",
# "E14",
# "F14",
# "G14",
# "I14",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "E19",
# "E20",
# "F20",
# "G20",
# "I20",
# "E21",
# "F21",
# "G21",
# "I21",
# "E22",
# "F22",
# "G22",
# "I22",
# "E23",
# "F23",
# "G23",
# "I23",
# "E24",
# "F24",
# "G24",
# "E25",
# "F25",
# "G25",
# "I25",
# "E26",
# "F26",
# "G26",
# "E28",
# "F28",
# "G28",
# "I28",
# "E29",
# "F29",
# "G29",
# "I29",
# "E31",
# "F31",
# "G31",
# "E32",
# "F32",
# "G32",
# "I32",
# "E36",
# "F36",
# "G36",
# "E37",
# "F37",
# "G37",
# "I37",
# "E38",
# "F38",
# "G38",
# "I38",
# "E39",
# "F39",
# "G39",
# "I39",
# "E44",
# "F44",
# "G44",
# "I44",
# "E45",
# "F45",
# "G45",
# "E47",
# "I47",
# "E50",
# "F50",
# "G50",
# "I50",
# "E51",
# "I51",
# "E52",
# "F52",
# "G52",
# "I52",
# "E53",
# "F53",
# "G53",
# "I53",
# "E54",
# "F54",
# "G54",
# "I54",
# "E55",
# "F55",
# "G55",
# "E56",
# "F56",
# "G56",
# "I56",
# "E57",
# "F57",
# "G57",
# "I57",
# "E58",
# "F58",
# "G58",
# "I58",
# "E59",
# "F59",
# "G59",
# "I59",
# "E60",
# "F60",
# "G60",
# "I60",
# "E61",
# "F61",
# "G61",
# "I61",
# "E62",
# "F62",
# "G62",
# "I62",
# "E66",
# "F66",
# "G66",
# "I66",
# "E67",
# "I67",
# "E68",
# "I68",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "F79",
# "G79",
# "I79",
# "E80",
# "F80",
# "G80",
# "I80",
# "E81",
# "F81",
# "G81",
# "I81",
# "E84",
# "E85",
# "F85",
# "G85",
# "I85",
# "E87",
# "F87",
# "G87",
# "I87",
# "E89",
# "F89",
# "G89",
# "I89",
# "J89",
# "E90",
# "F90",
# "G90",
# "E91",
# "F91",
# "G91",
# "I91",
# "E92",
# "F92",
# "G92",
# "I92",
# "E93",
# "F93",
# "G93",
# "I93",
# "E94",
# "F94",
# "G94",
# "I94",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y53",
# "Y25",
# "Y34",
# "Y45",
# },
# "Current operation": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# },
# "Capital outlay": {
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# },
# "Insurance benefits and repayments": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Assistance and subsidies": {
# "I01",
# "I02",
# "I04",
# "I06",
# "I14",
# "E19",
# "I20",
# "I21",
# "I22",
# "I23",
# "I25",
# "I28",
# "I29",
# "I32",
# "I37",
# "I38",
# "I39",
# "I44",
# "I47",
# "I50",
# "I51",
# "I52",
# "I53",
# "I54",
# "I56",
# "I57",
# "I58",
# "I59",
# "I60",
# "I61",
# "I62",
# "I66",
# "E67",
# "I67",
# "E68",
# "I68",
# "I79",
# "I80",
# "I81",
# "E84",
# "I85",
# "I87",
# "J89",
# },
# "Interest on debt": {"I89", "I91", "I92", "I93", "I94"},
# "Exhibit: Salaries and wages": {"Z00"},
# "General expenditure": {
# "E01",
# "F01",
# "G01",
# "I01",
# "L01",
# "M01",
# "N01",
# "O01",
# "P01",
# "R01",
# "E02",
# "F02",
# "G02",
# "I02",
# "L02",
# "M02",
# "E03",
# "F03",
# "G03",
# "E04",
# "F04",
# "G04",
# "I04",
# "L04",
# "M04",
# "E05",
# "F05",
# "G05",
# "L05",
# "M05",
# "N05",
# "O05",
# "P05",
# "S05",
# "E06",
# "F06",
# "G06",
# "I06",
# "L06",
# "M06",
# "E12",
# "F12",
# "G12",
# "L12",
# "M12",
# "N12",
# "O12",
# "P12",
# "Q12",
# "R12",
# "E14",
# "F14",
# "G14",
# "I14",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "L18",
# "M18",
# "N18",
# "O18",
# "P18",
# "Q18",
# "R18",
# "E19",
# "E20",
# "F20",
# "G20",
# "I20",
# "L20",
# "M20",
# "E21",
# "F21",
# "G21",
# "I21",
# "L21",
# "M21",
# "N21",
# "O21",
# "P21",
# "Q21",
# "S21",
# "E22",
# "F22",
# "G22",
# "I22",
# "L22",
# "M22",
# "E23",
# "F23",
# "G23",
# "I23",
# "L23",
# "M23",
# "N23",
# "O23",
# "P23",
# "E24",
# "F24",
# "G24",
# "L24",
# "M24",
# "N24",
# "O24",
# "P24",
# "R24",
# "E25",
# "F25",
# "G25",
# "I25",
# "L25",
# "M25",
# "N25",
# "O25",
# "P25",
# "S25",
# "E26",
# "F26",
# "G26",
# "E28",
# "F28",
# "G28",
# "I28",
# "L28",
# "M28",
# "E29",
# "F29",
# "G29",
# "I29",
# "L29",
# "M29",
# "N29",
# "O29",
# "P29",
# "M30",
# "N30",
# "O30",
# "P30",
# "R30",
# "E31",
# "F31",
# "G31",
# "E32",
# "F32",
# "G32",
# "I32",
# "L32",
# "M32",
# "N32",
# "O32",
# "P32",
# "R32",
# "E36",
# "F36",
# "G36",
# "E37",
# "F37",
# "G37",
# "I37",
# "L37",
# "M37",
# "E38",
# "F38",
# "G38",
# "I38",
# "L38",
# "M38",
# "N38",
# "O38",
# "P38",
# "R38",
# "E39",
# "F39",
# "G39",
# "I39",
# "L39",
# "M39",
# "E44",
# "F44",
# "G44",
# "I44",
# "L44",
# "M44",
# "N44",
# "O44",
# "P44",
# "R44",
# "E45",
# "F45",
# "G45",
# "E47",
# "I47",
# "L47",
# "M47",
# "N47",
# "O47",
# "P47",
# "R47",
# "E50",
# "F50",
# "G50",
# "I50",
# "L50",
# "M50",
# "N50",
# "O50",
# "P50",
# "R50",
# "E51",
# "I51",
# "L51",
# "M51",
# "E52",
# "F52",
# "G52",
# "I52",
# "L52",
# "M52",
# "N52",
# "O52",
# "P52",
# "R52",
# "E53",
# "F53",
# "G53",
# "I53",
# "L53",
# "M53",
# "E54",
# "F54",
# "G54",
# "I54",
# "L54",
# "M54",
# "N54",
# "O54",
# "P54",
# "R54",
# "E55",
# "F55",
# "G55",
# "M55",
# "N55",
# "O55",
# "P55",
# "R55",
# "E56",
# "F56",
# "G56",
# "I56",
# "L56",
# "M56",
# "N56",
# "O56",
# "P56",
# "R56",
# "E57",
# "F57",
# "G57",
# "I57",
# "L57",
# "M57",
# "E58",
# "F58",
# "G58",
# "I58",
# "L58",
# "M58",
# "E59",
# "F59",
# "G59",
# "I59",
# "L59",
# "M59",
# "N59",
# "O59",
# "P59",
# "R59",
# "S59",
# "E60",
# "F60",
# "G60",
# "I60",
# "L60",
# "M60",
# "N60",
# "O60",
# "P60",
# "R60",
# "E61",
# "F61",
# "G61",
# "I61",
# "L61",
# "M61",
# "N61",
# "O61",
# "P61",
# "R61",
# "E62",
# "F62",
# "G62",
# "I62",
# "L62",
# "M62",
# "N62",
# "O62",
# "P62",
# "R62",
# "E66",
# "F66",
# "G66",
# "I66",
# "L66",
# "M66",
# "N66",
# "O66",
# "P66",
# "R66",
# "E67",
# "I67",
# "L67",
# "M67",
# "N67",
# "O67",
# "P67",
# "S67",
# "E68",
# "I68",
# "M68",
# "N68",
# "O68",
# "P68",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "F79",
# "G79",
# "I79",
# "L79",
# "M79",
# "N79",
# "O79",
# "P79",
# "R79",
# "E80",
# "F80",
# "G80",
# "I80",
# "L80",
# "M80",
# "N80",
# "O80",
# "P80",
# "R80",
# "E81",
# "F81",
# "G81",
# "I81",
# "L81",
# "M81",
# "N81",
# "O81",
# "P81",
# "R81",
# "E84",
# "E85",
# "F85",
# "G85",
# "I85",
# "E87",
# "F87",
# "G87",
# "I87",
# "L87",
# "M87",
# "N87",
# "O87",
# "P87",
# "R87",
# "E89",
# "F89",
# "G89",
# "I89",
# "J89",
# "L89",
# "M89",
# "N89",
# "O89",
# "P89",
# "R89",
# "S89",
# "L91",
# "M91",
# "N91",
# "R91",
# "L92",
# "M92",
# "N92",
# "R92",
# "L93",
# "M93",
# "N93",
# "R93",
# "L94",
# "M94",
# "N94",
# "R94",
# },
# "Direct general expenditure": {
# "E01",
# "G01",
# "F01",
# "I01",
# "I02",
# "E02",
# "G02",
# "F02",
# "E03",
# "F03",
# "G03",
# "E04",
# "F04",
# "G04",
# "I04",
# "E05",
# "F05",
# "G05",
# "E06",
# "F06",
# "G06",
# "I06",
# "E12",
# "F12",
# "G12",
# "E14",
# "F14",
# "G14",
# "I14",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "E19",
# "E20",
# "F20",
# "G20",
# "I20",
# "E21",
# "F21",
# "G21",
# "I21",
# "E22",
# "F22",
# "G22",
# "I22",
# "E23",
# "F23",
# "G23",
# "I23",
# "E24",
# "F24",
# "G24",
# "E25",
# "F25",
# "G25",
# "I25",
# "E26",
# "F26",
# "G26",
# "E28",
# "F28",
# "G28",
# "I28",
# "E29",
# "F29",
# "G29",
# "I29",
# "E31",
# "F31",
# "G31",
# "E32",
# "F32",
# "G32",
# "I32",
# "E36",
# "F36",
# "G36",
# "E37",
# "F37",
# "G37",
# "I37",
# "E38",
# "F38",
# "G38",
# "I38",
# "E39",
# "F39",
# "G39",
# "I39",
# "E44",
# "F44",
# "G44",
# "I44",
# "E45",
# "F45",
# "G45",
# "E47",
# "I47",
# "E50",
# "F50",
# "G50",
# "I50",
# "E51",
# "I51",
# "E52",
# "F52",
# "G52",
# "I52",
# "E53",
# "F53",
# "G53",
# "I53",
# "E54",
# "F54",
# "G54",
# "I54",
# "E55",
# "F55",
# "G55",
# "E56",
# "F56",
# "G56",
# "I56",
# "E57",
# "F57",
# "G57",
# "I57",
# "E58",
# "F58",
# "G58",
# "I58",
# "E59",
# "F59",
# "G59",
# "I59",
# "E60",
# "F60",
# "G60",
# "I60",
# "E61",
# "F61",
# "G61",
# "I61",
# "E62",
# "F62",
# "G62",
# "I62",
# "E66",
# "F66",
# "G66",
# "I66",
# "E67",
# "I67",
# "E68",
# "I68",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "F79",
# "G79",
# "I79",
# "E80",
# "F80",
# "G80",
# "I80",
# "E81",
# "F81",
# "G81",
# "I81",
# "E84",
# "E85",
# "F85",
# "G85",
# "I85",
# "E87",
# "F87",
# "G87",
# "I87",
# "E89",
# "F89",
# "G89",
# "I89",
# "J89",
# },
# "Education": {
# "E12",
# "F12",
# "G12",
# "L12",
# "M12",
# "N12",
# "O12",
# "P12",
# "Q12",
# "R12",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "L18",
# "M18",
# "N18",
# "O18",
# "P18",
# "Q18",
# "R18",
# "E19",
# "E20",
# "F20",
# "G20",
# "I20",
# "L20",
# "M20",
# "E21",
# "F21",
# "G21",
# "I21",
# "L21",
# "M21",
# "N21",
# "O21",
# "P21",
# "Q21",
# "S21",
# },
# "Public welfare": {
# "E67",
# "I67",
# "L67",
# "M67",
# "N67",
# "O67",
# "P67",
# "S67",
# "E68",
# "I68",
# "M68",
# "N68",
# "O68",
# "P68",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "F79",
# "G79",
# "I79",
# "L79",
# "M79",
# "N79",
# "O79",
# "P79",
# "R79",
# },
# "Hospitals": {
# "E36",
# "F36",
# "G36",
# "E37",
# "F37",
# "G37",
# "I37",
# "L37",
# "M37",
# "E39",
# "F39",
# "G39",
# "I39",
# "L39",
# "M39",
# "E38",
# "F38",
# "G38",
# "I38",
# "L38",
# "M38",
# "N38",
# "O38",
# "P38",
# "R38",
# },
# "Health": {"E32", "F32", "G32", "I32", "L32", "M32", "N32", "O32", "P32", "R32",},
# "Highways": {
# "E44",
# "F44",
# "G44",
# "I44",
# "L44",
# "M44",
# "N44",
# "O44",
# "P44",
# "R44",
# "E45",
# "F45",
# "G45",
# },
# "Police protection": {
# "E62",
# "F62",
# "G62",
# "I62",
# "L62",
# "M62",
# "N62",
# "O62",
# "P62",
# "R62",
# },
# "Correction": {
# "E04",
# "F04",
# "G04",
# "I04",
# "L04",
# "M04",
# "E05",
# "F05",
# "G05",
# "L05",
# "M05",
# "N05",
# "O05",
# "P05",
# "S05",
# },
# "Natural resources": {
# "E51",
# "I51",
# "L51",
# "M51",
# "E53",
# "F53",
# "G53",
# "I53",
# "L53",
# "M53",
# "E54",
# "F54",
# "G54",
# "I54",
# "L54",
# "M54",
# "N54",
# "O54",
# "P54",
# "R54",
# "E55",
# "F55",
# "G55",
# "M55",
# "N55",
# "O55",
# "P55",
# "R55",
# "E56",
# "F56",
# "G56",
# "I56",
# "L56",
# "M56",
# "N56",
# "O56",
# "P56",
# "R56",
# "E57",
# "F57",
# "G57",
# "I57",
# "L57",
# "M57",
# "E58",
# "F58",
# "G58",
# "I58",
# "L58",
# "M58",
# "E59",
# "F59",
# "G59",
# "I59",
# "L59",
# "M59",
# "N59",
# "O59",
# "P59",
# "R59",
# "S59",
# },
# "Parks and recreation": {
# "E61",
# "F61",
# "G61",
# "I61",
# "L61",
# "M61",
# "N61",
# "O61",
# "P61",
# "R61",
# },
# "Governmental administration": {
# "E23",
# "F23",
# "G23",
# "M23",
# "E25",
# "F25",
# "G25",
# "M25",
# "E26",
# "F26",
# "G26",
# "E29",
# "M29",
# "F29",
# "G29",
# "E31",
# "F31",
# "G31",
# },
# "Interest on general debt": {"I89", "I91", "I92", "I93", "I94"},
# # "Other and unallocable": {"A61", "B46", "E77", "G45", "T21", "T28", "U41"},
# "Other and unallocable": {
# "E01",
# "F01",
# "G01",
# "M01",
# "E03",
# "F03",
# "G03",
# "E22",
# "F22",
# "G22",
# "M30",
# "E50",
# "F50",
# "G50",
# "M50",
# "E52",
# "F52",
# "G52",
# "M52",
# "E66",
# "F66",
# "G66",
# "M66",
# "E80",
# "F80",
# "G80",
# "M80",
# "E81",
# "F81",
# "G81",
# "M81",
# "E85",
# "F85",
# "G85",
# "J85",
# "E87",
# "F87",
# "G87",
# "M87",
# "E89",
# "F89",
# "G89",
# "M89",
# "S89",
# "M91",
# "M92",
# "M93",
# "M94",
# },
# "Utility expenditure": {
# "E91",
# "F91",
# "G91",
# "I91",
# "E92",
# "F92",
# "G92",
# "I92",
# "E93",
# "F93",
# "G93",
# "I93",
# "E94",
# "F94",
# "G94",
# "I94",
# },
# "Liquor stores expenditure": {"E90", "F90", "G90"},
# "Insurance trust expenditure": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Debt at end of fiscal year": {
# "41A",
# "41B",
# "41C",
# "41D",
# "41E",
# "41F",
# "41G",
# "41H",
# "41J",
# "41K",
# "41M",
# "41N",
# "41P",
# "41S",
# "41X",
# "41V",
# "41Y",
# "42A",
# "42B",
# "42C",
# "42D",
# "42E",
# "42F",
# "42G",
# "42H",
# "42J",
# "42K",
# "42L",
# "42M",
# "42N",
# "42P",
# "42R",
# "42S",
# "42X",
# "43A",
# "43B",
# "43C",
# "43D",
# "43E",
# "43F",
# "43G",
# "43H",
# "43J",
# "43K",
# "43L",
# "43M",
# "43N",
# "43P",
# "43R",
# "43S",
# "43X",
# "44A",
# "44B",
# "44C",
# "44D",
# "44E",
# "44F",
# "44G",
# "44H",
# "44J",
# "44K",
# "44L",
# "44M",
# "44N",
# "44P",
# "44R",
# "44S",
# "44T",
# "44W",
# "44X",
# },
# "Cash and security holdings": {
# "W01",
# "W31",
# "W61",
# "W24",
# "W54",
# "W84",
# "W10",
# "W40",
# "W70",
# "W15",
# "W45",
# "W75",
# "W13",
# "W43",
# "W73",
# "Y44",
# "Y84",
# "Y61",
# "Y70",
# "Y73",
# "Y75",
# "Y07",
# "Y08",
# "Y21",
# "Y30",
# "Y33",
# "Y35",
# "X21",
# "X30",
# "X40",
# "X41",
# "X42",
# "X44",
# "X47",
# },
# }
#
# sums_methods_pdf = {
# "Total revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# "T01",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# "A90",
# "A91",
# "A92",
# "A93",
# "A94",
# "X01",
# "X02",
# "X05",
# "X08",
# "Y01",
# "Y02",
# "Y04",
# "Y10",
# "Y11",
# "Y12",
# "Y50",
# "Y51",
# "Y52",
# },
# "General revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D94",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T01",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# },
# "Intergovernmental revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# "S74",
# },
# "Taxes": {
# "T01",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# },
# "General sales": {"T09"},
# "Selective sales": {"T10", "T11", "T12", "T13", "T14", "T15", "T16", "T19"},
# "License taxes": {"T20", "T21", "T22", "T23", "T24", "T25", "T27", "T28", "T29"},
# "Individual income tax": {"T40"},
# "Corporate income tax": {"T41"},
# "Other taxes": {"T01", "T50", "T51", "T53", "T99"},
# "Current charge": {
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# },
# "Miscellaneous general revenue": {
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# },
# "Utility revenue": {"A91", "A92", "A93", "A94"},
# "Liquor stores revenue": {"A90"},
# "Insurance trust revenue": {
# "X01",
# "X02",
# "X05",
# "X08",
# "Y01",
# "Y02",
# "Y04",
# "Y10",
# "Y11",
# "Y12",
# "Y50",
# "Y51",
# "Y52",
# },
# "Total expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# "I89",
# "I91",
# "I92",
# "I93",
# "I94",
# "J19",
# "J67",
# "J68",
# "J85",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y15",
# "Y14",
# "Y53",
# "Y54",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S74",
# "S89",
# },
# "Intergovernmental expenditure": {
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S68",
# "S89",
# },
# "Direct expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# "J19",
# "J67",
# "J68",
# "J85",
# "I89",
# "I91",
# "I92",
# "I93",
# "I94",
# },
# "Current operation": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# },
# "Capital outlay": {
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# },
# "Insurance benefits and repayments": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Assistance and subsidies": {"J19", "J67", "J68", "J85"},
# "Interest on debt": {"I89", "I91", "I92", "I93", "I94"},
# "Exhibit: Salaries and wages": {"Z00"},
# "General expenditure": {
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S89",
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "I89",
# "J19",
# "J67",
# "J68",
# "J85",
# },
# "Direct general expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "I89",
# "J19",
# "J67",
# "J68",
# "J85",
# },
# "Education": {
# "E12",
# "F12",
# "G12",
# "M12",
# "Q12",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "M18",
# "Q18",
# "J19",
# "E21",
# "F21",
# "G21",
# "M21",
# },
# "Public welfare": {
# "J67",
# "M67",
# "S67",
# "S74",
# "J68",
# "M68",
# "E73",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "M79",
# "F79",
# "G79",
# },
# "Hospitals": {"E36", "F36", "G36", "M36"},
# # "Health": {"E27", "E32", "F27", "F32", "G27", "G32", "M27", "M32"},
# "Health": {"E32", "F32", "G32", "M32"},
# "Highways": {"E44", "M44", "F44", "G44", "E45", "F45", "G45"},
# "Police protection": {"E62", "F62", "G62", "M62"},
# "Correction": {"E04", "M04", "F04", "G04", "E05", "F05", "G05", "M05"},
# "Natural resources": {
# "E54",
# "E55",
# "M54",
# "M55",
# "E56",
# "M56",
# "E59",
# "M59",
# "F54",
# "F55",
# "F56",
# "F59",
# "G54",
# "G55",
# "G56",
# "G59",
# },
# "Parks and recreation": {"E61", "F61", "G61", "M61"},
# "Governmental administration": {
# "E23",
# "F23",
# "G23",
# "M23",
# "E25",
# "F25",
# "G25",
# "M25",
# "E26",
# "F26",
# "G26",
# "E29",
# "M29",
# "F29",
# "G29",
# "E31",
# "F31",
# "G31",
# },
# "Interest on general debt": {"I89"},
# "Other and unallocable": {
# "E01",
# "F01",
# "G01",
# "M01",
# "E03",
# "F03",
# "G03",
# "E22",
# "F22",
# "G22",
# "M30",
# "E50",
# "F50",
# "G50",
# "M50",
# "E52",
# "F52",
# "G52",
# "M52",
# "E66",
# "F66",
# "G66",
# "M66",
# "E80",
# "F80",
# "G80",
# "M80",
# "E81",
# "F81",
# "G81",
# "M81",
# "E85",
# "F85",
# "G85",
# "J85",
# "E87",
# "F87",
# "G87",
# "M87",
# "E89",
# "F89",
# "G89",
# "M89",
# "S89",
# "M91",
# "M92",
# "M93",
# "M94",
# },
# "Utility expenditure": {
# "E91",
# "F91",
# "G91",
# "I91",
# "E92",
# "F92",
# "G92",
# "I92",
# "E93",
# "F93",
# "G93",
# "I93",
# "E94",
# "F94",
# "G94",
# "I94",
# },
# "Liquor stores expenditure": {"E90", "F90", "G90"},
# "Insurance trust expenditure": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Debt at end of fiscal year": {"64V", "44T", "49U"},
# "Cash and security holdings": {
# "W01",
# "W31",
# "W61",
# "X21",
# "X30",
# "Z77",
# "Z78",
# "X42",
# "X44",
# "X47",
# "Y07",
# "Y08",
# "Y21",
# "Y61",
# },
# }
#
# sums_2005_2011 = {
# "Total revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# "T01",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# "A90",
# "A91",
# "A92",
# "A93",
# "A94",
# "X01",
# "X02",
# "X05",
# "X08",
# "Y01",
# "Y02",
# "Y04",
# "Y10",
# "Y11",
# "Y12",
# "Y50",
# "Y51",
# "Y52",
# },
# "General revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D94",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T01",
# "T50",
# "T51",
# "T53",
# "T99",
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# },
# "Intergovernmental revenue": {
# "B01",
# "B21",
# "B22",
# "B30",
# "B42",
# "B43",
# "B46",
# "B50",
# "B54",
# "B59",
# "B79",
# "B80",
# "B89",
# "B91",
# "B92",
# "B93",
# "B94",
# "D21",
# "D30",
# "D42",
# "D46",
# "D50",
# "D79",
# "D80",
# "D89",
# "D91",
# "D92",
# "D93",
# "D94",
# "S74",
# },
# "Taxes": {
# "T01",
# "T09",
# "T10",
# "T11",
# "T12",
# "T13",
# "T14",
# "T15",
# "T16",
# "T19",
# "T20",
# "T21",
# "T22",
# "T23",
# "T24",
# "T25",
# "T27",
# "T28",
# "T29",
# "T40",
# "T41",
# "T50",
# "T51",
# "T53",
# "T99",
# },
# "General sales": {"T09"},
# "Selective sales": {"T10", "T11", "T12", "T13", "T14", "T15", "T16", "T19"},
# "License taxes": {"T20", "T21", "T22", "T23", "T24", "T25", "T27", "T28", "T29"},
# "Individual income tax": {"T40"},
# "Corporate income tax": {"T41"},
# "Other taxes": {"T01", "T50", "T51", "T53", "T99"},
# "Current charge": {
# "A01",
# "A03",
# "A09",
# "A10",
# "A12",
# "A16",
# "A18",
# "A21",
# "A36",
# "A44",
# "A45",
# "A50",
# "A54",
# "A56",
# "A59",
# "A60",
# "A61",
# "A80",
# "A81",
# "A87",
# "A89",
# },
# "Miscellaneous general revenue": {
# "U01",
# "U11",
# "U20",
# "U21",
# "U30",
# "U40",
# "U41",
# "U50",
# "U95",
# "U99",
# },
# "Utility revenue": {"A91", "A92", "A93", "A94"},
# "Liquor stores revenue": {"A90"},
# "Insurance trust revenue": {
# "X01",
# "X02",
# "X05",
# "X08",
# "Y01",
# "Y02",
# "Y04",
# "Y10",
# "Y11",
# "Y12",
# "Y50",
# "Y51",
# "Y52",
# },
# "Total expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# "I89",
# "I91",
# "I92",
# "I93",
# "I94",
# "J19",
# "J67",
# "J68",
# "J85",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y15",
# "Y14",
# "Y53",
# "Y54",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S74",
# "S89",
# },
# "Intergovernmental expenditure": {
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S68",
# "S89",
# },
# "Direct expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# "J19",
# "J67",
# "J68",
# "J85",
# "I89",
# "I91",
# "I92",
# "I93",
# "I94",
# },
# "Current operation": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "E90",
# "E91",
# "E92",
# "E93",
# "E94",
# },
# "Capital outlay": {
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "F90",
# "F91",
# "F92",
# "F93",
# "F94",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "G90",
# "G91",
# "G92",
# "G93",
# "G94",
# },
# "Insurance benefits and repayments": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Assistance and subsidies": {"J19", "J67", "J68", "J85"},
# "Interest on debt": {"I89", "I91", "I92", "I93", "I94"},
# "Exhibit: Salaries and wages": {"Z00"},
# "General expenditure": {
# "M01",
# "M04",
# "M05",
# "M12",
# "M18",
# "M21",
# "M23",
# "M25",
# "M27",
# "M29",
# "M30",
# "M32",
# "M36",
# "M44",
# "M50",
# "M52",
# "M54",
# "M55",
# "M56",
# "M59",
# "M60",
# "M61",
# "M62",
# "M66",
# "M67",
# "M68",
# "M79",
# "M80",
# "M81",
# "M87",
# "M89",
# "M91",
# "M92",
# "M93",
# "M94",
# "Q12",
# "Q18",
# "S67",
# "S89",
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G24",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "I89",
# "J19",
# "J67",
# "J68",
# "J85",
# },
# "Direct general expenditure": {
# "E01",
# "E03",
# "E04",
# "E05",
# "E12",
# "E16",
# "E18",
# "E21",
# "E22",
# "E23",
# "E25",
# "E26",
# "E27",
# "E29",
# "E31",
# "E32",
# "E36",
# "E44",
# "E45",
# "E50",
# "E52",
# "E54",
# "E55",
# "E56",
# "E59",
# "E60",
# "E61",
# "E62",
# "E66",
# "E73",
# "E74",
# "E75",
# "E77",
# "E79",
# "E80",
# "E81",
# "E85",
# "E87",
# "E89",
# "F01",
# "F03",
# "F04",
# "F05",
# "F12",
# "F16",
# "F18",
# "F21",
# "F22",
# "F23",
# "F25",
# "F26",
# "F27",
# "F29",
# "F31",
# "F32",
# "F36",
# "F44",
# "F45",
# "F50",
# "F52",
# "F54",
# "F55",
# "F56",
# "F59",
# "F60",
# "F61",
# "F62",
# "F66",
# "F77",
# "F79",
# "F80",
# "F81",
# "F85",
# "F87",
# "F89",
# "G01",
# "G03",
# "G04",
# "G05",
# "G12",
# "G16",
# "G18",
# "G21",
# "G22",
# "G23",
# "G25",
# "G26",
# "G27",
# "G29",
# "G31",
# "G32",
# "G36",
# "G44",
# "G45",
# "G50",
# "G52",
# "G54",
# "G55",
# "G56",
# "G59",
# "G60",
# "G61",
# "G62",
# "G66",
# "G77",
# "G79",
# "G80",
# "G81",
# "G85",
# "G87",
# "G89",
# "I89",
# "J19",
# "J67",
# "J68",
# "J85",
# },
# "Education": {
# "E12",
# "F12",
# "G12",
# "M12",
# "Q12",
# "E16",
# "F16",
# "G16",
# "E18",
# "F18",
# "G18",
# "M18",
# "Q18",
# "J19",
# "E21",
# "F21",
# "G21",
# "M21",
# },
# "Public welfare": {
# "J67",
# "M67",
# "S67",
# "S74",
# "J68",
# "M68",
# "E73",
# "E74",
# "E75",
# "E77",
# "F77",
# "G77",
# "E79",
# "M79",
# "F79",
# "G79",
# },
# "Hospitals": {"E36", "F36", "G36", "M36"},
# "Health": {"E27", "E32", "F27", "F32", "G27", "G32", "M27", "M32"},
# # "Health": {"E32", "F32", "G32", "M32"},
# "Highways": {"E44", "M44", "F44", "G44", "E45", "F45", "G45"},
# "Police protection": {"E62", "F62", "G62", "M62"},
# "Correction": {"E04", "M04", "F04", "G04", "E05", "F05", "G05", "M05"},
# "Natural resources": {
# "E54",
# "E55",
# "M54",
# "M55",
# "E56",
# "M56",
# "E59",
# "M59",
# "F54",
# "F55",
# "F56",
# "F59",
# "G54",
# "G55",
# "G56",
# "G59",
# },
# "Parks and recreation": {"E61", "F61", "G61", "M61"},
# "Governmental administration": {
# "E23",
# "F23",
# "G23",
# "M23",
# "E25",
# "F25",
# "G25",
# "M25",
# "E26",
# "F26",
# "G26",
# "E29",
# "M29",
# "F29",
# "G29",
# "E31",
# "F31",
# "G31",
# },
# "Interest on general debt": {"I89"},
# "Other and unallocable": {
# "E01",
# "F01",
# "G01",
# "M01",
# "E03",
# "F03",
# "G03",
# "E22",
# "F22",
# "G22",
# "M30",
# "E50",
# "F50",
# "G50",
# "M50",
# "E52",
# "F52",
# "G52",
# "M52",
# "E66",
# "F66",
# "G66",
# "M66",
# "E80",
# "F80",
# "G80",
# "M80",
# "E81",
# "F81",
# "G81",
# "M81",
# "E85",
# "F85",
# "G85",
# "J85",
# "E87",
# "F87",
# "G87",
# "M87",
# "E89",
# "F89",
# "G89",
# "M89",
# "S89",
# "M91",
# "M92",
# "M93",
# "M94",
# },
# "Utility expenditure": {
# "E91",
# "F91",
# "G91",
# "I91",
# "E92",
# "F92",
# "G92",
# "I92",
# "E93",
# "F93",
# "G93",
# "I93",
# "E94",
# "F94",
# "G94",
# "I94",
# },
# "Liquor stores expenditure": {"E90", "F90", "G90"},
# "Insurance trust expenditure": {
# "X11",
# "X12",
# "Y05",
# "Y06",
# "Y14",
# "Y15",
# "Y53",
# "Y54",
# },
# "Debt at end of fiscal year": {"64V", "44T", "49U"},
# "Cash and security holdings": {
# "W01",
# "W31",
# "W61",
# "X21",
# "X30",
# "Z77",
# "Z78",
# "X42",
# "X44",
# "X47",
# "Y07",
# "Y08",
# "Y21",
# "Y61",
# },
# }
| sums_new_methodology = {'Total revenue': {'A01', 'A03', 'A09', 'A10', 'A12', 'A16', 'A18', 'A21', 'A36', 'A44', 'A45', 'A50', 'A54', 'A56', 'A59', 'A60', 'A61', 'A80', 'A81', 'A87', 'A89', 'A90', 'A91', 'A92', 'A93', 'A94', 'B01', 'B21', 'B22', 'B30', 'B42', 'B43', 'B46', 'B50', 'B54', 'B59', 'B79', 'B80', 'B89', 'B91', 'B92', 'B93', 'B94', 'D21', 'D30', 'D42', 'D46', 'D50', 'D79', 'D80', 'D89', 'D91', 'D92', 'D93', 'D94', 'T01', 'T09', 'T10', 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T19', 'T20', 'T21', 'T22', 'T23', 'T24', 'T25', 'T27', 'T28', 'T29', 'T40', 'T41', 'T50', 'T51', 'T53', 'T99', 'U01', 'U11', 'U20', 'U21', 'U30', 'U40', 'U41', 'U50', 'U95', 'U99', 'X01', 'X02', 'X05', 'X08', 'Y01', 'Y02', 'Y04', 'Y11', 'Y12', 'Y51', 'Y52'}, 'General revenue': {'A01', 'A03', 'A09', 'A10', 'A12', 'A16', 'A18', 'A21', 'A36', 'A44', 'A45', 'A50', 'A54', 'A56', 'A59', 'A60', 'A61', 'A80', 'A81', 'A87', 'A89', 'B01', 'B21', 'B22', 'B30', 'B42', 'B43', 'B46', 'B50', 'B54', 'B59', 'B79', 'B80', 'B89', 'B91', 'B92', 'B93', 'B94', 'D21', 'D30', 'D42', 'D46', 'D50', 'D79', 'D80', 'D89', 'D91', 'D92', 'D93', 'D94', 'T01', 'T09', 'T10', 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T19', 'T20', 'T21', 'T22', 'T23', 'T24', 'T25', 'T27', 'T28', 'T29', 'T40', 'T41', 'T50', 'T51', 'T53', 'T99', 'U01', 'U11', 'U20', 'U21', 'U30', 'U40', 'U41', 'U50', 'U95', 'U99'}, 'Intergovernmental revenue': {'B01', 'B21', 'B22', 'B30', 'B42', 'B43', 'B46', 'B50', 'B54', 'B59', 'B79', 'B80', 'B89', 'B91', 'B92', 'B93', 'B94', 'D21', 'D30', 'D42', 'D46', 'D50', 'D79', 'D80', 'D89', 'D91', 'D92', 'D93', 'D94'}, 'Taxes': {'T01', 'T09', 'T10', 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T19', 'T20', 'T21', 'T22', 'T23', 'T24', 'T25', 'T27', 'T28', 'T29', 'T40', 'T41', 'T50', 'T51', 'T53', 'T99'}, 'General sales': {'T09'}, 'Selective sales': {'T10', 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T19'}, 'License taxes': {'T20', 'T21', 'T22', 'T23', 'T24', 'T25', 'T27', 'T28', 'T29'}, 'Individual income tax': {'T40'}, 'Corporate income tax': {'T41'}, 'Other taxes': {'T01', 'T50', 'T51', 'T53', 'T99'}, 'Current charge': {'A01', 'A03', 'A09', 'A10', 'A12', 'A16', 'A18', 'A21', 'A36', 'A44', 'A45', 'A50', 'A54', 'A56', 'A59', 'A60', 'A61', 'A80', 'A81', 'A87', 'A89'}, 'Miscellaneous general revenue': {'U01', 'U11', 'U20', 'U21', 'U30', 'U40', 'U41', 'U50', 'U95', 'U99'}, 'Utility revenue': {'A91', 'A92', 'A93', 'A94'}, 'Liquor stores revenue': {'A90'}, 'Insurance trust revenue': {'X01', 'X02', 'X05', 'X08', 'Y01', 'Y02', 'Y04', 'Y11', 'Y12', 'Y50', 'Y51', 'Y52'}, 'Total expenditure': {'E01', 'E03', 'E04', 'E05', 'E12', 'E16', 'E18', 'E21', 'E22', 'E23', 'E25', 'E26', 'E27', 'E29', 'E31', 'E32', 'E36', 'E44', 'E45', 'E50', 'E52', 'E54', 'E55', 'E56', 'E59', 'E60', 'E61', 'E62', 'E66', 'E74', 'E75', 'E77', 'E79', 'E80', 'E81', 'E85', 'E87', 'E89', 'E90', 'E91', 'E92', 'E93', 'E94', 'F01', 'F03', 'F04', 'F05', 'F12', 'F16', 'F18', 'F21', 'F22', 'F23', 'F25', 'F26', 'F27', 'F29', 'F31', 'F32', 'F36', 'F44', 'F45', 'F50', 'F52', 'F54', 'F55', 'F56', 'F59', 'F60', 'F61', 'F62', 'F66', 'F77', 'F79', 'F80', 'F81', 'F85', 'F87', 'F89', 'F90', 'F91', 'F92', 'F93', 'F94', 'G01', 'G03', 'G04', 'G05', 'G12', 'G16', 'G18', 'G21', 'G22', 'G23', 'G25', 'G26', 'G27', 'G29', 'G31', 'G32', 'G36', 'G44', 'G45', 'G50', 'G52', 'G54', 'G55', 'G56', 'G59', 'G60', 'G61', 'G62', 'G66', 'G77', 'G79', 'G80', 'G81', 'G85', 'G87', 'G89', 'G90', 'G91', 'G92', 'G93', 'G94', 'I89', 'I91', 'I92', 'I93', 'I94', 'J19', 'J67', 'J68', 'J85', 'M01', 'M04', 'M05', 'M12', 'M18', 'M21', 'M23', 'M25', 'M27', 'M29', 'M30', 'M32', 'M36', 'M44', 'M50', 'M52', 'M54', 'M55', 'M56', 'M59', 'M60', 'M61', 'M62', 'M66', 'M67', 'M68', 'M79', 'M80', 'M81', 'M87', 'M89', 'M91', 'M92', 'M93', 'M94', 'Q12', 'Q18', 'S67', 'S89', 'X11', 'X12', 'Y05', 'Y06', 'Y14', 'Y53'}, 'Intergovernmental expenditure': {'M01', 'M04', 'M05', 'M12', 'M18', 'M21', 'M23', 'M25', 'M27', 'M29', 'M30', 'M32', 'M36', 'M44', 'M50', 'M52', 'M54', 'M55', 'M56', 'M59', 'M60', 'M61', 'M62', 'M66', 'M67', 'M68', 'M79', 'M80', 'M81', 'M87', 'M89', 'M91', 'M92', 'M93', 'M94', 'Q12', 'Q18', 'S67', 'S89'}, 'Direct expenditure': {'E01', 'E03', 'E04', 'E05', 'E12', 'E16', 'E18', 'E21', 'E22', 'E23', 'E25', 'E26', 'E27', 'E29', 'E31', 'E32', 'E36', 'E44', 'E45', 'E50', 'E52', 'E54', 'E55', 'E56', 'E59', 'E60', 'E61', 'E62', 'E66', 'E74', 'E75', 'E77', 'E79', 'E80', 'E81', 'E85', 'E87', 'E89', 'E90', 'E91', 'E92', 'E93', 'E94', 'F01', 'F03', 'F04', 'F05', 'F12', 'F16', 'F18', 'F21', 'F22', 'F23', 'F25', 'F26', 'F27', 'F29', 'F31', 'F32', 'F36', 'F44', 'F45', 'F50', 'F52', 'F54', 'F55', 'F56', 'F59', 'F60', 'F61', 'F62', 'F66', 'F77', 'F79', 'F80', 'F81', 'F85', 'F87', 'F89', 'F90', 'F91', 'F92', 'F93', 'F94', 'G01', 'G03', 'G04', 'G05', 'G12', 'G16', 'G18', 'G21', 'G22', 'G23', 'G25', 'G26', 'G27', 'G29', 'G31', 'G32', 'G36', 'G44', 'G45', 'G50', 'G52', 'G54', 'G55', 'G56', 'G59', 'G60', 'G61', 'G62', 'G66', 'G77', 'G79', 'G80', 'G81', 'G85', 'G87', 'G89', 'G90', 'G91', 'G92', 'G93', 'G94', 'I89', 'I91', 'I92', 'I93', 'I94', 'J19', 'J67', 'J68', 'J85', 'X11', 'X12', 'Y05', 'Y06', 'Y14', 'Y53'}, 'Current operation': {'E01', 'E03', 'E04', 'E05', 'E12', 'E16', 'E18', 'E21', 'E22', 'E23', 'E25', 'E26', 'E27', 'E29', 'E31', 'E32', 'E36', 'E44', 'E45', 'E50', 'E52', 'E54', 'E55', 'E56', 'E59', 'E60', 'E61', 'E62', 'E66', 'E74', 'E75', 'E77', 'E79', 'E80', 'E81', 'E85', 'E87', 'E89', 'E90', 'E91', 'E92', 'E93', 'E94'}, 'Capital outlay': {'F01', 'F03', 'F04', 'F05', 'F12', 'F16', 'F18', 'F21', 'F22', 'F23', 'F25', 'F26', 'F27', 'F29', 'F31', 'F32', 'F36', 'F44', 'F45', 'F50', 'F52', 'F54', 'F55', 'F56', 'F59', 'F60', 'F61', 'F62', 'F66', 'F77', 'F79', 'F80', 'F81', 'F85', 'F87', 'F89', 'F90', 'F91', 'F92', 'F93', 'F94', 'G01', 'G03', 'G04', 'G05', 'G12', 'G16', 'G18', 'G21', 'G22', 'G23', 'G25', 'G26', 'G27', 'G29', 'G31', 'G32', 'G36', 'G44', 'G45', 'G50', 'G52', 'G54', 'G55', 'G56', 'G59', 'G60', 'G61', 'G62', 'G66', 'G77', 'G79', 'G80', 'G81', 'G85', 'G87', 'G89', 'G90', 'G91', 'G92', 'G93', 'G94'}, 'Insurance benefits and repayments': {'X11', 'X12', 'Y05', 'Y06', 'Y14', 'Y53'}, 'Assistance and subsidies': {'J19', 'J67', 'J68', 'J85'}, 'Interest on debt': {'I89', 'I91', 'I92', 'I93', 'I94'}, 'Exhibit: Salaries and wages': {'Z00'}, 'General expenditure': {'E01', 'E03', 'E04', 'E05', 'E12', 'E16', 'E18', 'E21', 'E22', 'E23', 'E25', 'E26', 'E27', 'E29', 'E31', 'E32', 'E36', 'E44', 'E45', 'E50', 'E52', 'E54', 'E55', 'E56', 'E59', 'E60', 'E61', 'E62', 'E66', 'E74', 'E75', 'E77', 'E79', 'E80', 'E81', 'E85', 'E87', 'E89', 'F01', 'F03', 'F04', 'F05', 'F12', 'F16', 'F18', 'F21', 'F22', 'F23', 'F25', 'F26', 'F27', 'F29', 'F31', 'F32', 'F36', 'F44', 'F45', 'F50', 'F52', 'F54', 'F55', 'F56', 'F59', 'F60', 'F61', 'F62', 'F66', 'F77', 'F79', 'F80', 'F81', 'F85', 'F87', 'F89', 'G01', 'G03', 'G04', 'G05', 'G12', 'G16', 'G18', 'G21', 'G22', 'G23', 'G25', 'G26', 'G27', 'G29', 'G31', 'G32', 'G36', 'G44', 'G45', 'G50', 'G52', 'G54', 'G55', 'G56', 'G59', 'G60', 'G61', 'G62', 'G66', 'G77', 'G79', 'G80', 'G81', 'G85', 'G87', 'G89', 'I89', 'J19', 'J67', 'J68', 'J85', 'M01', 'M04', 'M05', 'M12', 'M18', 'M21', 'M23', 'M25', 'M27', 'M29', 'M30', 'M32', 'M36', 'M44', 'M50', 'M52', 'M54', 'M55', 'M56', 'M59', 'M60', 'M61', 'M62', 'M66', 'M67', 'M68', 'M79', 'M80', 'M81', 'M87', 'M89', 'M91', 'M92', 'M93', 'M94', 'Q12', 'Q18', 'S67', 'S89'}, 'Direct general expenditure': {'E01', 'E03', 'E04', 'E05', 'E12', 'E16', 'E18', 'E21', 'E22', 'E23', 'E25', 'E26', 'E27', 'E29', 'E31', 'E32', 'E36', 'E44', 'E45', 'E50', 'E52', 'E54', 'E55', 'E56', 'E59', 'E60', 'E61', 'E62', 'E66', 'E74', 'E75', 'E77', 'E79', 'E80', 'E81', 'E85', 'E87', 'E89', 'F01', 'F03', 'F04', 'F05', 'F12', 'F16', 'F18', 'F21', 'F22', 'F23', 'F25', 'F26', 'F27', 'F29', 'F31', 'F32', 'F36', 'F44', 'F45', 'F50', 'F52', 'F54', 'F55', 'F56', 'F59', 'F60', 'F61', 'F62', 'F66', 'F77', 'F79', 'F80', 'F81', 'F85', 'F87', 'F89', 'G01', 'G03', 'G04', 'G05', 'G12', 'G16', 'G18', 'G21', 'G22', 'G23', 'G25', 'G26', 'G27', 'G29', 'G31', 'G32', 'G36', 'G44', 'G45', 'G50', 'G52', 'G54', 'G55', 'G56', 'G59', 'G60', 'G61', 'G62', 'G66', 'G77', 'G79', 'G80', 'G81', 'G85', 'G87', 'G89', 'I89', 'J19', 'J67', 'J68', 'J85'}, 'Education': {'E12', 'E16', 'E18', 'E21', 'F12', 'F16', 'F18', 'F21', 'G12', 'G16', 'G18', 'G21', 'J19', 'M12', 'M18', 'M21', 'Q12', 'Q18'}, 'Public welfare': {'E74', 'E75', 'E77', 'E79', 'F77', 'F79', 'G77', 'G79', 'J67', 'J68', 'M67', 'M68', 'M79', 'S67'}, 'Hospitals': {'E36', 'F36', 'G36', 'M36'}, 'Health': {'E32', 'F32', 'G32', 'M32'}, 'Highways': {'E44', 'M44', 'F44', 'G44', 'E45', 'F45', 'G45'}, 'Police protection': {'E62', 'F62', 'G62', 'M62'}, 'Correction': {'E04', 'E05', 'F04', 'F05', 'G04', 'G05', 'M04', 'M05'}, 'Natural resources': {'E54', 'E55', 'E56', 'E59', 'F54', 'F55', 'F56', 'F59', 'G54', 'G55', 'G56', 'G59', 'M54', 'M55', 'M56', 'M59'}, 'Parks and recreation': {'E61', 'F61', 'G61', 'M61'}, 'Governmental administration': {'E23', 'E25', 'E26', 'E29', 'E31', 'F23', 'F25', 'F26', 'F29', 'F31', 'G23', 'G25', 'G26', 'G29', 'G31', 'M23', 'M25', 'M29'}, 'Interest on general debt': {'I89'}, 'Other and unallocable': {'E01', 'E03', 'E22', 'E50', 'E52', 'E60', 'E66', 'E80', 'E81', 'E85', 'E87', 'E89', 'F01', 'F03', 'F22', 'F50', 'F52', 'F60', 'F66', 'F80', 'F81', 'F85', 'F87', 'F89', 'G01', 'G03', 'G22', 'G50', 'G52', 'G60', 'G66', 'G80', 'G81', 'G85', 'G87', 'G89', 'M01', 'M50', 'M52', 'M60', 'M66', 'M80', 'M81', 'M87', 'M89', 'S89'}, 'Utility expenditure': {'E91', 'E92', 'E93', 'E94', 'F91', 'F92', 'F93', 'F94', 'G91', 'G92', 'G93', 'G94', 'I91', 'I92', 'I93', 'I94', 'M91', 'M92', 'M93', 'M94'}, 'Liquor stores expenditure': {'E90', 'F90', 'G90'}, 'Insurance trust expenditure': {'X11', 'X12', 'Y05', 'Y06', 'Y14', 'Y53'}, 'Debt at end of fiscal year': {'64V', '44T', '49U'}, 'Cash and security holdings': {'W01', 'W31', 'W61', 'X21', 'X30', 'X42', 'X44', 'X47', 'Y07', 'Y08', 'Y21', 'Y61', 'Z77', 'Z78'}} |
class Solution:
def solve(self, nums, k):
nums = [0]+nums
for i in range(1,len(nums)):
nums[i] += nums[i-1]
sums = [[nums[i] - x for x in sorted(nums[:i])[:k]] for i in range(1,len(nums))]
return sorted(sum(sums,[]))[-k:]
| class Solution:
def solve(self, nums, k):
nums = [0] + nums
for i in range(1, len(nums)):
nums[i] += nums[i - 1]
sums = [[nums[i] - x for x in sorted(nums[:i])[:k]] for i in range(1, len(nums))]
return sorted(sum(sums, []))[-k:] |
class MyParser:
def __init__(self, text_1, text_2):
self.text_1 = text_1
self.text_2 = text_2
def parse_text(self, text):
stack = []
for char in text:
if char != '#':
stack.append(char)
else:
if len(stack) > 0:
stack.pop()
return ''.join(stack)
def check_if_equal(self):
return self.parse_text(self.text_1) == self.parse_text(self.text_2)
| class Myparser:
def __init__(self, text_1, text_2):
self.text_1 = text_1
self.text_2 = text_2
def parse_text(self, text):
stack = []
for char in text:
if char != '#':
stack.append(char)
elif len(stack) > 0:
stack.pop()
return ''.join(stack)
def check_if_equal(self):
return self.parse_text(self.text_1) == self.parse_text(self.text_2) |
if __name__ == '__main__':
n = int(input())
arr =list(map(int, input().split(" ")))
i = max(arr)
for i in range(0,n):
if max(arr) == i:
arr.remove(max(arr))
arr.sort(reverse=True)
print(arr[0])
| if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split(' ')))
i = max(arr)
for i in range(0, n):
if max(arr) == i:
arr.remove(max(arr))
arr.sort(reverse=True)
print(arr[0]) |
n=int(input())
p=[[int(i)for i in input().split()] for _ in range(n)]
p.sort(key=lambda x: x[2])
a,b,c=p[-1]
for y in range(101):
for x in range(101):
h=c+abs(a-x)+abs(b-y)
if all(k==max(h-abs(i-x)-abs(y-j),0) for i,j,k in p):
print(x,y,h)
exit() | n = int(input())
p = [[int(i) for i in input().split()] for _ in range(n)]
p.sort(key=lambda x: x[2])
(a, b, c) = p[-1]
for y in range(101):
for x in range(101):
h = c + abs(a - x) + abs(b - y)
if all((k == max(h - abs(i - x) - abs(y - j), 0) for (i, j, k) in p)):
print(x, y, h)
exit() |
# Copyright (c) 2021 Hashz Software.
class ArgNotFound:
def __init__(self, arg):
print("ArgNotFound: %s" % arg) | class Argnotfound:
def __init__(self, arg):
print('ArgNotFound: %s' % arg) |
#These information comes from Twitter API
#Create a Twitter Account and Get These Information from apps.twitter.com
consumer_key = 'R1feyoEHAw2Lg32k4OKyyn01v'
consumer_secret = 'KdxSi79P7PAjhmY4OYU2VfeKUcaUt4WmyJMb7Oew0nE1M7Ji5h'
access_token = '145566333-KIndElco5MlHXPIGWeGkvjVXlMchLyQI2bMD8BJT'
access_secret = 'iqfFlcM4clh6wCwDSLZaQqJttgstiIybUDOoB3uyzaZx8'
| consumer_key = 'R1feyoEHAw2Lg32k4OKyyn01v'
consumer_secret = 'KdxSi79P7PAjhmY4OYU2VfeKUcaUt4WmyJMb7Oew0nE1M7Ji5h'
access_token = '145566333-KIndElco5MlHXPIGWeGkvjVXlMchLyQI2bMD8BJT'
access_secret = 'iqfFlcM4clh6wCwDSLZaQqJttgstiIybUDOoB3uyzaZx8' |
class lightswitch:
is_on = False
def Flip(self):
#self refers to the instance of the object. needs to be included only when using class, to ensure that it is defined only within the class
self.is_on = not self.is_on #field/attribute
print(self.is_on)
def FlipMany(self, number:int):
for i in range(number):
self.Flip()
living_room_light = lightswitch() #object
bedroom_light = lightswitch()
print('living_room_light:')
living_room_light.FlipMany(13)
print('bedroom_light:')
bedroom_light.FlipMany(4)
print(type(bedroom_light)) #built type
print(dir(bedroom_light)) #print all the methods within the class, including the ones u have created
| class Lightswitch:
is_on = False
def flip(self):
self.is_on = not self.is_on
print(self.is_on)
def flip_many(self, number: int):
for i in range(number):
self.Flip()
living_room_light = lightswitch()
bedroom_light = lightswitch()
print('living_room_light:')
living_room_light.FlipMany(13)
print('bedroom_light:')
bedroom_light.FlipMany(4)
print(type(bedroom_light))
print(dir(bedroom_light)) |
if __name__ == "__main__":
TC = int(input())
for t in range(0,TC):
N = int(input())
max_score = -1
tie = False
win = 0
for n in range(0,N):
T = [0] * 6
C = list(map(int, input().split()))
for c in range(1,len(C)):
T[C[c]-1]+=1
T.sort()
score = C[0]
score += T[0]*4
T[1] -= T[0];
T[2] -= T[0];
score += T[1]*2
T[2] -= T[1];
score += T[2];
#print(T)
#print(score)
if score > max_score:
tie = False
max_score = score
win = n
elif score == max_score:
tie = True
max_score = score
win = n
if tie:
print("tie")
elif win == 0:
print("chef")
else:
print(win+1)
| if __name__ == '__main__':
tc = int(input())
for t in range(0, TC):
n = int(input())
max_score = -1
tie = False
win = 0
for n in range(0, N):
t = [0] * 6
c = list(map(int, input().split()))
for c in range(1, len(C)):
T[C[c] - 1] += 1
T.sort()
score = C[0]
score += T[0] * 4
T[1] -= T[0]
T[2] -= T[0]
score += T[1] * 2
T[2] -= T[1]
score += T[2]
if score > max_score:
tie = False
max_score = score
win = n
elif score == max_score:
tie = True
max_score = score
win = n
if tie:
print('tie')
elif win == 0:
print('chef')
else:
print(win + 1) |
def value_at(poly_spec, x):
num=1
total=0
for i,j in enumerate(poly_spec[::-1]):
total+=j*num
num=(num*(x-i))/(i+1)
return round(total, 2) | def value_at(poly_spec, x):
num = 1
total = 0
for (i, j) in enumerate(poly_spec[::-1]):
total += j * num
num = num * (x - i) / (i + 1)
return round(total, 2) |
REV_CLASS_MAP = {
0: "rock",
1: "paper",
2: "scissors",
3: "none"
}
# 0_Rock 1_Paper 2_Scissors
def mapper(val):
return REV_CLASS_MAP[val]
def calculate_winner(move1, move2):
if move1 == move2:
return "Tie"
if move1 == "rock":
if move2 == 2:
return "User"
if move2 == 1:
return "Computer"
if move1 == "paper":
if move2 == 0:
return "User"
if move2 == 2:
return "Computer"
if move1 == "scissors":
if move2 == 2:
return "User"
if move2 == 0:
return "Computer" | rev_class_map = {0: 'rock', 1: 'paper', 2: 'scissors', 3: 'none'}
def mapper(val):
return REV_CLASS_MAP[val]
def calculate_winner(move1, move2):
if move1 == move2:
return 'Tie'
if move1 == 'rock':
if move2 == 2:
return 'User'
if move2 == 1:
return 'Computer'
if move1 == 'paper':
if move2 == 0:
return 'User'
if move2 == 2:
return 'Computer'
if move1 == 'scissors':
if move2 == 2:
return 'User'
if move2 == 0:
return 'Computer' |
class ArtistNotFound(Exception):
pass
class AlbumNotFound(Exception):
pass
| class Artistnotfound(Exception):
pass
class Albumnotfound(Exception):
pass |
standard = {
'rulebook_white': {
'name':'Rulebook White T',
'style': {
'color': '#666666',
'background': '#fff',
'border-color': '#000',
},
},
'rulebook_pink': {
'name':'Rulebook Pink',
'style': {
'color': '#ffffdd',
'background': '#F25292',
'border-color': '#FE98C0',
},
},
'rulebook_blue': {
'name':'Rulebook Blue',
'style': {
'color': '#000',
'background': '#CCE5F3',
},
},
'endeavor': {
'name': 'Endeavor',
'style': {
'color': '#fff',
'background': '#997030',
},
},
'the_watcher': {
'name': 'The Watcher',
'style': {
'color': '#E5BE2F',
'background': '#414042',
},
},
'twilight_knight': {
'name': 'Twilight Knight',
'style': {
'border-color': "#000",
'background': 'radial-gradient(#919B9A, #273736, #0D1110)',
'color': '#fff',
},
},
'sunstalker': {
'name': 'Sunstalker',
'style': {
'background': 'radial-gradient(#907859, #5D5B2E, #24271F)',
'color': '#ffff00',
},
},
'innovate': {
'name': 'Innovation',
'style': {
'border-color': "#0277BD",
'background': 'linear-gradient(to bottom, #4EC7F1, #40ADD0)',
'color': '#fff',
},
},
'location': {
'name': 'Location',
'style': {
'border-color': '#0D743A',
'background': 'linear-gradient(to bottom, #73C26C, #51B952)',
'color': '#fff',
},
},
'dying_lantern': {
'name': 'Dying Lantern',
'style': {
'border-color': "#666",
'background': 'radial-gradient(#C2BA95, #B19A55)',
'color': '#fff',
},
},
'bloodskin': {
'name': 'Bloodskin',
'style': {
'border-color': "#371516",
'background': 'radial-gradient(#BF8D83, #5F1711)',
'color': '#fff',
},
},
'fade': {
'name': 'Fade',
'style': {
'border-color': "#000",
'background': 'radial-gradient(#585550, #26252A)',
'color': '#E5E4E2',
},
},
'vibrant_lantern': {
'name': 'Vibrant Lantern',
'style': {
'border-color': "",
'background': 'radial-gradient(#DED6B3, #E7CE32)',
'color': '#000',
},
},
'proxy_1': {
'name': 'Proxy 1 (Red)',
'style': {
'border-color': "#660000",
'background': 'radial-gradient(#B14529, #9F3E25)',
'color': '#FFF',
},
},
'proxy_2': {
'name': 'Proxy 2 (Brown)',
'style': {
'border-color': "#666",
'background': 'radial-gradient(#5C2800, #572500)',
'color': '#FFF',
},
},
'proxy_3': {
'name': 'Proxy 3 (Green)',
'style': {
'border-color': "#006600",
'background': 'radial-gradient(#ABC0A4, #9FB193)',
'color': '#FFF',
},
},
'proxy_4': {
'name': 'Proxy 4 (Blue)',
'style': {
'border-color': "#000066",
'background': 'radial-gradient(#3261AD, #2D5394)',
'color': '#FFF',
},
},
}
| standard = {'rulebook_white': {'name': 'Rulebook White T', 'style': {'color': '#666666', 'background': '#fff', 'border-color': '#000'}}, 'rulebook_pink': {'name': 'Rulebook Pink', 'style': {'color': '#ffffdd', 'background': '#F25292', 'border-color': '#FE98C0'}}, 'rulebook_blue': {'name': 'Rulebook Blue', 'style': {'color': '#000', 'background': '#CCE5F3'}}, 'endeavor': {'name': 'Endeavor', 'style': {'color': '#fff', 'background': '#997030'}}, 'the_watcher': {'name': 'The Watcher', 'style': {'color': '#E5BE2F', 'background': '#414042'}}, 'twilight_knight': {'name': 'Twilight Knight', 'style': {'border-color': '#000', 'background': 'radial-gradient(#919B9A, #273736, #0D1110)', 'color': '#fff'}}, 'sunstalker': {'name': 'Sunstalker', 'style': {'background': 'radial-gradient(#907859, #5D5B2E, #24271F)', 'color': '#ffff00'}}, 'innovate': {'name': 'Innovation', 'style': {'border-color': '#0277BD', 'background': 'linear-gradient(to bottom, #4EC7F1, #40ADD0)', 'color': '#fff'}}, 'location': {'name': 'Location', 'style': {'border-color': '#0D743A', 'background': 'linear-gradient(to bottom, #73C26C, #51B952)', 'color': '#fff'}}, 'dying_lantern': {'name': 'Dying Lantern', 'style': {'border-color': '#666', 'background': 'radial-gradient(#C2BA95, #B19A55)', 'color': '#fff'}}, 'bloodskin': {'name': 'Bloodskin', 'style': {'border-color': '#371516', 'background': 'radial-gradient(#BF8D83, #5F1711)', 'color': '#fff'}}, 'fade': {'name': 'Fade', 'style': {'border-color': '#000', 'background': 'radial-gradient(#585550, #26252A)', 'color': '#E5E4E2'}}, 'vibrant_lantern': {'name': 'Vibrant Lantern', 'style': {'border-color': '', 'background': 'radial-gradient(#DED6B3, #E7CE32)', 'color': '#000'}}, 'proxy_1': {'name': 'Proxy 1 (Red)', 'style': {'border-color': '#660000', 'background': 'radial-gradient(#B14529, #9F3E25)', 'color': '#FFF'}}, 'proxy_2': {'name': 'Proxy 2 (Brown)', 'style': {'border-color': '#666', 'background': 'radial-gradient(#5C2800, #572500)', 'color': '#FFF'}}, 'proxy_3': {'name': 'Proxy 3 (Green)', 'style': {'border-color': '#006600', 'background': 'radial-gradient(#ABC0A4, #9FB193)', 'color': '#FFF'}}, 'proxy_4': {'name': 'Proxy 4 (Blue)', 'style': {'border-color': '#000066', 'background': 'radial-gradient(#3261AD, #2D5394)', 'color': '#FFF'}}} |
def recurFibonaci(number):
if number <= 1:
return number
else:
return recurFibonaci(number - 1) + recurFibonaci(number - 2)
numberTerms = 10
if numberTerms <= 0:
print("enter positive integers")
else:
print("fibonaci sequence ")
for i in range(numberTerms):
print(recurFibonaci(i))
| def recur_fibonaci(number):
if number <= 1:
return number
else:
return recur_fibonaci(number - 1) + recur_fibonaci(number - 2)
number_terms = 10
if numberTerms <= 0:
print('enter positive integers')
else:
print('fibonaci sequence ')
for i in range(numberTerms):
print(recur_fibonaci(i)) |
cadena_ingresada = input("Ingrese la fecha actual en formato dd/mm/yyyy: ");
separado = cadena_ingresada.split('/');
print(separado);
print(
f'Dia: {separado[0]}', '-',
f'Mes: {separado[1]}', '-',
f'Anio: {separado[2]}'
);
c = cadena_ingresada;
print(
f'Dia: {c[0]}{c[1]}', '-',
f'Mes: {c[3]}{c[4]}', '-',
f'Anio: {c[6]}{c[7]}{c[8]}{c[9]}'
);
| cadena_ingresada = input('Ingrese la fecha actual en formato dd/mm/yyyy: ')
separado = cadena_ingresada.split('/')
print(separado)
print(f'Dia: {separado[0]}', '-', f'Mes: {separado[1]}', '-', f'Anio: {separado[2]}')
c = cadena_ingresada
print(f'Dia: {c[0]}{c[1]}', '-', f'Mes: {c[3]}{c[4]}', '-', f'Anio: {c[6]}{c[7]}{c[8]}{c[9]}') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.