content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
botamusique = None
playlist = None
user = ""
is_proxified = False
dbfile = None
db = None
config = None
bot_logger = None
music_folder = ""
tmp_folder = ""
| botamusique = None
playlist = None
user = ''
is_proxified = False
dbfile = None
db = None
config = None
bot_logger = None
music_folder = ''
tmp_folder = '' |
class Solution:
def postorderTraversal(self, root):
if root is None:
return []
traversal = []
root.parent = None
node = root
while node is not None:
while (node.left is not None or node.right is not None):
if node.left is not None:
node.left.parent = node
node = node.left
elif node.right is not None:
node.right.parent = node
node = node.right
while node is not None:
if node.right is not None and not hasattr(node.right, 'parent'):
node.right.parent = node
node = node.right
break
traversal.append(node.val)
node = node.parent
return traversal
| class Solution:
def postorder_traversal(self, root):
if root is None:
return []
traversal = []
root.parent = None
node = root
while node is not None:
while node.left is not None or node.right is not None:
if node.left is not None:
node.left.parent = node
node = node.left
elif node.right is not None:
node.right.parent = node
node = node.right
while node is not None:
if node.right is not None and (not hasattr(node.right, 'parent')):
node.right.parent = node
node = node.right
break
traversal.append(node.val)
node = node.parent
return traversal |
'''
Given a binary tree, return the preorder traversal of its nodes' values.
Example:
Input: [1,null,2,3]
1
\
2
/
3
Output: [1,2,3]
Follow up: Recursive solution is trivial, could you do it iteratively?
'''
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def preorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
if not root:
return []
stack, result = [root], []
while stack:
element = stack.pop()
result.append(element.val)
if element.right:
stack.append(element.right)
if element.left:
stack.append(element.left)
return result
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def preorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
result = []
def recursive(root, result):
if not root:
return
result.append(root.val)
recursive(root.left, result)
recursive(root.right, result)
recursive(root, result)
return result | """
Given a binary tree, return the preorder traversal of its nodes' values.
Example:
Input: [1,null,2,3]
1
2
/
3
Output: [1,2,3]
Follow up: Recursive solution is trivial, could you do it iteratively?
"""
class Solution(object):
def preorder_traversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
if not root:
return []
(stack, result) = ([root], [])
while stack:
element = stack.pop()
result.append(element.val)
if element.right:
stack.append(element.right)
if element.left:
stack.append(element.left)
return result
class Solution(object):
def preorder_traversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
result = []
def recursive(root, result):
if not root:
return
result.append(root.val)
recursive(root.left, result)
recursive(root.right, result)
recursive(root, result)
return result |
# _*_ coding=utf-8 _*_
__author__ = 'lib.o'
max_title_length = 200
max_tags_length = 200
max_tag_length = 32
max_summary_length = 500
title = u"My blog"
second_title = u"this is my blog"
article_num_per_page = 25
| __author__ = 'lib.o'
max_title_length = 200
max_tags_length = 200
max_tag_length = 32
max_summary_length = 500
title = u'My blog'
second_title = u'this is my blog'
article_num_per_page = 25 |
class User:
"""
This class saves user's ids and states
"""
id = None
state = 0
def __init__(self, vk_id):
"""
Saves user's id
:param vk_id: User's vk id
"""
self.id = vk_id
print("New User with id: " + str(self.id))
def __str__(self):
"""
Converts user into a printable string
:return: Id, State
"""
return "User id: {}, state: {}"\
.format(self.id, self.state)
| class User:
"""
This class saves user's ids and states
"""
id = None
state = 0
def __init__(self, vk_id):
"""
Saves user's id
:param vk_id: User's vk id
"""
self.id = vk_id
print('New User with id: ' + str(self.id))
def __str__(self):
"""
Converts user into a printable string
:return: Id, State
"""
return 'User id: {}, state: {}'.format(self.id, self.state) |
class Entity:
word = ""
start = 0
end = 0
ent_type = ""
def __init__(self, word, start, end, ent_type) :
self.word = word
self.start = start
self.end = end
self.ent_type = ent_type
def __str__(self) :
return self.word
def __repr__(self) :
return self.word
def getWord(self):
return self.word
def getStart(self):
return self.start
def getEnd(self):
return self.end
def getEntityType(self):
return self.ent_type
def isPerson(self):
return self.ent_type == "PERSON" and self.word[-2:] != "'s" | class Entity:
word = ''
start = 0
end = 0
ent_type = ''
def __init__(self, word, start, end, ent_type):
self.word = word
self.start = start
self.end = end
self.ent_type = ent_type
def __str__(self):
return self.word
def __repr__(self):
return self.word
def get_word(self):
return self.word
def get_start(self):
return self.start
def get_end(self):
return self.end
def get_entity_type(self):
return self.ent_type
def is_person(self):
return self.ent_type == 'PERSON' and self.word[-2:] != "'s" |
#function within function
def operator(op_text):
def add_num(num1,num2):
return num1+num2
def subtract_num(num1,num2):
return num1-num2
if op_text == '+':
return add_num
elif op_text == '-':
return subtract_num
else:
return None
# driver code
if __name__ == '__main__':
add_fn=operator('-')
x=add_fn(4,6)
print(x) # prints -2
| def operator(op_text):
def add_num(num1, num2):
return num1 + num2
def subtract_num(num1, num2):
return num1 - num2
if op_text == '+':
return add_num
elif op_text == '-':
return subtract_num
else:
return None
if __name__ == '__main__':
add_fn = operator('-')
x = add_fn(4, 6)
print(x) |
iss_orbit_apogee = 417 * 1000 # Km to m
iss_orbit_perigee = 401 * 1000 # Km to m
earth_mu = 3.986e14 # m^3/s^-2
earth_r = 6.378e6 # m
dist = earth_r + iss_orbit_perigee
grav = earth_mu / dist**2
print(grav) | iss_orbit_apogee = 417 * 1000
iss_orbit_perigee = 401 * 1000
earth_mu = 398600000000000.0
earth_r = 6378000.0
dist = earth_r + iss_orbit_perigee
grav = earth_mu / dist ** 2
print(grav) |
class Compatibility():
def dir_ftp_to_windows(dir):
return dir.replace("/", "\\")
def dir_windows_to_ftp(dir):
return dir.replace("\\", "/") | class Compatibility:
def dir_ftp_to_windows(dir):
return dir.replace('/', '\\')
def dir_windows_to_ftp(dir):
return dir.replace('\\', '/') |
# Process sentence into array of acceptable words
def ProcessSentence(width, sentence):
pWords = []
for word in sentence.split(' '):
if len(word) <= (width - 4):
pWords.append(word)
else:
x = word
while len(x) > (width - 4):
pWords.append(x[:width - 4])
x = x[width - 4:]
pWords.append(x)
return pWords
# Return a nice, boxed sentence
def BoxedSentence(width, sentence):
words = ProcessSentence(width, sentence)
arrays = [
f''' {'_' * (width - 2)} ''',
f'''|{' ' * (width - 2)}|'''
]
cRow = ''
for word in words:
if len(cRow) + len(word) + 1 <= (width - 4):
cRow = f'''{cRow} {word}'''.lstrip(' ')
else:
arrays.append(f'''| {cRow}{' ' * (width - 4 - len(cRow))} |''')
cRow = word
arrays.append(f'''| {cRow}{' ' * (width - 4 - len(cRow))} |''')
arrays.append(f'''|{'_' * (width - 2)}|''')
return arrays
# Return the 3 x 25 meter
def Meter(arrow, answer, closed=True):
row1 = f''' {' ' * (arrow-1)}V{' ' * (25-arrow)} '''
row2 = f'''o{'=' * 25}o'''
if closed:
row3 = f''' {'?' * 25} '''
else:
row3 = [' '] * 25
row3[max(0,answer-3)] = '1'
row3[max(0,answer-2)] = '2'
row3[min(24,answer+1)] = '1'
row3[min(24,answer)] = '2'
row3[answer-1] = '3'
row3 = f''' {''.join(row3)} '''
return [row1, row2, row3]
def FullDisplay(box1, box2, meter):
height = max(len(box1), len(box2))
# Pad stuff
box1 = [(' ' * len(box1[0]))] * (height - len(box1)) + box1
box2 = [(' ' * len(box2[0]))] * (height - len(box2)) + box2
meter = [(' ' * len(meter[0]))] * (height - len(meter)) + meter
return [box1[i] + meter[i] + box2[i] for i in range(height)]
box1 = BoxedSentence(15, 'SOMETHING YOUR FATHER SAY')
box2 = BoxedSentence(15, 'SOMETHING YOUR MOTHER SAY')
print('\n'.join(FullDisplay(box1, box2, Meter(10, 12))))
| def process_sentence(width, sentence):
p_words = []
for word in sentence.split(' '):
if len(word) <= width - 4:
pWords.append(word)
else:
x = word
while len(x) > width - 4:
pWords.append(x[:width - 4])
x = x[width - 4:]
pWords.append(x)
return pWords
def boxed_sentence(width, sentence):
words = process_sentence(width, sentence)
arrays = [f" {'_' * (width - 2)} ", f"|{' ' * (width - 2)}|"]
c_row = ''
for word in words:
if len(cRow) + len(word) + 1 <= width - 4:
c_row = f'{cRow} {word}'.lstrip(' ')
else:
arrays.append(f"| {cRow}{' ' * (width - 4 - len(cRow))} |")
c_row = word
arrays.append(f"| {cRow}{' ' * (width - 4 - len(cRow))} |")
arrays.append(f"|{'_' * (width - 2)}|")
return arrays
def meter(arrow, answer, closed=True):
row1 = f" {' ' * (arrow - 1)}V{' ' * (25 - arrow)} "
row2 = f"o{'=' * 25}o"
if closed:
row3 = f" {'?' * 25} "
else:
row3 = [' '] * 25
row3[max(0, answer - 3)] = '1'
row3[max(0, answer - 2)] = '2'
row3[min(24, answer + 1)] = '1'
row3[min(24, answer)] = '2'
row3[answer - 1] = '3'
row3 = f" {''.join(row3)} "
return [row1, row2, row3]
def full_display(box1, box2, meter):
height = max(len(box1), len(box2))
box1 = [' ' * len(box1[0])] * (height - len(box1)) + box1
box2 = [' ' * len(box2[0])] * (height - len(box2)) + box2
meter = [' ' * len(meter[0])] * (height - len(meter)) + meter
return [box1[i] + meter[i] + box2[i] for i in range(height)]
box1 = boxed_sentence(15, 'SOMETHING YOUR FATHER SAY')
box2 = boxed_sentence(15, 'SOMETHING YOUR MOTHER SAY')
print('\n'.join(full_display(box1, box2, meter(10, 12)))) |
def definition():
"""
Verbose view of courses, for UI.
"""
sql = """
SELECT CONCAT(
ISNULL(a.qualification + ' ', ''),
a.description) as short_name, --standard name
a.pathway, c.aos_code, c.curriculum_id,
a.qualification as award,
a.qualification,
ISNULL(conf.child_count,0) as child_count, --standard name
c.course_id as id --standard name
FROM c_course c
LEFT JOIN c_aos_code a ON a.aos_code = c.aos_code
LEFT JOIN (SELECT course_id, COUNT(course_session_id) as child_count
FROM c_course_config GROUP BY course_id)
conf ON conf.course_id = c.course_id
"""
return sql
| def definition():
"""
Verbose view of courses, for UI.
"""
sql = "\nSELECT CONCAT(\n ISNULL(a.qualification + ' ', ''), \n a.description) as short_name, --standard name \n a.pathway, c.aos_code, c.curriculum_id,\n a.qualification as award,\n a.qualification,\n ISNULL(conf.child_count,0) as child_count, --standard name\n c.course_id as id --standard name\nFROM c_course c\nLEFT JOIN c_aos_code a ON a.aos_code = c.aos_code\nLEFT JOIN (SELECT course_id, COUNT(course_session_id) as child_count \n FROM c_course_config GROUP BY course_id)\n conf ON conf.course_id = c.course_id\n"
return sql |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def hasPathSum(self, root, sum):
if root:
return self.recursive(root, sum)
return False
def recursive(self, node, _sum):
if node.val == _sum and node.left is None and node.right is None:
return True
else:
if node.left and node.right:
return self.recursive(node.left, _sum-node.val) or self.recursive(node.right, _sum-node.val)
elif node.left:
return self.recursive(node.left, _sum-node.val)
if node.right:
return self.recursive(node.right, _sum-node.val)
class Solution2:
def hasPathSum(self, root, sum):
if root is None:
return False
elif root.val == sum and root.left is None and root.right is None:
return True
else:
return self.hasPathSum(root.left, sum-root.val) or self.hasPathSum(root.right, sum-root.val) | class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def has_path_sum(self, root, sum):
if root:
return self.recursive(root, sum)
return False
def recursive(self, node, _sum):
if node.val == _sum and node.left is None and (node.right is None):
return True
else:
if node.left and node.right:
return self.recursive(node.left, _sum - node.val) or self.recursive(node.right, _sum - node.val)
elif node.left:
return self.recursive(node.left, _sum - node.val)
if node.right:
return self.recursive(node.right, _sum - node.val)
class Solution2:
def has_path_sum(self, root, sum):
if root is None:
return False
elif root.val == sum and root.left is None and (root.right is None):
return True
else:
return self.hasPathSum(root.left, sum - root.val) or self.hasPathSum(root.right, sum - root.val) |
class TransactWithCentralOptions(object, IDisposable):
"""
Options to customize Revit behavior when accessing the central model.
TransactWithCentralOptions()
"""
def Dispose(self):
""" Dispose(self: TransactWithCentralOptions) """
pass
def GetLockCallback(self):
"""
GetLockCallback(self: TransactWithCentralOptions) -> ICentralLockedCallback
Gets the callback object that changes Revit's default behavior of endlessly
waiting and repeatedly trying to lock a central model.
"""
pass
def ReleaseUnmanagedResources(self, *args):
""" ReleaseUnmanagedResources(self: TransactWithCentralOptions,disposing: bool) """
pass
def SetLockCallback(self, lockCallback):
"""
SetLockCallback(self: TransactWithCentralOptions,lockCallback: ICentralLockedCallback)
Sets or resets a callback object that would allow an external application to
change Revit's default behavior of endlessly waiting and repeatedly trying to
lock a central model.
"""
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
IsValidObject = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Specifies whether the .NET object represents a valid Revit entity.
Get: IsValidObject(self: TransactWithCentralOptions) -> bool
"""
| class Transactwithcentraloptions(object, IDisposable):
"""
Options to customize Revit behavior when accessing the central model.
TransactWithCentralOptions()
"""
def dispose(self):
""" Dispose(self: TransactWithCentralOptions) """
pass
def get_lock_callback(self):
"""
GetLockCallback(self: TransactWithCentralOptions) -> ICentralLockedCallback
Gets the callback object that changes Revit's default behavior of endlessly
waiting and repeatedly trying to lock a central model.
"""
pass
def release_unmanaged_resources(self, *args):
""" ReleaseUnmanagedResources(self: TransactWithCentralOptions,disposing: bool) """
pass
def set_lock_callback(self, lockCallback):
"""
SetLockCallback(self: TransactWithCentralOptions,lockCallback: ICentralLockedCallback)
Sets or resets a callback object that would allow an external application to
change Revit's default behavior of endlessly waiting and repeatedly trying to
lock a central model.
"""
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
is_valid_object = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Specifies whether the .NET object represents a valid Revit entity.\n\n\n\nGet: IsValidObject(self: TransactWithCentralOptions) -> bool\n\n\n\n' |
'''
8 * 9 ** (number - 1) all mod 1000000007
Status: Accepted
'''
###############################################################################
def main():
"""Read input and print output"""
modulus = 1000000007
for _ in range(int(input())):
print((8 * pow(9, int(input()) - 1, modulus)) % modulus)
###############################################################################
if __name__ == '__main__':
main()
| """
8 * 9 ** (number - 1) all mod 1000000007
Status: Accepted
"""
def main():
"""Read input and print output"""
modulus = 1000000007
for _ in range(int(input())):
print(8 * pow(9, int(input()) - 1, modulus) % modulus)
if __name__ == '__main__':
main() |
def test():
# only check that the code runs and nwbfile.identifier is in the last line of the solution
assert "nwbfile.identifier" in __solution__.strip().splitlines()[-1], "Are you printing the session identifier?"
__msg__.good("Well done!")
| def test():
assert 'nwbfile.identifier' in __solution__.strip().splitlines()[-1], 'Are you printing the session identifier?'
__msg__.good('Well done!') |
x = 12
if x < 10:
print("x is less than 10")
elif x >= 10:
print("x is greater than or equal to 10") | x = 12
if x < 10:
print('x is less than 10')
elif x >= 10:
print('x is greater than or equal to 10') |
"""
SAN.AC.learning
~~~
Trains the voice in the given speech list.
Analyze speech files and retrieve the knowledge about this voice.
Finally, store the parameters of this voice to parody in the future.
:copyright: 2017 by Nhut Hai Huynh.
:license: MIT, see LICENSE for more details.
"""
| """
SAN.AC.learning
~~~
Trains the voice in the given speech list.
Analyze speech files and retrieve the knowledge about this voice.
Finally, store the parameters of this voice to parody in the future.
:copyright: 2017 by Nhut Hai Huynh.
:license: MIT, see LICENSE for more details.
""" |
# My Twitter App Credentials
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = "" | consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = '' |
class ResponseTimeoutException(Exception):
"""Raised when no 'ok' response is received from the pyboard"""
class PyBoardError(Exception):
"""
Raised in liue of an exception raised on a remote PyBoard
See the example ":ref:`examples.basic.remote-exception`" for more
details.
"""
| class Responsetimeoutexception(Exception):
"""Raised when no 'ok' response is received from the pyboard"""
class Pyboarderror(Exception):
"""
Raised in liue of an exception raised on a remote PyBoard
See the example ":ref:`examples.basic.remote-exception`" for more
details.
""" |
def mostrar(nome):
tam = len(nome) + 4
print('~'*tam)
print(f' {nome}')
print('~'*tam)
#PRINT ESPECIAL
mostrar('Boaventura')
mostrar('Maria Laura')
| def mostrar(nome):
tam = len(nome) + 4
print('~' * tam)
print(f' {nome}')
print('~' * tam)
mostrar('Boaventura')
mostrar('Maria Laura') |
# noinspection PyUnusedLocal
# skus = unicode string
def calculate_offers(bill, item, quantity, offers):
bill = bill.copy()
for offer, price in offers:
bill[item]['offers'].append(
{'items': quantity / offer, 'price': price}
)
quantity = quantity % offer
return bill, quantity
def remove_free_items(skus):
def remove_free_item(quantity, offer_quantity, free_item):
to_remove = quantity / offer_quantity
for t in range(to_remove):
if free_item in skus:
skus.pop(skus.index(free_item))
for s in set(skus):
quantity = skus.count(s)
if s == 'E':
offer_quantity = 2
free_item = 'B'
elif s == 'F':
offer_quantity = 3
free_item = 'F'
elif s == 'N':
offer_quantity = 3
free_item = 'M'
elif s == 'R':
offer_quantity = 3
free_item = 'Q'
elif s == 'U':
offer_quantity = 4
free_item = 'U'
else:
continue
remove_free_item(quantity, offer_quantity, free_item)
return skus
def any_of_three(skus, bill):
price_lookup = {
'S': 20,
'T': 20,
'X': 17,
'Y': 20,
'Z': 21,
}
target_skus = sorted([i for i in skus if i in 'STXYZ'] , key=lambda x: price_lookup.get(x, 0), reverse=True)
def pop_items(items_to_pop):
for i in items_to_pop:
skus.pop(skus.index(i))
count = 0
tot = 0
to_pop = []
last_item = None
for item in target_skus:
if item in 'STXYZ':
if item not in bill:
bill[item] = {
'standard':
{'items': 0, 'price': 0},
'offers': [],
}
count += 1
to_pop.append(item)
if count == 3:
count = 0
tot += 1
last_item = item
pop_items(to_pop)
to_pop = []
if last_item is not None:
bill[last_item]['offers'].append({'items': tot, 'price': 45})
return skus, bill
def process_bill(bill):
bill_tot = list()
for v in bill.values():
standard_items = v['standard']['items']
standard_price = v['standard']['price']
bill_tot.append(standard_items * standard_price)
item_offers = v['offers']
for o in item_offers:
items = o['items']
price = o['price']
bill_tot.append(items * price)
return sum(bill_tot)
def checkout(skus):
skus = sorted([c for c in skus])
bill = dict()
skus = remove_free_items(skus)
skus, bill = any_of_three(skus, bill)
for s in set(skus):
quantity = skus.count(s)
offers = tuple()
if s not in bill:
bill[s] = {
'standard':
{'items': 0, 'price': 0},
'offers': [],
}
if s == 'A':
unit_price = 50
offers = ((5, 200), (3, 130))
elif s == 'B':
unit_price = 30
offers = ((2, 45),)
elif s == 'C':
unit_price = 20
elif s == 'D':
unit_price = 15
elif s == 'E':
unit_price = 40
elif s == 'F':
unit_price = 10
elif s == 'G':
unit_price = 20
elif s == 'H':
unit_price = 10
offers = ((10, 80), (5, 45))
elif s == 'I':
unit_price = 35
elif s == 'J':
unit_price = 60
elif s == 'K':
unit_price = 70
offers = ((2, 120),)
elif s == 'L':
unit_price = 90
elif s == 'M':
unit_price = 15
elif s == 'N':
unit_price = 40
elif s == 'O':
unit_price = 10
elif s == 'P':
unit_price = 50
offers = ((5, 200), )
elif s == 'Q':
unit_price = 30
offers = ((3, 80),)
elif s == 'R':
unit_price = 50
elif s == 'S':
unit_price = 20
elif s == 'T':
unit_price = 20
elif s == 'U':
unit_price = 40
elif s == 'V':
unit_price = 50
offers = ((3, 130), (2, 90))
elif s == 'W':
unit_price = 20
elif s == 'X':
unit_price = 17
elif s == 'Y':
unit_price = 20
elif s == 'Z':
unit_price = 21
else:
return -1
bill, quantity = calculate_offers(bill, s, quantity, offers)
bill[s]['standard']['items'] = quantity
bill[s]['standard']['price'] = unit_price
return process_bill(bill)
print(checkout("ABCDEFGHIJKLMNOPQRSTUVW"))
| def calculate_offers(bill, item, quantity, offers):
bill = bill.copy()
for (offer, price) in offers:
bill[item]['offers'].append({'items': quantity / offer, 'price': price})
quantity = quantity % offer
return (bill, quantity)
def remove_free_items(skus):
def remove_free_item(quantity, offer_quantity, free_item):
to_remove = quantity / offer_quantity
for t in range(to_remove):
if free_item in skus:
skus.pop(skus.index(free_item))
for s in set(skus):
quantity = skus.count(s)
if s == 'E':
offer_quantity = 2
free_item = 'B'
elif s == 'F':
offer_quantity = 3
free_item = 'F'
elif s == 'N':
offer_quantity = 3
free_item = 'M'
elif s == 'R':
offer_quantity = 3
free_item = 'Q'
elif s == 'U':
offer_quantity = 4
free_item = 'U'
else:
continue
remove_free_item(quantity, offer_quantity, free_item)
return skus
def any_of_three(skus, bill):
price_lookup = {'S': 20, 'T': 20, 'X': 17, 'Y': 20, 'Z': 21}
target_skus = sorted([i for i in skus if i in 'STXYZ'], key=lambda x: price_lookup.get(x, 0), reverse=True)
def pop_items(items_to_pop):
for i in items_to_pop:
skus.pop(skus.index(i))
count = 0
tot = 0
to_pop = []
last_item = None
for item in target_skus:
if item in 'STXYZ':
if item not in bill:
bill[item] = {'standard': {'items': 0, 'price': 0}, 'offers': []}
count += 1
to_pop.append(item)
if count == 3:
count = 0
tot += 1
last_item = item
pop_items(to_pop)
to_pop = []
if last_item is not None:
bill[last_item]['offers'].append({'items': tot, 'price': 45})
return (skus, bill)
def process_bill(bill):
bill_tot = list()
for v in bill.values():
standard_items = v['standard']['items']
standard_price = v['standard']['price']
bill_tot.append(standard_items * standard_price)
item_offers = v['offers']
for o in item_offers:
items = o['items']
price = o['price']
bill_tot.append(items * price)
return sum(bill_tot)
def checkout(skus):
skus = sorted([c for c in skus])
bill = dict()
skus = remove_free_items(skus)
(skus, bill) = any_of_three(skus, bill)
for s in set(skus):
quantity = skus.count(s)
offers = tuple()
if s not in bill:
bill[s] = {'standard': {'items': 0, 'price': 0}, 'offers': []}
if s == 'A':
unit_price = 50
offers = ((5, 200), (3, 130))
elif s == 'B':
unit_price = 30
offers = ((2, 45),)
elif s == 'C':
unit_price = 20
elif s == 'D':
unit_price = 15
elif s == 'E':
unit_price = 40
elif s == 'F':
unit_price = 10
elif s == 'G':
unit_price = 20
elif s == 'H':
unit_price = 10
offers = ((10, 80), (5, 45))
elif s == 'I':
unit_price = 35
elif s == 'J':
unit_price = 60
elif s == 'K':
unit_price = 70
offers = ((2, 120),)
elif s == 'L':
unit_price = 90
elif s == 'M':
unit_price = 15
elif s == 'N':
unit_price = 40
elif s == 'O':
unit_price = 10
elif s == 'P':
unit_price = 50
offers = ((5, 200),)
elif s == 'Q':
unit_price = 30
offers = ((3, 80),)
elif s == 'R':
unit_price = 50
elif s == 'S':
unit_price = 20
elif s == 'T':
unit_price = 20
elif s == 'U':
unit_price = 40
elif s == 'V':
unit_price = 50
offers = ((3, 130), (2, 90))
elif s == 'W':
unit_price = 20
elif s == 'X':
unit_price = 17
elif s == 'Y':
unit_price = 20
elif s == 'Z':
unit_price = 21
else:
return -1
(bill, quantity) = calculate_offers(bill, s, quantity, offers)
bill[s]['standard']['items'] = quantity
bill[s]['standard']['price'] = unit_price
return process_bill(bill)
print(checkout('ABCDEFGHIJKLMNOPQRSTUVW')) |
PELVIS = 0
SPINE_NAVAL = 1
SPINE_CHEST = 2
NECK = 3
CLAVICLE_LEFT = 4
SHOULDER_LEFT = 5
ELBOW_LEFT = 6
WRIST_LEFT = 7
HAND_LEFT = 8
HANDTIP_LEFT = 9
THUMB_LEFT = 10
CLAVICLE_RIGHT = 11
SHOULDER_RIGHT = 12
ELBOW_RIGHT = 13
WRIST_RIGHT = 14
HAND_RIGHT = 15
HANDTIP_RIGHT = 16
THUMB_RIGHT = 17
HIP_LEFT = 18
KNEE_LEFT = 19
ANKLE_LEFT = 20
FOOT_LEFT = 21
HIP_RIGHT = 22
KNEE_RIGHT = 23
ANKLE_RIGHT = 24
FOOT_RIGHT = 25
HEAD = 26
NOSE = 27
EYE_LEFT = 28
EAR_LEFT = 29
EYE_RIGHT = 30
EAR_RIGHT = 31
PARENT_INDICES = {
SPINE_NAVAL: PELVIS,
SPINE_CHEST: SPINE_NAVAL,
NECK: SPINE_CHEST,
CLAVICLE_LEFT: SPINE_CHEST,
SHOULDER_LEFT: CLAVICLE_LEFT,
ELBOW_LEFT: SHOULDER_LEFT,
WRIST_LEFT: ELBOW_LEFT,
HAND_LEFT: WRIST_LEFT,
HANDTIP_LEFT: HAND_LEFT,
THUMB_LEFT: WRIST_LEFT,
CLAVICLE_RIGHT: SPINE_CHEST,
SHOULDER_RIGHT: CLAVICLE_RIGHT,
ELBOW_RIGHT: SHOULDER_RIGHT,
WRIST_RIGHT: ELBOW_RIGHT,
HAND_RIGHT: WRIST_RIGHT,
HANDTIP_RIGHT: HAND_RIGHT,
THUMB_RIGHT: WRIST_RIGHT,
HIP_LEFT: PELVIS,
KNEE_LEFT: HIP_LEFT,
ANKLE_LEFT: KNEE_LEFT,
FOOT_LEFT: ANKLE_LEFT,
HIP_RIGHT: PELVIS,
KNEE_RIGHT: HIP_RIGHT,
ANKLE_RIGHT: KNEE_RIGHT,
FOOT_RIGHT: ANKLE_RIGHT,
HEAD: NECK,
NOSE: HEAD,
EYE_LEFT: HEAD,
EAR_LEFT: HEAD,
EYE_RIGHT: HEAD,
EAR_RIGHT: HEAD,
}
CHILD_INDICES = {
SPINE_NAVAL: [SPINE_CHEST],
SPINE_CHEST: [NECK, CLAVICLE_LEFT, CLAVICLE_RIGHT],
CLAVICLE_LEFT: [SHOULDER_LEFT],
SHOULDER_LEFT: [ELBOW_LEFT],
ELBOW_LEFT: [WRIST_LEFT],
WRIST_LEFT: [HAND_LEFT, THUMB_LEFT],
HAND_LEFT: [HANDTIP_LEFT],
CLAVICLE_RIGHT: [SHOULDER_RIGHT],
SHOULDER_RIGHT: [ELBOW_RIGHT],
ELBOW_RIGHT: [WRIST_RIGHT],
WRIST_RIGHT: [HAND_RIGHT, THUMB_RIGHT],
HAND_RIGHT: [HANDTIP_RIGHT],
PELVIS: [SPINE_NAVAL, HIP_LEFT, HIP_RIGHT],
HIP_LEFT: [KNEE_LEFT],
KNEE_LEFT: [ANKLE_LEFT],
ANKLE_LEFT: [FOOT_LEFT],
HIP_RIGHT: [KNEE_RIGHT],
KNEE_RIGHT: [ANKLE_RIGHT],
ANKLE_RIGHT: [FOOT_RIGHT],
NECK: [HEAD],
HEAD: [NOSE, EYE_LEFT, EAR_LEFT, EYE_RIGHT, EAR_RIGHT],
}
INDICES_TO_STRINGS = {
PELVIS: 'PELVIS',
SPINE_NAVAL: 'SPINE NAVAL',
SPINE_CHEST: 'SPINE CHEST',
NECK: 'NECK',
CLAVICLE_LEFT: 'CLAVICLE L',
SHOULDER_LEFT: 'SHOULDER L',
ELBOW_LEFT: 'ELBOW L',
WRIST_LEFT: 'WRIST L',
HAND_LEFT: 'HAND L',
HANDTIP_LEFT: 'HANDTIP L',
THUMB_LEFT: 'THUMB L',
CLAVICLE_RIGHT: 'CLAVICE R',
SHOULDER_RIGHT: 'SHOULDER R',
ELBOW_RIGHT: 'ELBOW R',
WRIST_RIGHT: 'WRIST R',
HAND_RIGHT: 'HAND R',
HANDTIP_RIGHT: 'HANDTIP R',
THUMB_RIGHT: 'THUMB R',
HIP_LEFT: 'HIP L',
KNEE_LEFT: 'KNEE L',
ANKLE_LEFT: 'ANKLE L',
FOOT_LEFT: 'FOOT L',
HIP_RIGHT: 'HIP R',
KNEE_RIGHT: 'KNEE R',
ANKLE_RIGHT: 'ANKLE R',
FOOT_RIGHT: 'FOOT R',
HEAD: 'HEAD',
NOSE: 'NOSE',
EYE_LEFT: 'EYE L',
EAR_LEFT: 'EAR L',
EYE_RIGHT: 'EYE R',
EAR_RIGHT: 'EAR R',
}
| pelvis = 0
spine_naval = 1
spine_chest = 2
neck = 3
clavicle_left = 4
shoulder_left = 5
elbow_left = 6
wrist_left = 7
hand_left = 8
handtip_left = 9
thumb_left = 10
clavicle_right = 11
shoulder_right = 12
elbow_right = 13
wrist_right = 14
hand_right = 15
handtip_right = 16
thumb_right = 17
hip_left = 18
knee_left = 19
ankle_left = 20
foot_left = 21
hip_right = 22
knee_right = 23
ankle_right = 24
foot_right = 25
head = 26
nose = 27
eye_left = 28
ear_left = 29
eye_right = 30
ear_right = 31
parent_indices = {SPINE_NAVAL: PELVIS, SPINE_CHEST: SPINE_NAVAL, NECK: SPINE_CHEST, CLAVICLE_LEFT: SPINE_CHEST, SHOULDER_LEFT: CLAVICLE_LEFT, ELBOW_LEFT: SHOULDER_LEFT, WRIST_LEFT: ELBOW_LEFT, HAND_LEFT: WRIST_LEFT, HANDTIP_LEFT: HAND_LEFT, THUMB_LEFT: WRIST_LEFT, CLAVICLE_RIGHT: SPINE_CHEST, SHOULDER_RIGHT: CLAVICLE_RIGHT, ELBOW_RIGHT: SHOULDER_RIGHT, WRIST_RIGHT: ELBOW_RIGHT, HAND_RIGHT: WRIST_RIGHT, HANDTIP_RIGHT: HAND_RIGHT, THUMB_RIGHT: WRIST_RIGHT, HIP_LEFT: PELVIS, KNEE_LEFT: HIP_LEFT, ANKLE_LEFT: KNEE_LEFT, FOOT_LEFT: ANKLE_LEFT, HIP_RIGHT: PELVIS, KNEE_RIGHT: HIP_RIGHT, ANKLE_RIGHT: KNEE_RIGHT, FOOT_RIGHT: ANKLE_RIGHT, HEAD: NECK, NOSE: HEAD, EYE_LEFT: HEAD, EAR_LEFT: HEAD, EYE_RIGHT: HEAD, EAR_RIGHT: HEAD}
child_indices = {SPINE_NAVAL: [SPINE_CHEST], SPINE_CHEST: [NECK, CLAVICLE_LEFT, CLAVICLE_RIGHT], CLAVICLE_LEFT: [SHOULDER_LEFT], SHOULDER_LEFT: [ELBOW_LEFT], ELBOW_LEFT: [WRIST_LEFT], WRIST_LEFT: [HAND_LEFT, THUMB_LEFT], HAND_LEFT: [HANDTIP_LEFT], CLAVICLE_RIGHT: [SHOULDER_RIGHT], SHOULDER_RIGHT: [ELBOW_RIGHT], ELBOW_RIGHT: [WRIST_RIGHT], WRIST_RIGHT: [HAND_RIGHT, THUMB_RIGHT], HAND_RIGHT: [HANDTIP_RIGHT], PELVIS: [SPINE_NAVAL, HIP_LEFT, HIP_RIGHT], HIP_LEFT: [KNEE_LEFT], KNEE_LEFT: [ANKLE_LEFT], ANKLE_LEFT: [FOOT_LEFT], HIP_RIGHT: [KNEE_RIGHT], KNEE_RIGHT: [ANKLE_RIGHT], ANKLE_RIGHT: [FOOT_RIGHT], NECK: [HEAD], HEAD: [NOSE, EYE_LEFT, EAR_LEFT, EYE_RIGHT, EAR_RIGHT]}
indices_to_strings = {PELVIS: 'PELVIS', SPINE_NAVAL: 'SPINE NAVAL', SPINE_CHEST: 'SPINE CHEST', NECK: 'NECK', CLAVICLE_LEFT: 'CLAVICLE L', SHOULDER_LEFT: 'SHOULDER L', ELBOW_LEFT: 'ELBOW L', WRIST_LEFT: 'WRIST L', HAND_LEFT: 'HAND L', HANDTIP_LEFT: 'HANDTIP L', THUMB_LEFT: 'THUMB L', CLAVICLE_RIGHT: 'CLAVICE R', SHOULDER_RIGHT: 'SHOULDER R', ELBOW_RIGHT: 'ELBOW R', WRIST_RIGHT: 'WRIST R', HAND_RIGHT: 'HAND R', HANDTIP_RIGHT: 'HANDTIP R', THUMB_RIGHT: 'THUMB R', HIP_LEFT: 'HIP L', KNEE_LEFT: 'KNEE L', ANKLE_LEFT: 'ANKLE L', FOOT_LEFT: 'FOOT L', HIP_RIGHT: 'HIP R', KNEE_RIGHT: 'KNEE R', ANKLE_RIGHT: 'ANKLE R', FOOT_RIGHT: 'FOOT R', HEAD: 'HEAD', NOSE: 'NOSE', EYE_LEFT: 'EYE L', EAR_LEFT: 'EAR L', EYE_RIGHT: 'EYE R', EAR_RIGHT: 'EAR R'} |
begin_unit
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
string|'"""Utility methods for scheduling."""'
newline|'\n'
nl|'\n'
name|'import'
name|'collections'
newline|'\n'
name|'import'
name|'functools'
newline|'\n'
name|'import'
name|'sys'
newline|'\n'
nl|'\n'
name|'from'
name|'oslo_log'
name|'import'
name|'log'
name|'as'
name|'logging'
newline|'\n'
name|'import'
name|'oslo_messaging'
name|'as'
name|'messaging'
newline|'\n'
name|'from'
name|'oslo_serialization'
name|'import'
name|'jsonutils'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'compute'
name|'import'
name|'flavors'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'compute'
name|'import'
name|'utils'
name|'as'
name|'compute_utils'
newline|'\n'
name|'import'
name|'nova'
op|'.'
name|'conf'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'i18n'
name|'import'
name|'_'
op|','
name|'_LE'
op|','
name|'_LW'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'objects'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'base'
name|'as'
name|'obj_base'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'instance'
name|'as'
name|'obj_instance'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'rpc'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|variable|LOG
name|'LOG'
op|'='
name|'logging'
op|'.'
name|'getLogger'
op|'('
name|'__name__'
op|')'
newline|'\n'
nl|'\n'
DECL|variable|CONF
name|'CONF'
op|'='
name|'nova'
op|'.'
name|'conf'
op|'.'
name|'CONF'
newline|'\n'
nl|'\n'
DECL|variable|GroupDetails
name|'GroupDetails'
op|'='
name|'collections'
op|'.'
name|'namedtuple'
op|'('
string|"'GroupDetails'"
op|','
op|'['
string|"'hosts'"
op|','
string|"'policies'"
op|','
nl|'\n'
string|"'members'"
op|']'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|build_request_spec
name|'def'
name|'build_request_spec'
op|'('
name|'ctxt'
op|','
name|'image'
op|','
name|'instances'
op|','
name|'instance_type'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Build a request_spec for the scheduler.\n\n The request_spec assumes that all instances to be scheduled are the same\n type.\n """'
newline|'\n'
name|'instance'
op|'='
name|'instances'
op|'['
number|'0'
op|']'
newline|'\n'
name|'if'
name|'instance_type'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'isinstance'
op|'('
name|'instance'
op|','
name|'obj_instance'
op|'.'
name|'Instance'
op|')'
op|':'
newline|'\n'
indent|' '
name|'instance_type'
op|'='
name|'instance'
op|'.'
name|'get_flavor'
op|'('
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'instance_type'
op|'='
name|'flavors'
op|'.'
name|'extract_flavor'
op|'('
name|'instance'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'if'
name|'isinstance'
op|'('
name|'instance'
op|','
name|'obj_instance'
op|'.'
name|'Instance'
op|')'
op|':'
newline|'\n'
indent|' '
name|'instance'
op|'='
name|'obj_base'
op|'.'
name|'obj_to_primitive'
op|'('
name|'instance'
op|')'
newline|'\n'
comment|"# obj_to_primitive doesn't copy this enough, so be sure"
nl|'\n'
comment|'# to detach our metadata blob because we modify it below.'
nl|'\n'
name|'instance'
op|'['
string|"'system_metadata'"
op|']'
op|'='
name|'dict'
op|'('
name|'instance'
op|'.'
name|'get'
op|'('
string|"'system_metadata'"
op|','
op|'{'
op|'}'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'isinstance'
op|'('
name|'instance_type'
op|','
name|'objects'
op|'.'
name|'Flavor'
op|')'
op|':'
newline|'\n'
indent|' '
name|'instance_type'
op|'='
name|'obj_base'
op|'.'
name|'obj_to_primitive'
op|'('
name|'instance_type'
op|')'
newline|'\n'
comment|'# NOTE(danms): Replicate this old behavior because the'
nl|'\n'
comment|'# scheduler RPC interface technically expects it to be'
nl|'\n'
comment|'# there. Remove this when we bump the scheduler RPC API to'
nl|'\n'
comment|'# v5.0'
nl|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'flavors'
op|'.'
name|'save_flavor_info'
op|'('
name|'instance'
op|'.'
name|'get'
op|'('
string|"'system_metadata'"
op|','
op|'{'
op|'}'
op|')'
op|','
nl|'\n'
name|'instance_type'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'KeyError'
op|':'
newline|'\n'
comment|"# If the flavor isn't complete (which is legit with a"
nl|'\n'
comment|"# flavor object, just don't put it in the request spec"
nl|'\n'
indent|' '
name|'pass'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'request_spec'
op|'='
op|'{'
nl|'\n'
string|"'image'"
op|':'
name|'image'
name|'or'
op|'{'
op|'}'
op|','
nl|'\n'
string|"'instance_properties'"
op|':'
name|'instance'
op|','
nl|'\n'
string|"'instance_type'"
op|':'
name|'instance_type'
op|','
nl|'\n'
string|"'num_instances'"
op|':'
name|'len'
op|'('
name|'instances'
op|')'
op|'}'
newline|'\n'
name|'return'
name|'jsonutils'
op|'.'
name|'to_primitive'
op|'('
name|'request_spec'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|set_vm_state_and_notify
dedent|''
name|'def'
name|'set_vm_state_and_notify'
op|'('
name|'context'
op|','
name|'instance_uuid'
op|','
name|'service'
op|','
name|'method'
op|','
name|'updates'
op|','
nl|'\n'
name|'ex'
op|','
name|'request_spec'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""changes VM state and notifies."""'
newline|'\n'
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|'"Failed to %(service)s_%(method)s: %(ex)s"'
op|')'
op|','
nl|'\n'
op|'{'
string|"'service'"
op|':'
name|'service'
op|','
string|"'method'"
op|':'
name|'method'
op|','
string|"'ex'"
op|':'
name|'ex'
op|'}'
op|')'
newline|'\n'
nl|'\n'
name|'vm_state'
op|'='
name|'updates'
op|'['
string|"'vm_state'"
op|']'
newline|'\n'
name|'properties'
op|'='
name|'request_spec'
op|'.'
name|'get'
op|'('
string|"'instance_properties'"
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
comment|"# NOTE(vish): We shouldn't get here unless we have a catastrophic"
nl|'\n'
comment|'# failure, so just set the instance to its internal state'
nl|'\n'
name|'notifier'
op|'='
name|'rpc'
op|'.'
name|'get_notifier'
op|'('
name|'service'
op|')'
newline|'\n'
name|'state'
op|'='
name|'vm_state'
op|'.'
name|'upper'
op|'('
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|"'Setting instance to %s state.'"
op|')'
op|','
name|'state'
op|','
nl|'\n'
name|'instance_uuid'
op|'='
name|'instance_uuid'
op|')'
newline|'\n'
nl|'\n'
name|'instance'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'context'
op|','
name|'uuid'
op|'='
name|'instance_uuid'
op|','
nl|'\n'
op|'**'
name|'updates'
op|')'
newline|'\n'
name|'instance'
op|'.'
name|'obj_reset_changes'
op|'('
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
name|'instance'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'compute_utils'
op|'.'
name|'add_instance_fault_from_exc'
op|'('
name|'context'
op|','
nl|'\n'
name|'instance'
op|','
name|'ex'
op|','
name|'sys'
op|'.'
name|'exc_info'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'payload'
op|'='
name|'dict'
op|'('
name|'request_spec'
op|'='
name|'request_spec'
op|','
nl|'\n'
name|'instance_properties'
op|'='
name|'properties'
op|','
nl|'\n'
name|'instance_id'
op|'='
name|'instance_uuid'
op|','
nl|'\n'
name|'state'
op|'='
name|'vm_state'
op|','
nl|'\n'
name|'method'
op|'='
name|'method'
op|','
nl|'\n'
name|'reason'
op|'='
name|'ex'
op|')'
newline|'\n'
nl|'\n'
name|'event_type'
op|'='
string|"'%s.%s'"
op|'%'
op|'('
name|'service'
op|','
name|'method'
op|')'
newline|'\n'
name|'notifier'
op|'.'
name|'error'
op|'('
name|'context'
op|','
name|'event_type'
op|','
name|'payload'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|build_filter_properties
dedent|''
name|'def'
name|'build_filter_properties'
op|'('
name|'scheduler_hints'
op|','
name|'forced_host'
op|','
nl|'\n'
name|'forced_node'
op|','
name|'instance_type'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Build the filter_properties dict from data in the boot request."""'
newline|'\n'
name|'filter_properties'
op|'='
name|'dict'
op|'('
name|'scheduler_hints'
op|'='
name|'scheduler_hints'
op|')'
newline|'\n'
name|'filter_properties'
op|'['
string|"'instance_type'"
op|']'
op|'='
name|'instance_type'
newline|'\n'
comment|"# TODO(alaski): It doesn't seem necessary that these are conditionally"
nl|'\n'
comment|"# added. Let's just add empty lists if not forced_host/node."
nl|'\n'
name|'if'
name|'forced_host'
op|':'
newline|'\n'
indent|' '
name|'filter_properties'
op|'['
string|"'force_hosts'"
op|']'
op|'='
op|'['
name|'forced_host'
op|']'
newline|'\n'
dedent|''
name|'if'
name|'forced_node'
op|':'
newline|'\n'
indent|' '
name|'filter_properties'
op|'['
string|"'force_nodes'"
op|']'
op|'='
op|'['
name|'forced_node'
op|']'
newline|'\n'
dedent|''
name|'return'
name|'filter_properties'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|populate_filter_properties
dedent|''
name|'def'
name|'populate_filter_properties'
op|'('
name|'filter_properties'
op|','
name|'host_state'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Add additional information to the filter properties after a node has\n been selected by the scheduling process.\n """'
newline|'\n'
name|'if'
name|'isinstance'
op|'('
name|'host_state'
op|','
name|'dict'
op|')'
op|':'
newline|'\n'
indent|' '
name|'host'
op|'='
name|'host_state'
op|'['
string|"'host'"
op|']'
newline|'\n'
name|'nodename'
op|'='
name|'host_state'
op|'['
string|"'nodename'"
op|']'
newline|'\n'
name|'limits'
op|'='
name|'host_state'
op|'['
string|"'limits'"
op|']'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'host'
op|'='
name|'host_state'
op|'.'
name|'host'
newline|'\n'
name|'nodename'
op|'='
name|'host_state'
op|'.'
name|'nodename'
newline|'\n'
name|'limits'
op|'='
name|'host_state'
op|'.'
name|'limits'
newline|'\n'
nl|'\n'
comment|'# Adds a retry entry for the selected compute host and node:'
nl|'\n'
dedent|''
name|'_add_retry_host'
op|'('
name|'filter_properties'
op|','
name|'host'
op|','
name|'nodename'
op|')'
newline|'\n'
nl|'\n'
comment|'# Adds oversubscription policy'
nl|'\n'
name|'if'
name|'not'
name|'filter_properties'
op|'.'
name|'get'
op|'('
string|"'force_hosts'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'filter_properties'
op|'['
string|"'limits'"
op|']'
op|'='
name|'limits'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|populate_retry
dedent|''
dedent|''
name|'def'
name|'populate_retry'
op|'('
name|'filter_properties'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'max_attempts'
op|'='
name|'CONF'
op|'.'
name|'scheduler_max_attempts'
newline|'\n'
name|'force_hosts'
op|'='
name|'filter_properties'
op|'.'
name|'get'
op|'('
string|"'force_hosts'"
op|','
op|'['
op|']'
op|')'
newline|'\n'
name|'force_nodes'
op|'='
name|'filter_properties'
op|'.'
name|'get'
op|'('
string|"'force_nodes'"
op|','
op|'['
op|']'
op|')'
newline|'\n'
nl|'\n'
comment|'# In the case of multiple force hosts/nodes, scheduler should not'
nl|'\n'
comment|'# disable retry filter but traverse all force hosts/nodes one by'
nl|'\n'
comment|'# one till scheduler gets a valid target host.'
nl|'\n'
name|'if'
op|'('
name|'max_attempts'
op|'=='
number|'1'
name|'or'
name|'len'
op|'('
name|'force_hosts'
op|')'
op|'=='
number|'1'
nl|'\n'
name|'or'
name|'len'
op|'('
name|'force_nodes'
op|')'
op|'=='
number|'1'
op|')'
op|':'
newline|'\n'
comment|'# re-scheduling is disabled.'
nl|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
comment|'# retry is enabled, update attempt count:'
nl|'\n'
dedent|''
name|'retry'
op|'='
name|'filter_properties'
op|'.'
name|'setdefault'
op|'('
nl|'\n'
string|"'retry'"
op|','
op|'{'
nl|'\n'
string|"'num_attempts'"
op|':'
number|'0'
op|','
nl|'\n'
string|"'hosts'"
op|':'
op|'['
op|']'
comment|'# list of compute hosts tried'
nl|'\n'
op|'}'
op|')'
newline|'\n'
name|'retry'
op|'['
string|"'num_attempts'"
op|']'
op|'+='
number|'1'
newline|'\n'
nl|'\n'
name|'_log_compute_error'
op|'('
name|'instance_uuid'
op|','
name|'retry'
op|')'
newline|'\n'
name|'exc_reason'
op|'='
name|'retry'
op|'.'
name|'pop'
op|'('
string|"'exc_reason'"
op|','
name|'None'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'retry'
op|'['
string|"'num_attempts'"
op|']'
op|'>'
name|'max_attempts'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
op|'('
name|'_'
op|'('
string|"'Exceeded max scheduling attempts %(max_attempts)d '"
nl|'\n'
string|"'for instance %(instance_uuid)s. '"
nl|'\n'
string|"'Last exception: %(exc_reason)s'"
op|')'
nl|'\n'
op|'%'
op|'{'
string|"'max_attempts'"
op|':'
name|'max_attempts'
op|','
nl|'\n'
string|"'instance_uuid'"
op|':'
name|'instance_uuid'
op|','
nl|'\n'
string|"'exc_reason'"
op|':'
name|'exc_reason'
op|'}'
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'MaxRetriesExceeded'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_log_compute_error
dedent|''
dedent|''
name|'def'
name|'_log_compute_error'
op|'('
name|'instance_uuid'
op|','
name|'retry'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""If the request contained an exception from a previous compute\n build/resize operation, log it to aid debugging\n """'
newline|'\n'
name|'exc'
op|'='
name|'retry'
op|'.'
name|'get'
op|'('
string|"'exc'"
op|')'
comment|'# string-ified exception from compute'
newline|'\n'
name|'if'
name|'not'
name|'exc'
op|':'
newline|'\n'
indent|' '
name|'return'
comment|'# no exception info from a previous attempt, skip'
newline|'\n'
nl|'\n'
dedent|''
name|'hosts'
op|'='
name|'retry'
op|'.'
name|'get'
op|'('
string|"'hosts'"
op|','
name|'None'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'hosts'
op|':'
newline|'\n'
indent|' '
name|'return'
comment|'# no previously attempted hosts, skip'
newline|'\n'
nl|'\n'
dedent|''
name|'last_host'
op|','
name|'last_node'
op|'='
name|'hosts'
op|'['
op|'-'
number|'1'
op|']'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'_LE'
op|'('
string|"'Error from last host: %(last_host)s (node %(last_node)s):'"
nl|'\n'
string|"' %(exc)s'"
op|')'
op|','
nl|'\n'
op|'{'
string|"'last_host'"
op|':'
name|'last_host'
op|','
nl|'\n'
string|"'last_node'"
op|':'
name|'last_node'
op|','
nl|'\n'
string|"'exc'"
op|':'
name|'exc'
op|'}'
op|','
nl|'\n'
name|'instance_uuid'
op|'='
name|'instance_uuid'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_add_retry_host
dedent|''
name|'def'
name|'_add_retry_host'
op|'('
name|'filter_properties'
op|','
name|'host'
op|','
name|'node'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Add a retry entry for the selected compute node. In the event that\n the request gets re-scheduled, this entry will signal that the given\n node has already been tried.\n """'
newline|'\n'
name|'retry'
op|'='
name|'filter_properties'
op|'.'
name|'get'
op|'('
string|"'retry'"
op|','
name|'None'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'retry'
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
dedent|''
name|'hosts'
op|'='
name|'retry'
op|'['
string|"'hosts'"
op|']'
newline|'\n'
name|'hosts'
op|'.'
name|'append'
op|'('
op|'['
name|'host'
op|','
name|'node'
op|']'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|parse_options
dedent|''
name|'def'
name|'parse_options'
op|'('
name|'opts'
op|','
name|'sep'
op|'='
string|"'='"
op|','
name|'converter'
op|'='
name|'str'
op|','
name|'name'
op|'='
string|'""'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Parse a list of options, each in the format of <key><sep><value>. Also\n use the converter to convert the value into desired type.\n\n :params opts: list of options, e.g. from oslo_config.cfg.ListOpt\n :params sep: the separator\n :params converter: callable object to convert the value, should raise\n ValueError for conversion failure\n :params name: name of the option\n\n :returns: a lists of tuple of values (key, converted_value)\n """'
newline|'\n'
name|'good'
op|'='
op|'['
op|']'
newline|'\n'
name|'bad'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'opt'
name|'in'
name|'opts'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'key'
op|','
name|'seen_sep'
op|','
name|'value'
op|'='
name|'opt'
op|'.'
name|'partition'
op|'('
name|'sep'
op|')'
newline|'\n'
name|'value'
op|'='
name|'converter'
op|'('
name|'value'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'key'
op|'='
name|'None'
newline|'\n'
name|'value'
op|'='
name|'None'
newline|'\n'
dedent|''
name|'if'
name|'key'
name|'and'
name|'seen_sep'
name|'and'
name|'value'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'good'
op|'.'
name|'append'
op|'('
op|'('
name|'key'
op|','
name|'value'
op|')'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'bad'
op|'.'
name|'append'
op|'('
name|'opt'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'if'
name|'bad'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|'"Ignoring the invalid elements of the option "'
nl|'\n'
string|'"%(name)s: %(options)s"'
op|')'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'name'
op|','
nl|'\n'
string|"'options'"
op|':'
string|'", "'
op|'.'
name|'join'
op|'('
name|'bad'
op|')'
op|'}'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'good'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|validate_filter
dedent|''
name|'def'
name|'validate_filter'
op|'('
name|'filter'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Validates that the filter is configured in the default filters."""'
newline|'\n'
name|'return'
name|'filter'
name|'in'
name|'CONF'
op|'.'
name|'scheduler_default_filters'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|validate_weigher
dedent|''
name|'def'
name|'validate_weigher'
op|'('
name|'weigher'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Validates that the weigher is configured in the default weighers."""'
newline|'\n'
name|'if'
string|"'nova.scheduler.weights.all_weighers'"
name|'in'
name|'CONF'
op|'.'
name|'scheduler_weight_classes'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'True'
newline|'\n'
dedent|''
name|'return'
name|'weigher'
name|'in'
name|'CONF'
op|'.'
name|'scheduler_weight_classes'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|variable|_SUPPORTS_AFFINITY
dedent|''
name|'_SUPPORTS_AFFINITY'
op|'='
name|'None'
newline|'\n'
DECL|variable|_SUPPORTS_ANTI_AFFINITY
name|'_SUPPORTS_ANTI_AFFINITY'
op|'='
name|'None'
newline|'\n'
DECL|variable|_SUPPORTS_SOFT_AFFINITY
name|'_SUPPORTS_SOFT_AFFINITY'
op|'='
name|'None'
newline|'\n'
DECL|variable|_SUPPORTS_SOFT_ANTI_AFFINITY
name|'_SUPPORTS_SOFT_ANTI_AFFINITY'
op|'='
name|'None'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_group_details
name|'def'
name|'_get_group_details'
op|'('
name|'context'
op|','
name|'instance_uuid'
op|','
name|'user_group_hosts'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Provide group_hosts and group_policies sets related to instances if\n those instances are belonging to a group and if corresponding filters are\n enabled.\n\n :param instance_uuid: UUID of the instance to check\n :param user_group_hosts: Hosts from the group or empty set\n\n :returns: None or namedtuple GroupDetails\n """'
newline|'\n'
name|'global'
name|'_SUPPORTS_AFFINITY'
newline|'\n'
name|'if'
name|'_SUPPORTS_AFFINITY'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'_SUPPORTS_AFFINITY'
op|'='
name|'validate_filter'
op|'('
nl|'\n'
string|"'ServerGroupAffinityFilter'"
op|')'
newline|'\n'
dedent|''
name|'global'
name|'_SUPPORTS_ANTI_AFFINITY'
newline|'\n'
name|'if'
name|'_SUPPORTS_ANTI_AFFINITY'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'_SUPPORTS_ANTI_AFFINITY'
op|'='
name|'validate_filter'
op|'('
nl|'\n'
string|"'ServerGroupAntiAffinityFilter'"
op|')'
newline|'\n'
dedent|''
name|'global'
name|'_SUPPORTS_SOFT_AFFINITY'
newline|'\n'
name|'if'
name|'_SUPPORTS_SOFT_AFFINITY'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'_SUPPORTS_SOFT_AFFINITY'
op|'='
name|'validate_weigher'
op|'('
nl|'\n'
string|"'nova.scheduler.weights.affinity.ServerGroupSoftAffinityWeigher'"
op|')'
newline|'\n'
dedent|''
name|'global'
name|'_SUPPORTS_SOFT_ANTI_AFFINITY'
newline|'\n'
name|'if'
name|'_SUPPORTS_SOFT_ANTI_AFFINITY'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'_SUPPORTS_SOFT_ANTI_AFFINITY'
op|'='
name|'validate_weigher'
op|'('
nl|'\n'
string|"'nova.scheduler.weights.affinity.'"
nl|'\n'
string|"'ServerGroupSoftAntiAffinityWeigher'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'not'
name|'instance_uuid'
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'group'
op|'='
name|'objects'
op|'.'
name|'InstanceGroup'
op|'.'
name|'get_by_instance_uuid'
op|'('
name|'context'
op|','
nl|'\n'
name|'instance_uuid'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceGroupNotFound'
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
dedent|''
name|'policies'
op|'='
name|'set'
op|'('
op|'('
string|"'anti-affinity'"
op|','
string|"'affinity'"
op|','
string|"'soft-affinity'"
op|','
nl|'\n'
string|"'soft-anti-affinity'"
op|')'
op|')'
newline|'\n'
name|'if'
name|'any'
op|'('
op|'('
name|'policy'
name|'in'
name|'policies'
op|')'
name|'for'
name|'policy'
name|'in'
name|'group'
op|'.'
name|'policies'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'_SUPPORTS_AFFINITY'
name|'and'
string|"'affinity'"
name|'in'
name|'group'
op|'.'
name|'policies'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"ServerGroupAffinityFilter not configured"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'UnsupportedPolicyException'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'not'
name|'_SUPPORTS_ANTI_AFFINITY'
name|'and'
string|"'anti-affinity'"
name|'in'
name|'group'
op|'.'
name|'policies'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"ServerGroupAntiAffinityFilter not configured"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'UnsupportedPolicyException'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'if'
op|'('
name|'not'
name|'_SUPPORTS_SOFT_AFFINITY'
nl|'\n'
name|'and'
string|"'soft-affinity'"
name|'in'
name|'group'
op|'.'
name|'policies'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"ServerGroupSoftAffinityWeigher not configured"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'UnsupportedPolicyException'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'if'
op|'('
name|'not'
name|'_SUPPORTS_SOFT_ANTI_AFFINITY'
nl|'\n'
name|'and'
string|"'soft-anti-affinity'"
name|'in'
name|'group'
op|'.'
name|'policies'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"ServerGroupSoftAntiAffinityWeigher not configured"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'UnsupportedPolicyException'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'group_hosts'
op|'='
name|'set'
op|'('
name|'group'
op|'.'
name|'get_hosts'
op|'('
op|')'
op|')'
newline|'\n'
name|'user_hosts'
op|'='
name|'set'
op|'('
name|'user_group_hosts'
op|')'
name|'if'
name|'user_group_hosts'
name|'else'
name|'set'
op|'('
op|')'
newline|'\n'
name|'return'
name|'GroupDetails'
op|'('
name|'hosts'
op|'='
name|'user_hosts'
op|'|'
name|'group_hosts'
op|','
nl|'\n'
name|'policies'
op|'='
name|'group'
op|'.'
name|'policies'
op|','
name|'members'
op|'='
name|'group'
op|'.'
name|'members'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|setup_instance_group
dedent|''
dedent|''
name|'def'
name|'setup_instance_group'
op|'('
name|'context'
op|','
name|'request_spec'
op|','
name|'filter_properties'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Add group_hosts and group_policies fields to filter_properties dict\n based on instance uuids provided in request_spec, if those instances are\n belonging to a group.\n\n :param request_spec: Request spec\n :param filter_properties: Filter properties\n """'
newline|'\n'
name|'group_hosts'
op|'='
name|'filter_properties'
op|'.'
name|'get'
op|'('
string|"'group_hosts'"
op|')'
newline|'\n'
comment|"# NOTE(sbauza) If there are multiple instance UUIDs, it's a boot"
nl|'\n'
comment|"# request and they will all be in the same group, so it's safe to"
nl|'\n'
comment|'# only check the first one.'
nl|'\n'
name|'instance_uuid'
op|'='
name|'request_spec'
op|'.'
name|'get'
op|'('
string|"'instance_properties'"
op|','
op|'{'
op|'}'
op|')'
op|'.'
name|'get'
op|'('
string|"'uuid'"
op|')'
newline|'\n'
name|'group_info'
op|'='
name|'_get_group_details'
op|'('
name|'context'
op|','
name|'instance_uuid'
op|','
name|'group_hosts'
op|')'
newline|'\n'
name|'if'
name|'group_info'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'filter_properties'
op|'['
string|"'group_updated'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'filter_properties'
op|'['
string|"'group_hosts'"
op|']'
op|'='
name|'group_info'
op|'.'
name|'hosts'
newline|'\n'
name|'filter_properties'
op|'['
string|"'group_policies'"
op|']'
op|'='
name|'group_info'
op|'.'
name|'policies'
newline|'\n'
name|'filter_properties'
op|'['
string|"'group_members'"
op|']'
op|'='
name|'group_info'
op|'.'
name|'members'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|retry_on_timeout
dedent|''
dedent|''
name|'def'
name|'retry_on_timeout'
op|'('
name|'retries'
op|'='
number|'1'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Retry the call in case a MessagingTimeout is raised.\n\n A decorator for retrying calls when a service dies mid-request.\n\n :param retries: Number of retries\n :returns: Decorator\n """'
newline|'\n'
DECL|function|outer
name|'def'
name|'outer'
op|'('
name|'func'
op|')'
op|':'
newline|'\n'
indent|' '
op|'@'
name|'functools'
op|'.'
name|'wraps'
op|'('
name|'func'
op|')'
newline|'\n'
DECL|function|wrapped
name|'def'
name|'wrapped'
op|'('
op|'*'
name|'args'
op|','
op|'**'
name|'kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
name|'attempt'
op|'='
number|'0'
newline|'\n'
name|'while'
name|'True'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'func'
op|'('
op|'*'
name|'args'
op|','
op|'**'
name|'kwargs'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'messaging'
op|'.'
name|'MessagingTimeout'
op|':'
newline|'\n'
indent|' '
name|'attempt'
op|'+='
number|'1'
newline|'\n'
name|'if'
name|'attempt'
op|'<='
name|'retries'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
nl|'\n'
string|'"Retrying %(name)s after a MessagingTimeout, "'
nl|'\n'
string|'"attempt %(attempt)s of %(retries)s."'
op|')'
op|','
nl|'\n'
op|'{'
string|"'attempt'"
op|':'
name|'attempt'
op|','
string|"'retries'"
op|':'
name|'retries'
op|','
nl|'\n'
string|"'name'"
op|':'
name|'func'
op|'.'
name|'__name__'
op|'}'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'raise'
newline|'\n'
dedent|''
dedent|''
dedent|''
dedent|''
name|'return'
name|'wrapped'
newline|'\n'
dedent|''
name|'return'
name|'outer'
newline|'\n'
nl|'\n'
DECL|variable|retry_select_destinations
dedent|''
name|'retry_select_destinations'
op|'='
name|'retry_on_timeout'
op|'('
name|'CONF'
op|'.'
name|'scheduler_max_attempts'
op|'-'
number|'1'
op|')'
newline|'\n'
endmarker|''
end_unit
| begin_unit
comment | '# All Rights Reserved.'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl | '\n'
comment | '# not use this file except in compliance with the License. You may obtain'
nl | '\n'
comment | '# a copy of the License at'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# http://www.apache.org/licenses/LICENSE-2.0'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# Unless required by applicable law or agreed to in writing, software'
nl | '\n'
comment | '# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl | '\n'
comment | '# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl | '\n'
comment | '# License for the specific language governing permissions and limitations'
nl | '\n'
comment | '# under the License.'
nl | '\n'
nl | '\n'
string | '"""Utility methods for scheduling."""'
newline | '\n'
nl | '\n'
name | 'import'
name | 'collections'
newline | '\n'
name | 'import'
name | 'functools'
newline | '\n'
name | 'import'
name | 'sys'
newline | '\n'
nl | '\n'
name | 'from'
name | 'oslo_log'
name | 'import'
name | 'log'
name | 'as'
name | 'logging'
newline | '\n'
name | 'import'
name | 'oslo_messaging'
name | 'as'
name | 'messaging'
newline | '\n'
name | 'from'
name | 'oslo_serialization'
name | 'import'
name | 'jsonutils'
newline | '\n'
nl | '\n'
name | 'from'
name | 'nova'
op | '.'
name | 'compute'
name | 'import'
name | 'flavors'
newline | '\n'
name | 'from'
name | 'nova'
op | '.'
name | 'compute'
name | 'import'
name | 'utils'
name | 'as'
name | 'compute_utils'
newline | '\n'
name | 'import'
name | 'nova'
op | '.'
name | 'conf'
newline | '\n'
name | 'from'
name | 'nova'
name | 'import'
name | 'exception'
newline | '\n'
name | 'from'
name | 'nova'
op | '.'
name | 'i18n'
name | 'import'
name | '_'
op | ','
name | '_LE'
op | ','
name | '_LW'
newline | '\n'
name | 'from'
name | 'nova'
name | 'import'
name | 'objects'
newline | '\n'
name | 'from'
name | 'nova'
op | '.'
name | 'objects'
name | 'import'
name | 'base'
name | 'as'
name | 'obj_base'
newline | '\n'
name | 'from'
name | 'nova'
op | '.'
name | 'objects'
name | 'import'
name | 'instance'
name | 'as'
name | 'obj_instance'
newline | '\n'
name | 'from'
name | 'nova'
name | 'import'
name | 'rpc'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | variable | LOG
name | 'LOG'
op | '='
name | 'logging'
op | '.'
name | 'getLogger'
op | '('
name | '__name__'
op | ')'
newline | '\n'
nl | '\n'
DECL | variable | CONF
name | 'CONF'
op | '='
name | 'nova'
op | '.'
name | 'conf'
op | '.'
name | 'CONF'
newline | '\n'
nl | '\n'
DECL | variable | GroupDetails
name | 'GroupDetails'
op | '='
name | 'collections'
op | '.'
name | 'namedtuple'
op | '('
string | "'GroupDetails'"
op | ','
op | '['
string | "'hosts'"
op | ','
string | "'policies'"
op | ','
nl | '\n'
string | "'members'"
op | ']'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | build_request_spec
name | 'def'
name | 'build_request_spec'
op | '('
name | 'ctxt'
op | ','
name | 'image'
op | ','
name | 'instances'
op | ','
name | 'instance_type'
op | '='
name | 'None'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Build a request_spec for the scheduler.\n\n The request_spec assumes that all instances to be scheduled are the same\n type.\n """'
newline | '\n'
name | 'instance'
op | '='
name | 'instances'
op | '['
number | '0'
op | ']'
newline | '\n'
name | 'if'
name | 'instance_type'
name | 'is'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | 'if'
name | 'isinstance'
op | '('
name | 'instance'
op | ','
name | 'obj_instance'
op | '.'
name | 'Instance'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'instance_type'
op | '='
name | 'instance'
op | '.'
name | 'get_flavor'
op | '('
op | ')'
newline | '\n'
dedent | ''
name | 'else'
op | ':'
newline | '\n'
indent | ' '
name | 'instance_type'
op | '='
name | 'flavors'
op | '.'
name | 'extract_flavor'
op | '('
name | 'instance'
op | ')'
newline | '\n'
nl | '\n'
dedent | ''
dedent | ''
name | 'if'
name | 'isinstance'
op | '('
name | 'instance'
op | ','
name | 'obj_instance'
op | '.'
name | 'Instance'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'instance'
op | '='
name | 'obj_base'
op | '.'
name | 'obj_to_primitive'
op | '('
name | 'instance'
op | ')'
newline | '\n'
comment | "# obj_to_primitive doesn't copy this enough, so be sure"
nl | '\n'
comment | '# to detach our metadata blob because we modify it below.'
nl | '\n'
name | 'instance'
op | '['
string | "'system_metadata'"
op | ']'
op | '='
name | 'dict'
op | '('
name | 'instance'
op | '.'
name | 'get'
op | '('
string | "'system_metadata'"
op | ','
op | '{'
op | '}'
op | ')'
op | ')'
newline | '\n'
nl | '\n'
dedent | ''
name | 'if'
name | 'isinstance'
op | '('
name | 'instance_type'
op | ','
name | 'objects'
op | '.'
name | 'Flavor'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'instance_type'
op | '='
name | 'obj_base'
op | '.'
name | 'obj_to_primitive'
op | '('
name | 'instance_type'
op | ')'
newline | '\n'
comment | '# NOTE(danms): Replicate this old behavior because the'
nl | '\n'
comment | '# scheduler RPC interface technically expects it to be'
nl | '\n'
comment | '# there. Remove this when we bump the scheduler RPC API to'
nl | '\n'
comment | '# v5.0'
nl | '\n'
name | 'try'
op | ':'
newline | '\n'
indent | ' '
name | 'flavors'
op | '.'
name | 'save_flavor_info'
op | '('
name | 'instance'
op | '.'
name | 'get'
op | '('
string | "'system_metadata'"
op | ','
op | '{'
op | '}'
op | ')'
op | ','
nl | '\n'
name | 'instance_type'
op | ')'
newline | '\n'
dedent | ''
name | 'except'
name | 'KeyError'
op | ':'
newline | '\n'
comment | "# If the flavor isn't complete (which is legit with a"
nl | '\n'
comment | "# flavor object, just don't put it in the request spec"
nl | '\n'
indent | ' '
name | 'pass'
newline | '\n'
nl | '\n'
dedent | ''
dedent | ''
name | 'request_spec'
op | '='
op | '{'
nl | '\n'
string | "'image'"
op | ':'
name | 'image'
name | 'or'
op | '{'
op | '}'
op | ','
nl | '\n'
string | "'instance_properties'"
op | ':'
name | 'instance'
op | ','
nl | '\n'
string | "'instance_type'"
op | ':'
name | 'instance_type'
op | ','
nl | '\n'
string | "'num_instances'"
op | ':'
name | 'len'
op | '('
name | 'instances'
op | ')'
op | '}'
newline | '\n'
name | 'return'
name | 'jsonutils'
op | '.'
name | 'to_primitive'
op | '('
name | 'request_spec'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | set_vm_state_and_notify
dedent | ''
name | 'def'
name | 'set_vm_state_and_notify'
op | '('
name | 'context'
op | ','
name | 'instance_uuid'
op | ','
name | 'service'
op | ','
name | 'method'
op | ','
name | 'updates'
op | ','
nl | '\n'
name | 'ex'
op | ','
name | 'request_spec'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""changes VM state and notifies."""'
newline | '\n'
name | 'LOG'
op | '.'
name | 'warning'
op | '('
name | '_LW'
op | '('
string | '"Failed to %(service)s_%(method)s: %(ex)s"'
op | ')'
op | ','
nl | '\n'
op | '{'
string | "'service'"
op | ':'
name | 'service'
op | ','
string | "'method'"
op | ':'
name | 'method'
op | ','
string | "'ex'"
op | ':'
name | 'ex'
op | '}'
op | ')'
newline | '\n'
nl | '\n'
name | 'vm_state'
op | '='
name | 'updates'
op | '['
string | "'vm_state'"
op | ']'
newline | '\n'
name | 'properties'
op | '='
name | 'request_spec'
op | '.'
name | 'get'
op | '('
string | "'instance_properties'"
op | ','
op | '{'
op | '}'
op | ')'
newline | '\n'
comment | "# NOTE(vish): We shouldn't get here unless we have a catastrophic"
nl | '\n'
comment | '# failure, so just set the instance to its internal state'
nl | '\n'
name | 'notifier'
op | '='
name | 'rpc'
op | '.'
name | 'get_notifier'
op | '('
name | 'service'
op | ')'
newline | '\n'
name | 'state'
op | '='
name | 'vm_state'
op | '.'
name | 'upper'
op | '('
op | ')'
newline | '\n'
name | 'LOG'
op | '.'
name | 'warning'
op | '('
name | '_LW'
op | '('
string | "'Setting instance to %s state.'"
op | ')'
op | ','
name | 'state'
op | ','
nl | '\n'
name | 'instance_uuid'
op | '='
name | 'instance_uuid'
op | ')'
newline | '\n'
nl | '\n'
name | 'instance'
op | '='
name | 'objects'
op | '.'
name | 'Instance'
op | '('
name | 'context'
op | '='
name | 'context'
op | ','
name | 'uuid'
op | '='
name | 'instance_uuid'
op | ','
nl | '\n'
op | '**'
name | 'updates'
op | ')'
newline | '\n'
name | 'instance'
op | '.'
name | 'obj_reset_changes'
op | '('
op | '['
string | "'uuid'"
op | ']'
op | ')'
newline | '\n'
name | 'instance'
op | '.'
name | 'save'
op | '('
op | ')'
newline | '\n'
name | 'compute_utils'
op | '.'
name | 'add_instance_fault_from_exc'
op | '('
name | 'context'
op | ','
nl | '\n'
name | 'instance'
op | ','
name | 'ex'
op | ','
name | 'sys'
op | '.'
name | 'exc_info'
op | '('
op | ')'
op | ')'
newline | '\n'
nl | '\n'
name | 'payload'
op | '='
name | 'dict'
op | '('
name | 'request_spec'
op | '='
name | 'request_spec'
op | ','
nl | '\n'
name | 'instance_properties'
op | '='
name | 'properties'
op | ','
nl | '\n'
name | 'instance_id'
op | '='
name | 'instance_uuid'
op | ','
nl | '\n'
name | 'state'
op | '='
name | 'vm_state'
op | ','
nl | '\n'
name | 'method'
op | '='
name | 'method'
op | ','
nl | '\n'
name | 'reason'
op | '='
name | 'ex'
op | ')'
newline | '\n'
nl | '\n'
name | 'event_type'
op | '='
string | "'%s.%s'"
op | '%'
op | '('
name | 'service'
op | ','
name | 'method'
op | ')'
newline | '\n'
name | 'notifier'
op | '.'
name | 'error'
op | '('
name | 'context'
op | ','
name | 'event_type'
op | ','
name | 'payload'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | build_filter_properties
dedent | ''
name | 'def'
name | 'build_filter_properties'
op | '('
name | 'scheduler_hints'
op | ','
name | 'forced_host'
op | ','
nl | '\n'
name | 'forced_node'
op | ','
name | 'instance_type'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Build the filter_properties dict from data in the boot request."""'
newline | '\n'
name | 'filter_properties'
op | '='
name | 'dict'
op | '('
name | 'scheduler_hints'
op | '='
name | 'scheduler_hints'
op | ')'
newline | '\n'
name | 'filter_properties'
op | '['
string | "'instance_type'"
op | ']'
op | '='
name | 'instance_type'
newline | '\n'
comment | "# TODO(alaski): It doesn't seem necessary that these are conditionally"
nl | '\n'
comment | "# added. Let's just add empty lists if not forced_host/node."
nl | '\n'
name | 'if'
name | 'forced_host'
op | ':'
newline | '\n'
indent | ' '
name | 'filter_properties'
op | '['
string | "'force_hosts'"
op | ']'
op | '='
op | '['
name | 'forced_host'
op | ']'
newline | '\n'
dedent | ''
name | 'if'
name | 'forced_node'
op | ':'
newline | '\n'
indent | ' '
name | 'filter_properties'
op | '['
string | "'force_nodes'"
op | ']'
op | '='
op | '['
name | 'forced_node'
op | ']'
newline | '\n'
dedent | ''
name | 'return'
name | 'filter_properties'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | populate_filter_properties
dedent | ''
name | 'def'
name | 'populate_filter_properties'
op | '('
name | 'filter_properties'
op | ','
name | 'host_state'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Add additional information to the filter properties after a node has\n been selected by the scheduling process.\n """'
newline | '\n'
name | 'if'
name | 'isinstance'
op | '('
name | 'host_state'
op | ','
name | 'dict'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'host'
op | '='
name | 'host_state'
op | '['
string | "'host'"
op | ']'
newline | '\n'
name | 'nodename'
op | '='
name | 'host_state'
op | '['
string | "'nodename'"
op | ']'
newline | '\n'
name | 'limits'
op | '='
name | 'host_state'
op | '['
string | "'limits'"
op | ']'
newline | '\n'
dedent | ''
name | 'else'
op | ':'
newline | '\n'
indent | ' '
name | 'host'
op | '='
name | 'host_state'
op | '.'
name | 'host'
newline | '\n'
name | 'nodename'
op | '='
name | 'host_state'
op | '.'
name | 'nodename'
newline | '\n'
name | 'limits'
op | '='
name | 'host_state'
op | '.'
name | 'limits'
newline | '\n'
nl | '\n'
comment | '# Adds a retry entry for the selected compute host and node:'
nl | '\n'
dedent | ''
name | '_add_retry_host'
op | '('
name | 'filter_properties'
op | ','
name | 'host'
op | ','
name | 'nodename'
op | ')'
newline | '\n'
nl | '\n'
comment | '# Adds oversubscription policy'
nl | '\n'
name | 'if'
name | 'not'
name | 'filter_properties'
op | '.'
name | 'get'
op | '('
string | "'force_hosts'"
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'filter_properties'
op | '['
string | "'limits'"
op | ']'
op | '='
name | 'limits'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | populate_retry
dedent | ''
dedent | ''
name | 'def'
name | 'populate_retry'
op | '('
name | 'filter_properties'
op | ','
name | 'instance_uuid'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'max_attempts'
op | '='
name | 'CONF'
op | '.'
name | 'scheduler_max_attempts'
newline | '\n'
name | 'force_hosts'
op | '='
name | 'filter_properties'
op | '.'
name | 'get'
op | '('
string | "'force_hosts'"
op | ','
op | '['
op | ']'
op | ')'
newline | '\n'
name | 'force_nodes'
op | '='
name | 'filter_properties'
op | '.'
name | 'get'
op | '('
string | "'force_nodes'"
op | ','
op | '['
op | ']'
op | ')'
newline | '\n'
nl | '\n'
comment | '# In the case of multiple force hosts/nodes, scheduler should not'
nl | '\n'
comment | '# disable retry filter but traverse all force hosts/nodes one by'
nl | '\n'
comment | '# one till scheduler gets a valid target host.'
nl | '\n'
name | 'if'
op | '('
name | 'max_attempts'
op | '=='
number | '1'
name | 'or'
name | 'len'
op | '('
name | 'force_hosts'
op | ')'
op | '=='
number | '1'
nl | '\n'
name | 'or'
name | 'len'
op | '('
name | 'force_nodes'
op | ')'
op | '=='
number | '1'
op | ')'
op | ':'
newline | '\n'
comment | '# re-scheduling is disabled.'
nl | '\n'
indent | ' '
name | 'return'
newline | '\n'
nl | '\n'
comment | '# retry is enabled, update attempt count:'
nl | '\n'
dedent | ''
name | 'retry'
op | '='
name | 'filter_properties'
op | '.'
name | 'setdefault'
op | '('
nl | '\n'
string | "'retry'"
op | ','
op | '{'
nl | '\n'
string | "'num_attempts'"
op | ':'
number | '0'
op | ','
nl | '\n'
string | "'hosts'"
op | ':'
op | '['
op | ']'
comment | '# list of compute hosts tried'
nl | '\n'
op | '}'
op | ')'
newline | '\n'
name | 'retry'
op | '['
string | "'num_attempts'"
op | ']'
op | '+='
number | '1'
newline | '\n'
nl | '\n'
name | '_log_compute_error'
op | '('
name | 'instance_uuid'
op | ','
name | 'retry'
op | ')'
newline | '\n'
name | 'exc_reason'
op | '='
name | 'retry'
op | '.'
name | 'pop'
op | '('
string | "'exc_reason'"
op | ','
name | 'None'
op | ')'
newline | '\n'
nl | '\n'
name | 'if'
name | 'retry'
op | '['
string | "'num_attempts'"
op | ']'
op | '>'
name | 'max_attempts'
op | ':'
newline | '\n'
indent | ' '
name | 'msg'
op | '='
op | '('
name | '_'
op | '('
string | "'Exceeded max scheduling attempts %(max_attempts)d '"
nl | '\n'
string | "'for instance %(instance_uuid)s. '"
nl | '\n'
string | "'Last exception: %(exc_reason)s'"
op | ')'
nl | '\n'
op | '%'
op | '{'
string | "'max_attempts'"
op | ':'
name | 'max_attempts'
op | ','
nl | '\n'
string | "'instance_uuid'"
op | ':'
name | 'instance_uuid'
op | ','
nl | '\n'
string | "'exc_reason'"
op | ':'
name | 'exc_reason'
op | '}'
op | ')'
newline | '\n'
name | 'raise'
name | 'exception'
op | '.'
name | 'MaxRetriesExceeded'
op | '('
name | 'reason'
op | '='
name | 'msg'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | _log_compute_error
dedent | ''
dedent | ''
name | 'def'
name | '_log_compute_error'
op | '('
name | 'instance_uuid'
op | ','
name | 'retry'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""If the request contained an exception from a previous compute\n build/resize operation, log it to aid debugging\n """'
newline | '\n'
name | 'exc'
op | '='
name | 'retry'
op | '.'
name | 'get'
op | '('
string | "'exc'"
op | ')'
comment | '# string-ified exception from compute'
newline | '\n'
name | 'if'
name | 'not'
name | 'exc'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
comment | '# no exception info from a previous attempt, skip'
newline | '\n'
nl | '\n'
dedent | ''
name | 'hosts'
op | '='
name | 'retry'
op | '.'
name | 'get'
op | '('
string | "'hosts'"
op | ','
name | 'None'
op | ')'
newline | '\n'
name | 'if'
name | 'not'
name | 'hosts'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
comment | '# no previously attempted hosts, skip'
newline | '\n'
nl | '\n'
dedent | ''
name | 'last_host'
op | ','
name | 'last_node'
op | '='
name | 'hosts'
op | '['
op | '-'
number | '1'
op | ']'
newline | '\n'
name | 'LOG'
op | '.'
name | 'error'
op | '('
name | '_LE'
op | '('
string | "'Error from last host: %(last_host)s (node %(last_node)s):'"
nl | '\n'
string | "' %(exc)s'"
op | ')'
op | ','
nl | '\n'
op | '{'
string | "'last_host'"
op | ':'
name | 'last_host'
op | ','
nl | '\n'
string | "'last_node'"
op | ':'
name | 'last_node'
op | ','
nl | '\n'
string | "'exc'"
op | ':'
name | 'exc'
op | '}'
op | ','
nl | '\n'
name | 'instance_uuid'
op | '='
name | 'instance_uuid'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | _add_retry_host
dedent | ''
name | 'def'
name | '_add_retry_host'
op | '('
name | 'filter_properties'
op | ','
name | 'host'
op | ','
name | 'node'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Add a retry entry for the selected compute node. In the event that\n the request gets re-scheduled, this entry will signal that the given\n node has already been tried.\n """'
newline | '\n'
name | 'retry'
op | '='
name | 'filter_properties'
op | '.'
name | 'get'
op | '('
string | "'retry'"
op | ','
name | 'None'
op | ')'
newline | '\n'
name | 'if'
name | 'not'
name | 'retry'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
newline | '\n'
dedent | ''
name | 'hosts'
op | '='
name | 'retry'
op | '['
string | "'hosts'"
op | ']'
newline | '\n'
name | 'hosts'
op | '.'
name | 'append'
op | '('
op | '['
name | 'host'
op | ','
name | 'node'
op | ']'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | parse_options
dedent | ''
name | 'def'
name | 'parse_options'
op | '('
name | 'opts'
op | ','
name | 'sep'
op | '='
string | "'='"
op | ','
name | 'converter'
op | '='
name | 'str'
op | ','
name | 'name'
op | '='
string | '""'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Parse a list of options, each in the format of <key><sep><value>. Also\n use the converter to convert the value into desired type.\n\n :params opts: list of options, e.g. from oslo_config.cfg.ListOpt\n :params sep: the separator\n :params converter: callable object to convert the value, should raise\n ValueError for conversion failure\n :params name: name of the option\n\n :returns: a lists of tuple of values (key, converted_value)\n """'
newline | '\n'
name | 'good'
op | '='
op | '['
op | ']'
newline | '\n'
name | 'bad'
op | '='
op | '['
op | ']'
newline | '\n'
name | 'for'
name | 'opt'
name | 'in'
name | 'opts'
op | ':'
newline | '\n'
indent | ' '
name | 'try'
op | ':'
newline | '\n'
indent | ' '
name | 'key'
op | ','
name | 'seen_sep'
op | ','
name | 'value'
op | '='
name | 'opt'
op | '.'
name | 'partition'
op | '('
name | 'sep'
op | ')'
newline | '\n'
name | 'value'
op | '='
name | 'converter'
op | '('
name | 'value'
op | ')'
newline | '\n'
dedent | ''
name | 'except'
name | 'ValueError'
op | ':'
newline | '\n'
indent | ' '
name | 'key'
op | '='
name | 'None'
newline | '\n'
name | 'value'
op | '='
name | 'None'
newline | '\n'
dedent | ''
name | 'if'
name | 'key'
name | 'and'
name | 'seen_sep'
name | 'and'
name | 'value'
name | 'is'
name | 'not'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | 'good'
op | '.'
name | 'append'
op | '('
op | '('
name | 'key'
op | ','
name | 'value'
op | ')'
op | ')'
newline | '\n'
dedent | ''
name | 'else'
op | ':'
newline | '\n'
indent | ' '
name | 'bad'
op | '.'
name | 'append'
op | '('
name | 'opt'
op | ')'
newline | '\n'
dedent | ''
dedent | ''
name | 'if'
name | 'bad'
op | ':'
newline | '\n'
indent | ' '
name | 'LOG'
op | '.'
name | 'warning'
op | '('
name | '_LW'
op | '('
string | '"Ignoring the invalid elements of the option "'
nl | '\n'
string | '"%(name)s: %(options)s"'
op | ')'
op | ','
nl | '\n'
op | '{'
string | "'name'"
op | ':'
name | 'name'
op | ','
nl | '\n'
string | "'options'"
op | ':'
string | '", "'
op | '.'
name | 'join'
op | '('
name | 'bad'
op | ')'
op | '}'
op | ')'
newline | '\n'
dedent | ''
name | 'return'
name | 'good'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | validate_filter
dedent | ''
name | 'def'
name | 'validate_filter'
op | '('
name | 'filter'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Validates that the filter is configured in the default filters."""'
newline | '\n'
name | 'return'
name | 'filter'
name | 'in'
name | 'CONF'
op | '.'
name | 'scheduler_default_filters'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | validate_weigher
dedent | ''
name | 'def'
name | 'validate_weigher'
op | '('
name | 'weigher'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Validates that the weigher is configured in the default weighers."""'
newline | '\n'
name | 'if'
string | "'nova.scheduler.weights.all_weighers'"
name | 'in'
name | 'CONF'
op | '.'
name | 'scheduler_weight_classes'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
name | 'True'
newline | '\n'
dedent | ''
name | 'return'
name | 'weigher'
name | 'in'
name | 'CONF'
op | '.'
name | 'scheduler_weight_classes'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | variable | _SUPPORTS_AFFINITY
dedent | ''
name | '_SUPPORTS_AFFINITY'
op | '='
name | 'None'
newline | '\n'
DECL | variable | _SUPPORTS_ANTI_AFFINITY
name | '_SUPPORTS_ANTI_AFFINITY'
op | '='
name | 'None'
newline | '\n'
DECL | variable | _SUPPORTS_SOFT_AFFINITY
name | '_SUPPORTS_SOFT_AFFINITY'
op | '='
name | 'None'
newline | '\n'
DECL | variable | _SUPPORTS_SOFT_ANTI_AFFINITY
name | '_SUPPORTS_SOFT_ANTI_AFFINITY'
op | '='
name | 'None'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | _get_group_details
name | 'def'
name | '_get_group_details'
op | '('
name | 'context'
op | ','
name | 'instance_uuid'
op | ','
name | 'user_group_hosts'
op | '='
name | 'None'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Provide group_hosts and group_policies sets related to instances if\n those instances are belonging to a group and if corresponding filters are\n enabled.\n\n :param instance_uuid: UUID of the instance to check\n :param user_group_hosts: Hosts from the group or empty set\n\n :returns: None or namedtuple GroupDetails\n """'
newline | '\n'
name | 'global'
name | '_SUPPORTS_AFFINITY'
newline | '\n'
name | 'if'
name | '_SUPPORTS_AFFINITY'
name | 'is'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | '_SUPPORTS_AFFINITY'
op | '='
name | 'validate_filter'
op | '('
nl | '\n'
string | "'ServerGroupAffinityFilter'"
op | ')'
newline | '\n'
dedent | ''
name | 'global'
name | '_SUPPORTS_ANTI_AFFINITY'
newline | '\n'
name | 'if'
name | '_SUPPORTS_ANTI_AFFINITY'
name | 'is'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | '_SUPPORTS_ANTI_AFFINITY'
op | '='
name | 'validate_filter'
op | '('
nl | '\n'
string | "'ServerGroupAntiAffinityFilter'"
op | ')'
newline | '\n'
dedent | ''
name | 'global'
name | '_SUPPORTS_SOFT_AFFINITY'
newline | '\n'
name | 'if'
name | '_SUPPORTS_SOFT_AFFINITY'
name | 'is'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | '_SUPPORTS_SOFT_AFFINITY'
op | '='
name | 'validate_weigher'
op | '('
nl | '\n'
string | "'nova.scheduler.weights.affinity.ServerGroupSoftAffinityWeigher'"
op | ')'
newline | '\n'
dedent | ''
name | 'global'
name | '_SUPPORTS_SOFT_ANTI_AFFINITY'
newline | '\n'
name | 'if'
name | '_SUPPORTS_SOFT_ANTI_AFFINITY'
name | 'is'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | '_SUPPORTS_SOFT_ANTI_AFFINITY'
op | '='
name | 'validate_weigher'
op | '('
nl | '\n'
string | "'nova.scheduler.weights.affinity.'"
nl | '\n'
string | "'ServerGroupSoftAntiAffinityWeigher'"
op | ')'
newline | '\n'
nl | '\n'
dedent | ''
name | 'if'
name | 'not'
name | 'instance_uuid'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
newline | '\n'
nl | '\n'
dedent | ''
name | 'try'
op | ':'
newline | '\n'
indent | ' '
name | 'group'
op | '='
name | 'objects'
op | '.'
name | 'InstanceGroup'
op | '.'
name | 'get_by_instance_uuid'
op | '('
name | 'context'
op | ','
nl | '\n'
name | 'instance_uuid'
op | ')'
newline | '\n'
dedent | ''
name | 'except'
name | 'exception'
op | '.'
name | 'InstanceGroupNotFound'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
newline | '\n'
nl | '\n'
dedent | ''
name | 'policies'
op | '='
name | 'set'
op | '('
op | '('
string | "'anti-affinity'"
op | ','
string | "'affinity'"
op | ','
string | "'soft-affinity'"
op | ','
nl | '\n'
string | "'soft-anti-affinity'"
op | ')'
op | ')'
newline | '\n'
name | 'if'
name | 'any'
op | '('
op | '('
name | 'policy'
name | 'in'
name | 'policies'
op | ')'
name | 'for'
name | 'policy'
name | 'in'
name | 'group'
op | '.'
name | 'policies'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'if'
name | 'not'
name | '_SUPPORTS_AFFINITY'
name | 'and'
string | "'affinity'"
name | 'in'
name | 'group'
op | '.'
name | 'policies'
op | ':'
newline | '\n'
indent | ' '
name | 'msg'
op | '='
name | '_'
op | '('
string | '"ServerGroupAffinityFilter not configured"'
op | ')'
newline | '\n'
name | 'LOG'
op | '.'
name | 'error'
op | '('
name | 'msg'
op | ')'
newline | '\n'
name | 'raise'
name | 'exception'
op | '.'
name | 'UnsupportedPolicyException'
op | '('
name | 'reason'
op | '='
name | 'msg'
op | ')'
newline | '\n'
dedent | ''
name | 'if'
name | 'not'
name | '_SUPPORTS_ANTI_AFFINITY'
name | 'and'
string | "'anti-affinity'"
name | 'in'
name | 'group'
op | '.'
name | 'policies'
op | ':'
newline | '\n'
indent | ' '
name | 'msg'
op | '='
name | '_'
op | '('
string | '"ServerGroupAntiAffinityFilter not configured"'
op | ')'
newline | '\n'
name | 'LOG'
op | '.'
name | 'error'
op | '('
name | 'msg'
op | ')'
newline | '\n'
name | 'raise'
name | 'exception'
op | '.'
name | 'UnsupportedPolicyException'
op | '('
name | 'reason'
op | '='
name | 'msg'
op | ')'
newline | '\n'
dedent | ''
name | 'if'
op | '('
name | 'not'
name | '_SUPPORTS_SOFT_AFFINITY'
nl | '\n'
name | 'and'
string | "'soft-affinity'"
name | 'in'
name | 'group'
op | '.'
name | 'policies'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'msg'
op | '='
name | '_'
op | '('
string | '"ServerGroupSoftAffinityWeigher not configured"'
op | ')'
newline | '\n'
name | 'LOG'
op | '.'
name | 'error'
op | '('
name | 'msg'
op | ')'
newline | '\n'
name | 'raise'
name | 'exception'
op | '.'
name | 'UnsupportedPolicyException'
op | '('
name | 'reason'
op | '='
name | 'msg'
op | ')'
newline | '\n'
dedent | ''
name | 'if'
op | '('
name | 'not'
name | '_SUPPORTS_SOFT_ANTI_AFFINITY'
nl | '\n'
name | 'and'
string | "'soft-anti-affinity'"
name | 'in'
name | 'group'
op | '.'
name | 'policies'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'msg'
op | '='
name | '_'
op | '('
string | '"ServerGroupSoftAntiAffinityWeigher not configured"'
op | ')'
newline | '\n'
name | 'LOG'
op | '.'
name | 'error'
op | '('
name | 'msg'
op | ')'
newline | '\n'
name | 'raise'
name | 'exception'
op | '.'
name | 'UnsupportedPolicyException'
op | '('
name | 'reason'
op | '='
name | 'msg'
op | ')'
newline | '\n'
dedent | ''
name | 'group_hosts'
op | '='
name | 'set'
op | '('
name | 'group'
op | '.'
name | 'get_hosts'
op | '('
op | ')'
op | ')'
newline | '\n'
name | 'user_hosts'
op | '='
name | 'set'
op | '('
name | 'user_group_hosts'
op | ')'
name | 'if'
name | 'user_group_hosts'
name | 'else'
name | 'set'
op | '('
op | ')'
newline | '\n'
name | 'return'
name | 'GroupDetails'
op | '('
name | 'hosts'
op | '='
name | 'user_hosts'
op | '|'
name | 'group_hosts'
op | ','
nl | '\n'
name | 'policies'
op | '='
name | 'group'
op | '.'
name | 'policies'
op | ','
name | 'members'
op | '='
name | 'group'
op | '.'
name | 'members'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | setup_instance_group
dedent | ''
dedent | ''
name | 'def'
name | 'setup_instance_group'
op | '('
name | 'context'
op | ','
name | 'request_spec'
op | ','
name | 'filter_properties'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Add group_hosts and group_policies fields to filter_properties dict\n based on instance uuids provided in request_spec, if those instances are\n belonging to a group.\n\n :param request_spec: Request spec\n :param filter_properties: Filter properties\n """'
newline | '\n'
name | 'group_hosts'
op | '='
name | 'filter_properties'
op | '.'
name | 'get'
op | '('
string | "'group_hosts'"
op | ')'
newline | '\n'
comment | "# NOTE(sbauza) If there are multiple instance UUIDs, it's a boot"
nl | '\n'
comment | "# request and they will all be in the same group, so it's safe to"
nl | '\n'
comment | '# only check the first one.'
nl | '\n'
name | 'instance_uuid'
op | '='
name | 'request_spec'
op | '.'
name | 'get'
op | '('
string | "'instance_properties'"
op | ','
op | '{'
op | '}'
op | ')'
op | '.'
name | 'get'
op | '('
string | "'uuid'"
op | ')'
newline | '\n'
name | 'group_info'
op | '='
name | '_get_group_details'
op | '('
name | 'context'
op | ','
name | 'instance_uuid'
op | ','
name | 'group_hosts'
op | ')'
newline | '\n'
name | 'if'
name | 'group_info'
name | 'is'
name | 'not'
name | 'None'
op | ':'
newline | '\n'
indent | ' '
name | 'filter_properties'
op | '['
string | "'group_updated'"
op | ']'
op | '='
name | 'True'
newline | '\n'
name | 'filter_properties'
op | '['
string | "'group_hosts'"
op | ']'
op | '='
name | 'group_info'
op | '.'
name | 'hosts'
newline | '\n'
name | 'filter_properties'
op | '['
string | "'group_policies'"
op | ']'
op | '='
name | 'group_info'
op | '.'
name | 'policies'
newline | '\n'
name | 'filter_properties'
op | '['
string | "'group_members'"
op | ']'
op | '='
name | 'group_info'
op | '.'
name | 'members'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | retry_on_timeout
dedent | ''
dedent | ''
name | 'def'
name | 'retry_on_timeout'
op | '('
name | 'retries'
op | '='
number | '1'
op | ')'
op | ':'
newline | '\n'
indent | ' '
string | '"""Retry the call in case a MessagingTimeout is raised.\n\n A decorator for retrying calls when a service dies mid-request.\n\n :param retries: Number of retries\n :returns: Decorator\n """'
newline | '\n'
DECL | function | outer
name | 'def'
name | 'outer'
op | '('
name | 'func'
op | ')'
op | ':'
newline | '\n'
indent | ' '
op | '@'
name | 'functools'
op | '.'
name | 'wraps'
op | '('
name | 'func'
op | ')'
newline | '\n'
DECL | function | wrapped
name | 'def'
name | 'wrapped'
op | '('
op | '*'
name | 'args'
op | ','
op | '**'
name | 'kwargs'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'attempt'
op | '='
number | '0'
newline | '\n'
name | 'while'
name | 'True'
op | ':'
newline | '\n'
indent | ' '
name | 'try'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
name | 'func'
op | '('
op | '*'
name | 'args'
op | ','
op | '**'
name | 'kwargs'
op | ')'
newline | '\n'
dedent | ''
name | 'except'
name | 'messaging'
op | '.'
name | 'MessagingTimeout'
op | ':'
newline | '\n'
indent | ' '
name | 'attempt'
op | '+='
number | '1'
newline | '\n'
name | 'if'
name | 'attempt'
op | '<='
name | 'retries'
op | ':'
newline | '\n'
indent | ' '
name | 'LOG'
op | '.'
name | 'warning'
op | '('
name | '_LW'
op | '('
nl | '\n'
string | '"Retrying %(name)s after a MessagingTimeout, "'
nl | '\n'
string | '"attempt %(attempt)s of %(retries)s."'
op | ')'
op | ','
nl | '\n'
op | '{'
string | "'attempt'"
op | ':'
name | 'attempt'
op | ','
string | "'retries'"
op | ':'
name | 'retries'
op | ','
nl | '\n'
string | "'name'"
op | ':'
name | 'func'
op | '.'
name | '__name__'
op | '}'
op | ')'
newline | '\n'
dedent | ''
name | 'else'
op | ':'
newline | '\n'
indent | ' '
name | 'raise'
newline | '\n'
dedent | ''
dedent | ''
dedent | ''
dedent | ''
name | 'return'
name | 'wrapped'
newline | '\n'
dedent | ''
name | 'return'
name | 'outer'
newline | '\n'
nl | '\n'
DECL | variable | retry_select_destinations
dedent | ''
name | 'retry_select_destinations'
op | '='
name | 'retry_on_timeout'
op | '('
name | 'CONF'
op | '.'
name | 'scheduler_max_attempts'
op | '-'
number | '1'
op | ')'
newline | '\n'
endmarker | ''
end_unit |
class intcode():
def __init__(self):
self.instructionPointer = 0
self.memory = []
self.stopped = False
def loadMemory(self, memList):
self.memory = memList.copy()
def loadProgram(self, programString):
numbers = programString.split(",")
self.memory = list(map(int,numbers))
def isStopped(self):
return self.stopped
def add(self,p1_location,p2_location,output_location):
self.memory[output_location] = self.memory[p1_location] + self.memory[p2_location]
self.instructionPointer += 4
return
def mult(self, p1_location, p2_location, output_location):
self.memory[output_location] = self.memory[p1_location] * \
self.memory[p2_location]
self.instructionPointer += 4
return
def stop(self, p1_location, p2_location, output_location):
#Stop function doesn't use any of these parameters, but needs them to use the dictionary based case
self.stopped = True
return
def decode(self):
opcode = self.memory[self.instructionPointer]
p1_location = 0
p2_location = 0
p3_location = 0
if opcode != 99:
p1_location = self.memory[self.instructionPointer+1]
p2_location = self.memory[self.instructionPointer+2]
p3_location = self.memory[self.instructionPointer+3]
return opcode,p1_location,p2_location,p3_location
def step(self, opcode, p1_location, p2_location, p3_location):
funcs = {
1: self.add,
2: self.mult,
99: self.stop
}
funcs[opcode](p1_location, p2_location, p3_location)
def execute(self):
while not self.isStopped():
#Interpret the current instruction
#Find the parameters
opcode, p1_location, p2_location, p3_location = self.decode()
#Execute that instruction
self.step(opcode, p1_location, p2_location, p3_location)
#Update instruction Pointer - This happens automatically in each instruction | class Intcode:
def __init__(self):
self.instructionPointer = 0
self.memory = []
self.stopped = False
def load_memory(self, memList):
self.memory = memList.copy()
def load_program(self, programString):
numbers = programString.split(',')
self.memory = list(map(int, numbers))
def is_stopped(self):
return self.stopped
def add(self, p1_location, p2_location, output_location):
self.memory[output_location] = self.memory[p1_location] + self.memory[p2_location]
self.instructionPointer += 4
return
def mult(self, p1_location, p2_location, output_location):
self.memory[output_location] = self.memory[p1_location] * self.memory[p2_location]
self.instructionPointer += 4
return
def stop(self, p1_location, p2_location, output_location):
self.stopped = True
return
def decode(self):
opcode = self.memory[self.instructionPointer]
p1_location = 0
p2_location = 0
p3_location = 0
if opcode != 99:
p1_location = self.memory[self.instructionPointer + 1]
p2_location = self.memory[self.instructionPointer + 2]
p3_location = self.memory[self.instructionPointer + 3]
return (opcode, p1_location, p2_location, p3_location)
def step(self, opcode, p1_location, p2_location, p3_location):
funcs = {1: self.add, 2: self.mult, 99: self.stop}
funcs[opcode](p1_location, p2_location, p3_location)
def execute(self):
while not self.isStopped():
(opcode, p1_location, p2_location, p3_location) = self.decode()
self.step(opcode, p1_location, p2_location, p3_location) |
"""
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11).
Note:
Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the triangle.
"""
class Solution(object):
def minimumTotal(self, triangle):
"""
:type triangle: List[List[int]]
:rtype: int
"""
"""
Method 1: Dynamic Programming
Your runtime beats 35.54 % of python submissions.
"""
height = len(triangle)
res = [[0 for _ in range(len(row))] for row in triangle]
res[0][0] = triangle[0][0]
# print("Inital Result Array: ", res)
for i in range(1, height):
for j in range(len(triangle[i])):
if j == 0:
res[i][j] = res[i - 1][j] + triangle[i][j]
elif j == len(triangle[i]) - 1:
res[i][j] = res[i - 1][j - 1] + triangle[i][j]
else:
res[i][j] = min(res[i - 1][j - 1], res[i - 1][j]) + triangle[i][j]
# print("Index: ", (i,j), "Result: ", res)
return min(res[-1]) | """
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11).
Note:
Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the triangle.
"""
class Solution(object):
def minimum_total(self, triangle):
"""
:type triangle: List[List[int]]
:rtype: int
"""
'\n Method 1: Dynamic Programming\n Your runtime beats 35.54 % of python submissions.\n '
height = len(triangle)
res = [[0 for _ in range(len(row))] for row in triangle]
res[0][0] = triangle[0][0]
for i in range(1, height):
for j in range(len(triangle[i])):
if j == 0:
res[i][j] = res[i - 1][j] + triangle[i][j]
elif j == len(triangle[i]) - 1:
res[i][j] = res[i - 1][j - 1] + triangle[i][j]
else:
res[i][j] = min(res[i - 1][j - 1], res[i - 1][j]) + triangle[i][j]
return min(res[-1]) |
# Problem: https://www.hackerrank.com/challenges/merge-the-tools/problem
def merge_the_tools(string, k):
num_sub = int(len(string)/k)
for sub_num in range(num_sub):
sub = string[sub_num*k:sub_num*k+k]
sub_list, unique_sub_list = list(sub), []
[unique_sub_list.append(letter) for letter in sub_list if letter not in unique_sub_list]
# cannot use set since order of unique_sub_list matters
# unique_sub_list = list(set(sub_list))
unique_sub = ''.join(unique_sub_list)
print(unique_sub)
string, k = input('Enter string: '), int(input('Enter k: '))
merge_the_tools(string, k) | def merge_the_tools(string, k):
num_sub = int(len(string) / k)
for sub_num in range(num_sub):
sub = string[sub_num * k:sub_num * k + k]
(sub_list, unique_sub_list) = (list(sub), [])
[unique_sub_list.append(letter) for letter in sub_list if letter not in unique_sub_list]
unique_sub = ''.join(unique_sub_list)
print(unique_sub)
(string, k) = (input('Enter string: '), int(input('Enter k: ')))
merge_the_tools(string, k) |
### Model data
class catboost_model(object):
float_features_index = [
0, 1, 2, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 17, 20, 22, 24, 27, 28, 31, 32, 33, 34, 35, 37, 38, 39, 46, 47, 48, 49,
]
float_feature_count = 50
cat_feature_count = 0
binary_feature_count = 31
tree_count = 40
float_feature_borders = [
[0.175395012, 0.1838945, 0.378224492, 0.646430016, 0.794435978],
[0.00386904506, 0.0143127497, 0.0237283502, 0.113178, 0.117846504, 0.140969992, 0.151769012, 0.156479999, 0.202911496, 0.38756001, 0.485974014],
[0.00861673057, 0.557633996, 0.758180022, 0.817595959, 0.888193488, 0.902011514, 0.903753996, 0.937548518, 0.937671542, 0.937812984],
[0.5],
[0.5],
[0.5],
[0.5],
[0.5],
[0.5],
[0.5],
[0.386274517, 0.413725495, 0.421568513, 0.496078491, 0.566666484, 0.598039031],
[0.46657151, 0.550505519, 0.587584972, 0.626136005, 0.658094525, 0.669399023, 0.748417497, 0.76047051, 0.778998971, 0.81042254, 0.834022045, 0.941508055],
[0.0252820998, 0.0504557006, 0.0924388021, 0.240712494, 0.254698515, 0.318728, 0.333916008, 0.365603, 0.37875849, 0.387778997, 0.39003402, 0.540594995, 0.586225033, 0.651247025, 0.692146003, 0.735934496, 0.795647502],
[0.0704644024, 0.1199295, 0.126112998, 0.128601998, 0.143661499, 0.149134487, 0.149136499, 0.150786504, 0.260086477, 0.261237979, 0.26285702, 0.277716517, 0.277717501, 0.277720511],
[0.339215517, 0.382353008, 0.390195996, 0.394117475, 0.398038983, 0.413725495, 0.488235474, 0.492156982, 0.507843018, 0.531372488, 0.711764991, 0.750980496],
[0.5],
[0.0225447994, 0.0261416994, 0.182705492, 0.937511444, 0.939667463, 0.945958018, 0.952567995, 0.954834998],
[0.5],
[0.5],
[0.0867389515, 0.0950040966, 0.141615003, 0.148920506, 0.348527014, 0.513378978, 0.516897023, 0.724137545],
[0.5],
[0.172385991, 0.185759991, 0.198566005, 0.451892495, 0.84256053],
[0.5],
[-0.0314164981, 0.0439245999, 0.117502004, 0.166823998, 0.245040998, 0.318073004, 0.344751, 0.345134497, 0.348299503, 0.361798525, 0.423586994, 0.476337016, 0.681255519],
[0.00143194001, 0.00513814017, 0.0090128053, 0.0309973005, 0.0367250517],
[0.02983425, 0.0453458503, 0.189270005, 0.357340515, 0.651507497, 0.654693007, 0.656473994, 0.726830006],
[0.000425621984, 0.000653013994, 0.00177894998, 0.001926005, 0.00270928489, 0.00354014011, 0.00393318012, 0.005463365, 0.00603085477, 0.00666473527, 0.00760281505, 0.0188514516],
[0.231252998, 0.42613101, 0.49158749, 0.599743009, 0.641760468],
[0.432520002, 0.460792005, 0.472368002, 0.502859473, 0.525056005, 0.549761534, 0.595171452, 0.60571146, 0.695415974, 0.711432993, 0.715005994, 0.725735545, 0.772307515, 0.778638482, 0.873877525, 0.982075989],
[0.261609018, 0.264095008, 0.273368478, 0.276944995, 0.340994507, 0.46727401, 0.48003298, 0.547486544, 0.640262485, 0.662613511, 0.718292952, 0.748547494, 0.758205533, 0.870769978, 0.911834955],
[0.5],
]
tree_depth = [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
tree_split_border = [1, 8, 8, 7, 2, 11, 1, 3, 5, 6, 2, 2, 10, 5, 12, 9, 6, 1, 8, 13, 13, 12, 2, 1, 1, 8, 3, 5, 4, 1, 9, 13, 14, 8, 5, 5, 5, 7, 15, 13, 1, 5, 12, 1, 3, 2, 10, 3, 1, 3, 6, 4, 14, 4, 6, 10, 3, 4, 3, 1, 12, 7, 1, 5, 2, 5, 9, 2, 10, 5, 4, 6, 8, 6, 2, 12, 9, 5, 13, 3, 4, 1, 7, 4, 14, 7, 15, 10, 8, 7, 1, 1, 5, 1, 4, 1, 11, 16, 1, 7, 7, 4, 4, 2, 3, 11, 8, 1, 1, 11, 1, 6, 7, 1, 1, 9, 2, 9, 4, 14, 9, 3, 7, 3, 5, 12, 3, 4, 16, 6, 14, 1, 5, 15, 3, 1, 3, 4, 7, 8, 1, 1, 9, 15, 1, 9, 5, 5, 3, 6, 7, 9, 2, 10, 4, 1, 11, 9, 7, 2, 2, 4, 2, 2, 8, 11, 1, 2, 2, 14, 11, 8, 12, 8, 1, 7, 7, 3, 1, 12, 1, 2, 2, 8, 7, 5, 6, 4, 4, 4, 5, 1, 4, 2, 3, 13, 10, 6, 1, 4, 6, 3, 6, 6, 8, 3, 1, 1, 11, 9, 1, 1, 7, 1, 5, 11, 10, 8, 5, 6, 1, 4, 10, 14, 10, 1, 1, 1, 15, 6, 1, 1, 8, 13, 4, 10, 17, 14, 5, 1]
tree_split_feature_index = [19, 1, 26, 11, 24, 23, 20, 26, 14, 23, 12, 21, 28, 29, 14, 1, 14, 6, 29, 12, 28, 13, 25, 21, 20, 12, 11, 1, 25, 18, 26, 29, 12, 25, 28, 23, 16, 26, 28, 12, 22, 14, 29, 9, 2, 11, 23, 16, 20, 1, 2, 0, 29, 25, 28, 2, 12, 24, 10, 1, 28, 12, 2, 13, 14, 10, 28, 1, 12, 26, 16, 10, 28, 1, 2, 23, 13, 11, 28, 26, 13, 3, 13, 21, 28, 1, 12, 1, 11, 29, 20, 9, 21, 26, 12, 14, 26, 12, 30, 14, 25, 2, 19, 29, 0, 1, 25, 25, 20, 12, 17, 26, 16, 0, 20, 2, 10, 23, 27, 12, 2, 23, 14, 21, 26, 12, 19, 26, 28, 10, 12, 17, 19, 12, 24, 17, 27, 13, 2, 23, 30, 11, 29, 12, 20, 11, 2, 12, 25, 29, 28, 14, 0, 29, 1, 18, 28, 12, 25, 24, 27, 29, 19, 26, 16, 29, 5, 23, 28, 12, 13, 14, 26, 13, 20, 23, 2, 13, 7, 11, 29, 28, 13, 25, 14, 0, 2, 11, 14, 23, 27, 3, 28, 16, 29, 13, 11, 25, 28, 13, 19, 14, 16, 11, 2, 28, 10, 8, 14, 12, 29, 13, 19, 3, 14, 11, 2, 19, 24, 12, 12, 10, 26, 12, 13, 24, 4, 15, 29, 13, 23, 16, 2, 23, 28, 14, 12, 13, 25, 27]
tree_split_xor_mask = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cat_features_index = []
one_hot_cat_feature_index = []
one_hot_hash_values = [
]
ctr_feature_borders = [
]
## Aggregated array of leaf values for trees. Each tree is represented by a separate line:
leaf_values = [
0.05960256437951928, 0.06070146909282823, 0.06015918889076437, 0.05959448117928647, 0.0599721206163218, 0.06062821605892021, 0.0605089520658085, 0.06288086010413954, 0.05955195210314157, 0.06099448115395449, 0.06229438070265529, 0.06050201132893562, 0.06192215820207864, 0.06190509985324542, 0.06176463823760008, 0.06162483396958104, 0.06005946608783778, 0.06062279438329973, 0.06004824625411104, 0.06064448116028749, 0.06103598718641752, 0.06270338815639177, 0.06267781612256605, 0.06172957858253918, 0.05938985894333002, 0.06132279437063375, 0.0613444811476215, 0.06109824623511206, 0.0616944811412885, 0.0620775132274143, 0.06146759860387622, 0.06253466764112585, 0.05988602370841774, 0.0604175986228752, 0.05969421006123277, 0.06050201132893562, 0.06009357756463582, 0.0597648340096226, 0.06094687741927594, 0.06145321607326258, 0.06024776317952554, 0.06096483398790947, 0.06303508723080734, 0.06050201132893562, 0.0608775135811513, 0.06275863771560382, 0.06071954670341606, 0.06099448115395449, 0.05989259863237469, 0.0648667073624649, 0.06050201132893562, 0.06050201132893562, 0.06050201132893562, 0.06221517819009029, 0.06050201132893562, 0.06404448115730725, 0.05957821609654565, 0.06004824625411104, 0.06050201132893562, 0.06050201132893562, 0.06050201132893562, 0.06240996302870024, 0.06057324624461156, 0.06019598720161671,
-0.0009068310388559024, 0.0005823790048818268, 0.0003022397759053274, 0.001236387425717793, -0.001110814547534013, 0, -0.0009955282825560336, 0.0005900790335013008, -0.0007270945767319858, -0.0004503618368394611, -0.0004830951003004704, 0, -0.0007312046291846942, 0, -0.0003228709852496245, 0.001331784484289174, -0.0009001571778393695, 0.0008336580731940341, 0.0001846719011632316, 0.001297891181080824, -0.0009618816738515486, 0, -8.710280354874739e-05, 0.000935069827523146, -0.000469122101802195, 0.000927062975956497, 0.0009596543982336384, 0.0001628772571593989, -0.0005596775005835593, 6.159951384984342e-05, -0.0003414199319814777, 0.002115943356260228, 0, -0.001142222399221946, 0, 0.001164318208439542, -0.000457458598429662, 0.0005900790335013008, 0, 9.584290627186962e-05, 0.001870434369045688, 0.0005927637363117251, 0.0005925413825713574, 0.0005833861550049742, 0.0002303670248576997, 0.005328653757534604, -0.000235488818658018, 0, 0, -0.0003494213597650448, -0.0003075385840448801, 0.001911465205838799, 0, 0, 0.0003968806892349656, 0.001932862827397617, -7.592085855706009e-05, 0, 0.001140556113073425, 0.002650395860214851, 0.0002143034913390684, 0, -0.0003199517355933474, 0.002342043877120708,
-0.0008255076879879013, 0, 2.963474536994075e-05, 0.00133157584475381, 0, 0, 0, 0, 0.0007332090569434432, 0, 0.0008839420666393279, 0.0005411137808915025, 0, 0, 0, 0, -0.001174172258888733, 0, -4.880608934416334e-05, 0.00304220442197527, -0.0005631011493398127, 0.0005856534408489607, -0.0005797420271229933, 0.0004137618636092113, -0.0008903556334588118, 0, 0.000323080433781681, 0.002877251136554585, 0, 0, -0.00110589081834929, 0, 0.0006752537541109018, 0, 0.000859004559224972, 0.001944385151182034, 0, 0, 0, 0, 0.000903436633701007, 0, 9.139636452584899e-07, 0.003837850096914544, 0, 0, 0, 0, -0.0001616476694876037, 0.0005893602117203287, -0.0005399148187012325, 0.001545423564299556, -0.0007188761029023953, 0, -0.0006385464476446567, -0.0004582376131230649, 0.0003343360984731416, 0, -0.0002103706994374059, 0.00156091289019888, -0.0004528359406640871, 0, -0.0009069158758616088, 0,
-0.000401568779496549, 0.000126501580156415, -0.0006511481172762662, 0.000624371256332249, 0.0009127066324430423, 0.001309104305710209, 0, 0, -0.0008082733811971049, 0.001317802216441966, 0.005863355179659432, -0.0002214717502162596, 0, 0, 0, 0, -0.000130804229269851, 0.0002501883127191267, 0, 0.0006507025885549615, 0.0005601015702535238, 0.001205826632256492, 0, 0.0003921999650066529, -0.000977879599203093, 0.0001450362731798309, -0.0003189307834865347, 0.002300871759266034, 0, 0, 0, 0, 0.001046991258519593, 0.0002194142615655317, 0, 0, 0, 0.004095668452432496, 0, 0, -0.001146915860843075, 0.002602714598010289, 0, 0, 0, 0, 0, 0, 0.0001941932952346267, -7.773571156871769e-06, 0, -0.0004107193418927222, 0.001420769828524477, 0.002088915532621854, 0, 0, -0.0004531241522537246, 0.00058433738518943, 0, 0, 0, 0.004054731721198525, 0, 0,
-0.0008986334950566576, -0.0003815477805714486, 0.0001680492376123468, 0, -0.0008152289339438823, 0.001241603629413865, 6.038870670514412e-05, 0, -0.0006777894151986823, 0.002102271045086913, 0.0004503061015964687, 6.11546265669483e-05, 0.0001038563561778671, 0.0007176545796428096, 0.003414784714422588, -0.0009525145408156789, -0.0008958140255386376, 0.00578281017516635, -0.0005853509346225964, 2.475672695798763e-05, -0.0003011946281607049, 0.001594888585597788, -0.0002152025968347746, 0, 0.0006538688771301455, 0.0006035505368545839, 0.0004687583720916312, 0.0005727045197730552, 0.0002980731734116802, 0.001841195473683457, 0.00102922626796895, 0.0004567081468439011, -0.000345977341587908, 5.912827139725208e-05, 0, 0, 0.001843387323466271, 0, 0.0005850660534626809, 0, -0.0004503988499311936, 0.00302899319613218, 0.0007598776450626112, 0.0003016918923439847, 0.0007711134900818612, 0.003650110205298897, 0.002103213104474725, 0.0007489497931014422, -0.001014163973340277, -0.0001379779160878587, 0, 0, -0.0004398661035316483, 0.001115304487633738, 0, 0, -0.0007906387768084228, 0.0007188906932456458, -0.000489375435877958, -0.0004817550370255072, 0.0002620610283638666, 0.001626712002241777, -0.0005226102083038629, 0,
-0.0007948534981611709, 0.0005256298072493532, 0, -0.0004549889615015632, 0.003689839804145559, 0.001351341131338389, 0, 0.001698023934270857, -0.0005047437686986064, -0.00122029721761542, 0, 0, 0, -0.0005946516372080023, 0, -0.0005829890844505032, 0.0004829617451990933, 0.001274351667237778, 0.0003364182016724926, 0.0007998888509950559, 0, 0, 0, 0, 0.001119482876265136, 0.001105979857942378, -0.0004952809722155348, 0.002478559937691653, 0, 0, 0, 0.0001484914796241115, -0.0004451098185261131, 0.0005219659759947921, 0.002625771677078105, -0.0004622626688093997, 0.003180176853643922, 0.000500793877487153, 0, 0, -0.0002482971942041805, -0.0007280251509266012, 0, -3.037432140477268e-05, 0, 0, 0, -0.0004793245006222285, 0.0004976954132640868, 0.001931034063756475, 0.002701688975660498, 0.002544442354066031, 0, 0, 0, 0, -0.0003050469065930951, 0.0005443530127708044, 0.002513587434501194, 0.001189114549536518, 0, 0, 0, -0.0004588780301996969,
-0.0006018063431015334, -0.001027882254846747, 2.096042226701643e-05, 0.001465262300263499, 0, 0, 0, 0, 0.005799503978290448, 0, 0.0005145142843527017, -0.0007292303078440648, 0, 0, 0, 0, -0.0001376545879859117, 0.000638494729025773, 0.0005716629263118272, 0.001346967505691378, -0.0007881469465385549, -0.0001152312742054467, 0, 0.001811460642135851, 0, 0, -0.0003250594153976753, 0, 0, 0, 0, 0.0003776421757637712, -0.0008928773470896611, -0.0005702509148721005, 0.0001669308364415138, -0.0002957771092143147, 0, 0, 0, 0, 0.0017671583786665, 2.837842173810271e-05, 0.0008905397402366979, 0, 0, 0, 0, 0, -0.0004902131531725223, -0.0002656417725737849, -0.0003088892837797236, 0.0004202085992080763, 0, 0.005003087301980368, -0.0005056454655113847, 0.00214035032465187, -0.0004989248653304542, 0, 0.0003890801386909085, 0.002138011279776907, 0, 0, 0, 0,
-0.0007755504715727673, 0, -0.0004204031612023624, 0, 0, 0, 0, 0, -0.0004779051632618724, 0.0001444596925768664, 0.0007942280630878249, 0.000476885076201495, 0, 0, 5.94703731287996e-05, 0, -0.0009695591590630888, -3.306461497428595e-05, -0.0003411943477162227, 0, 0, 0, 0, 0, -0.0005915237194839268, -0.0007328653361691701, 0.001887835849914902, -0.0002159006130392399, 0, 0, -0.0004753391459828818, 0, -0.0004557268087725886, 0.0003625714795935948, 0, 0, -0.00046934253069617, 0.001482074976041942, 0, 0, -6.246485911476739e-05, 0.0006197511774949764, 0, 0, 0.0005291375057499191, 0.001811277370933497, 0, 0, -0.000251463684539595, 0.0003647218287826905, 0, 0, -0.00032442822753098, 0.008879695687050524, 0, 0, 0.0002095073790056473, 0.001286106916419528, 0, 0, 0.003316247698205191, 0.001868766907544536, 0, 0,
-0.0009064867939690254, -6.289037836985422e-05, 0.000116801339250223, 0.0005817873910002115, 0, 0, -0.0004317378022444221, 0.003432489374344434, -0.0008790418360227249, 0.001456067401118563, 8.891999216473525e-05, 0.000246647422399483, 0, 0, 0, 0.002353324402389184, 0, 0, 0, 0, 0, -0.0004816708203667504, 0, 0, 0, 0, 0, 0.0005288136498155091, 0, 0, 0, 0.0005183401916112455, -0.0006703698588571763, -0.0002763252466532651, -2.992403102921954e-05, 0.001095334115751643, 0, 0, 0, 0.001145794722112049, -0.0003978397558084178, -0.0004953502641970411, -0.0001049304671522831, 0.001116795384311774, 0, 0, 0, 0.00113992338296903, 0, 0, 0, 0.002121715232935706, 0, 0, 0, 0, 0, -0.0005056097778732027, 0, 0.001630175745346752, 0, 0.005957641231429225, 0, 0.002564929792739056,
-0.001309906402417095, -0.000483219173206812, 0, 0, 0, 0, 0, 0, 0, 0.0008790466595663336, 0, 0.003547242719709221, 0, 0, 0, 0, -0.0008567939602030077, -0.0001547517035176911, 0, 0, -0.0009220552743975222, 0, 0, 0, -0.000624409975612866, 0.002543656756142583, 0, -0.0004780582892947462, 0, 0, 0, 0, -0.0003446552011669872, 0.000713508286506049, 0, 0, 0.000333324690501642, 0.0009309298456827793, 0, 0.006240501932570201, 0, 0.001105751986493601, 0, 0, 0, 0.0005431102649102487, 0, 0.0008188683761877446, -0.0005535329218846543, 0.0008259885125883971, 0, 0.0005037592164560795, -1.835854270367367e-05, 0.001023440203380021, 0, 0.003560756342014944, -0.0007074878200965966, 0.000864907039003376, 0, 0, 0.0001366822670473724, 0.001582580905874072, 0, 0.002009939296764808,
0.0003865646072311214, 0, -0.0008022744565057487, 0, 0.0001632846231533874, 0.001101093882966966, 0.0009836600790513049, 1.398142836853892e-05, -0.000374276171862653, 0, 0.001090262096296609, 0, 0.0001759454007802445, 0.001428484187277461, 0.0009458415932637716, 0.0004677293190348015, -1.742515794061892e-05, 0, -0.000343364609050618, 0, -0.0003360883810472326, 0.0009711315628411175, -0.0007338417623763982, 0, -0.000790314139660284, 0, 0.002384392712423223, 0, 9.287363993105999e-06, 0.008189467692436558, 0.0005459256059258664, -0.00051786086249799, -0.0003552316262792518, 0, -0.0004572245615290128, 0, 0.0001095514616914518, 0.0009859674542951899, 0, 0, -0.0007204364400038682, 0, 0.0001850400591086591, 0, -0.0001150445134624198, 0.0005181616065208171, -0.0002437024959346003, 0, -0.0005240347212904336, 0, 0.0005750370476711794, 0, -0.000614637991021733, 0.001275885379234661, -0.0002186738053273664, 0.0001359248737806769, -0.0005628950067992402, 0, -8.330462968408475e-05, 0, -0.0004761528023739025, 0.0006668078737590364, 0.0003572580400984975, 0,
-0.0009001456906606895, -0.0002887659605542936, -0.0003515075237394754, 0.0004660212511978738, 0, 0, 0.002884480251599634, 0, 0, 0, 1.967507107508503e-05, 0.001771653557518016, 0, 0, 0.0005239154188415987, -0.0001882160496348641, -0.000687330590958533, 0.00166661365481144, -0.0006774512019157835, 2.551181828164668e-05, 0, 0, 0.004519848792368262, -0.0003359477889158661, 0, 0, 0.0004363189612620683, 0.001778564661499693, 0, 0, 0.001309672216024785, 0.0006387400933526047, -0.0008897036182301449, 0, -0.0005687562950168401, 0, 0, 0, -0.0006682742383678824, 0, 0, 0, -0.0007895223815884316, 0.0006628195359962189, 0, 0, 0.0003208173185581129, 0, -0.0007436005351330468, 0.0004782120703594316, -0.0002993695759214539, 3.039771926011296e-05, 0, 0, -0.0004796557737105838, 0, 0, 0, 6.468464286064302e-05, 0.001231496653325923, 0, 0, 0.001351524381337044, 0,
-0.0003607182746953023, 8.342659088005351e-05, -3.792485417691867e-05, 8.817478793318804e-05, 0.0004880137981154884, 0.002484633514056119, 0, 0.001539689968499958, -0.0004282892981098389, -0.0003787189308900001, 0.0004008838190664932, 0.0003382436136607516, -0.0004369668631456094, 0.005731073223260426, -0.0007165090810477431, -6.266960112617123e-05, -0.001005195742726514, 0, -0.000181415913445249, 0.0005060823612388878, 0, 0, 0, 0.003441934923247753, -0.0009982404651869968, 0.0006026634813043485, -0.0002925558123018868, 0.002543357705137985, 0, 0, -0.0007424316702627211, 0, -0.0004905369333963455, 0.001149670303717321, 0.0005271261641667226, 0.00131379082929632, -0.0004323341899003385, 0.0009195897287224263, 0.0005409085001641943, 0.001096147558352679, -4.444355793990361e-05, 0.0009018695044673152, -8.348759645998456e-05, 0.001027546298176011, 0, 0.001191740669631401, 0.001692944189272718, 0.0009039104341932828, -0.0009256239077937749, 0, 0.001610759470532655, 0.0008078862658923336, -0.0005041237934756058, 0.0004427882565628611, 0, 0.0005004867514804085, -0.0006142319257543264, 0, 0.00138205603554294, -0.0006616966980226391, -0.0004361756037415079, 0, 0, 0,
-0.0003100762260366763, 0.0005696936735416498, -0.0002918711983689358, 0.0004593402181207647, -0.000778661499824759, 0.0006116415209738039, 0.0006892953674784969, 0.0005878839074900504, -0.001060813685411268, 0.0005252972770325391, -0.001037450897828913, 0.001309701813685781, 0.003833236617364886, -0.0005249132206310229, 0.001447892532411102, 0.001158230973475296, 0, 0, 0, 0, -0.0007023432640979511, 0.004055782447849766, 0.0002341090218033136, 0.00190906921612172, 0, 0, 0, 0, -0.0006513892268303017, 0, 0.0004214039553883565, 0.00408685473834532, 0.0004032546202407829, 0, -0.0006407252348500854, -5.47490988155267e-05, 0.000542852879399722, 0, 0, 0.0004552664164403495, -0.0008495864871459278, 0, -0.0008037785404702064, 0.0007687984699275836, 0, 0, 0.002964992637824279, 0.001199003947783432, 0, 0, 0, 0, -4.492563327991082e-05, -0.0003359607325220134, -0.0002737350398622196, -0.0001896911528852687, 0, 0, 0, 0, 0, 0, 0.001367005591721463, 0.000830415177474601,
-0.0005922975104928046, 0, -0.0002480988775373451, 0, 0, 0, 0, 0, 0, 0, 0.0006300483373515697, 0, 0, 0, 0, 0, -0.0004573144983907264, 0.001091286583576242, 0.0006781599344728608, 0, 5.220755221257915e-05, 0, 0.005911611998946679, 0, 0, 0, 4.770673375686409e-05, 0, 0, 0, -0.0005130205348262159, 0, -0.00041308456890122, 0.001909674138879147, 0.000383437532933237, 0.0004161818696863879, -0.0004896711466610244, 0, -0.0002900618477335762, 0, 0, 0, -0.0003307083655943042, 0.002626984287612892, 0, 0, 0.0002640217245480382, 0, 0.001570042096149993, 0.001160225995206928, 0.00121195767908835, 0.001103270466016039, 0.0004788168363280853, 0, -0.0002974760073579056, 0, 0, 0, 0.0008375239849161263, 0.001706877074256596, 0, 0, 0.0007901085765057678, 0,
-0.0008387326569321425, -0.0004642837694419319, 2.181429570635729e-05, 0, 0, -0.0008061889169466293, 0, 0, -3.925903689521952e-05, 0.00136495183055822, 0.002242724811532508, 0, 0, 0.0006855129230870715, 0, 0, 0.0006705576703690303, 0, 0, 0, 0, 0, 0, 0, 0.0006912675860396959, 0.0005585556655232268, 0.0006990797894025085, 0.0004363114999228074, -5.988204721918203e-06, -0.0004875327988745257, 0, 0.000413904701489834, -0.0006541348408683491, 0.003226841606081217, -0.0009869128987286229, 0, 0, 0, 0, 0, -0.0004377378582959458, 0.001569843629875625, -7.432269969368904e-05, 0, 2.655706602049429e-05, 0.0002076499189021399, 0, 0, -0.001008540852362397, 0, 0, 0, 0, 0, 0, 0, 0.0001940196895036954, 0.00336833367407989, 0.0008940397976919873, 0.0004842171419448333, -0.0003707399394992528, -0.0001033286697848498, 0, 0,
-0.0005139220607384141, 0.001775236067285709, -0.0005687552437221291, 0, -0.0002194256267725268, 0.0007155913442701823, 0.005479792935000214, 0.001186950352176549, -0.001132634030268097, 0, 0, 0, -0.000705799754490351, -0.0001586375554354446, -0.0004110954725492704, 0.001529213011242933, -0.0003766097537268949, 0, 0, 0, 8.527385754213993e-05, 0.0004972480261598167, 0, -0.0004786355054041181, 0, 0, 0, 0, -0.0004734754903939497, -0.0002957624214630304, 0, -0.0004087209808542659, -0.001300094971946572, 0.003741889257338882, 0, 0, 0.002202131882873028, 0.001439775380401392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.003167897360479746, 0.001749597467107576, 0, 0, 0, 0, 0, 0, 0.0004739922980191623, 0.001468015654403102, 0, 0,
-0.000622314904225307, 0, 0.0003134535719556414, -0.0003624597139854685, -0.0007929047594539491, 0, -2.367167995594775e-05, 0.0006747441463032731, -0.000114788188616411, 0, -0.0004223239573958123, 0, -0.000453759659388407, 0, -0.0001519841334618926, 0.004100217728614046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0006842704547596028, 0, 0.0002156382771227791, 0.000207984113747602, -0.0004700797825847387, 0, -2.130000782661794e-05, 0.001587087583474172, 0.0007358198907464121, 0, 0.001941534311444831, 0.0004553721207502129, 0, 0, 0.000561174267045249, 0.0008762647566410481, 0.001328211590084119, 0, -0.0007818994481840134, 0.0009873076954653806, -0.0007770184610725231, 0.0007511802721041597, -0.0002976638527397413, 0.001427583446161596, 0, 0, -0.001407053598288401, -0.000499720546954694, 0, 0, -0.0002820000580067373, 0,
-0.0007121509139062339, 0.000545779281095246, 0.001638452947966536, 0, -0.0005993326630697737, 0, 0.001614248317967841, 0, 0.0002075824980779936, 0.0002121679715456194, 0.0002792272663735482, -0.000495972642936306, -0.0004638996061298007, 0, 0.0002652262481260234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0004849211793977274, -1.125866561964281e-05, -0.001124295734614309, -0.0006140674987412387, -0.0001820533274725534, -0.0006044343068696831, 0.005400193231371145, 0, -5.952932211337427e-05, 0.001460719425495643, 5.99519812220615e-05, 3.163632177783052e-05, 0.0002108827238377316, -0.0005727924288831483, 0.001059972699607035, 0, -0.0003312741266880956, 0.001352313815616286, 0, 0, -0.0007377622855610496, 0.003577101740925375, 0, 0, 0.0006293174032087056, 0.001665066137564511, 0.002578211126730629, 0.0004929500714340629, 0, 0, 0, 0,
-0.0002954664654785278, 0.0005864951594561294, 0, 0.0004292170709723919, -0.0003678688386845924, 0.0007907772826995123, 0, 0.001410770032307654, 5.167076618149004e-05, 0.0001642540840871912, 0, 0.007099257722754547, -0.0001620825513834635, 0.001314893255463926, 0, 0.002565456540710643, 0.0002306712774533697, -7.503449526130569e-05, 0, 0.0004425928003907333, -0.000124808261503574, 0.0005913553847132798, 0, 0, 0.0005683253383494204, -0.0001263605406442943, 0, 0, 0.0006762044569247078, 0.000445064788991649, 0, 0, 0.002081016406742053, 0, 0, 0, 0.002276941158701923, 0, 0, 0, 0.0002745193509923116, 0, 0, 0, 0.003662801783120258, 0, 0, 0, 0.0003099890211700397, 0, 0, 0, 0.0008544658059229007, 0, 0, 0, -0.0004595678089089375, 0, 0, 0, -0.0002681262942474649, 0, 0, 0,
-0.0005164660968982846, 0, -0.0002373327515847143, 0, -0.0009331602091881144, 0, -0.0006924634468301878, 0, -0.001022379356392579, -0.0005964951120262703, 0.0003827667300133501, 0.003236939617934735, 0, 0.0004543071689330743, -0.0002757331170716728, 0, 0.0001046403722499957, 3.910978939640275e-05, 0.0007461238688411341, 0.0006885325537591038, -0.0003514871762202412, 0, -0.0004274930061124242, 0, 0.001262710308043749, 0.001016177180217889, 0.0009849488025742603, 0.005433817975342444, 0.0001108466517519861, 0, -0.0004484491192819035, 0, 0.004314607478882627, 0, 0.002868688759800591, 0, 8.004071405398389e-06, 0, -0.0004528168820165058, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0006568356507558093, 0, 0.0004801916916196813, 0, 0.0001868232974729486, 0, 0.001517376569213835, 0, 0, 0, -0.0006342705971868537, 0, 0, 0, -0.0002696963169297153, 0,
-0.0005490173569461329, -0.0001340495986542373, 0.0001213378867074721, 0.001385420315328806, 0, 0.003212662571342859, 0, 0.001004435995980675, -0.0006514345221694063, 0.0004743332878228256, -0.000310072754311124, 0.00118507695410458, 0, 0, 0, 0.0003972999755034745, 0, 0, -8.884719077989255e-05, 0, 0, 0, 0, 0, -0.0004494207554772914, 0, 0.0008696431996384465, 0, 0, 0, 0, 0, -0.0003075955366866102, -0.0003189384833181915, 0.0002288081633146235, -0.0008653145118880545, 0, 0.003542191774869639, 0, 0, -0.000601992412989241, 0, -0.0002451877797700906, 0, 0, 0, 0, 0, 0.002223659505501968, 0, 0.004457345773998951, 0, 0, 0, 0, 0, 0.0003898688372761953, 0, 0.0009113323558796048, 0, 0, 0, 0, 0,
-0.0009298210936643685, 0, 0, 0, 0.0001918506870822903, 0.001174761782469818, 0, 0, 0.0006125696462225585, -0.0006156726296602181, 0, 0, 0, 0, 0, 0, -0.0007610297484814893, 0, 0, 0, 0.0005594831841794762, 0.001086946744903949, 0, 0, -0.0002938202678815602, 0, 0, 0, 0, 0, 0, 0, -2.63091358902451e-05, -0.0002674717551010742, -0.0005404558560990199, 0, 3.818680382773025e-05, 0.002440858092546885, 0, 0, -0.0004170517139701833, -0.0007800662685253654, 0.004934259806461191, 0, -0.0005272982156458914, 0.003515625337151924, 0, 0, 0.000150587100402028, -0.0006475498690433246, -6.016406895805747e-07, 0, 0.0006473780236736808, 0.0008173536257096155, 0, 0, 0.0006154896162386124, 0, 0.001021397324993505, 0, 0, 0, 0, 0,
-0.0003564239863574717, 0, -0.0005877639344017601, -0.0003811996155322642, -0.0003900110459469533, 0, -0.0002907570941250383, 0, -0.0006006553018258077, 0, -0.000283577328365979, 0, -0.0001307989646531506, 0.000675198928393724, 1.104233521540729e-06, 0, 0, -0.0005187609670918384, 0, 0, 0.0006689918457123774, -0.0003599038145766204, -3.375269414606901e-05, 0.006829657202815936, -0.0006188722928075964, -0.0008483284527585267, 0.0007393156859175925, 0.003581893815559212, 0.0005541668542417684, 0.001461992489605764, 0.00082729471351968, 0.002276291049118271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.002663000588130968, 0, 0.003814515035982651, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.000572435684179715, 0, 0, 0, 0.0006554829023213472, 0, -0.0004940502778910688, 0,
-0.0003267745820650328, 0.0005061486131920225, -0.0006151674680893025, 0.0006999933772083161, -0.0003783406184796758, 0, -0.0003730021806642698, 0, 0.0001259916804019506, 0, 0.001797643619101716, 0, 0, 0, 0, 0, -0.000454927157795191, 0, 0.0001365473147184122, 0.0008297204915911099, 0, 0, 0, 0.0004239719385283957, 0.0003529897406152163, 0, 0.0005877473418613826, 0, 0, 0, 0, 0, 4.617635398262631e-05, 0.0001268717288902811, 0.0001519364689357805, 0.0008704841129007411, 0, -0.0006643455402924513, 0, 0.003112594298011938, 0.0004387517001378052, -0.0003374664051804209, 0.0003011028935926374, -0.0005781299826153703, 0, 0.001916803730313133, 0, 0.0004996671530416345, -0.0002134592950447389, 0.0009425299330270606, 0.0018344168117877, 0.0004919047643965695, 0, 0.005476842504188078, 0, 0.0009918242109488592, -0.0001563250074356722, 0.0005490852136023757, 0.0009435446389567662, 0.0006923468696776089, 0, 0.0004466933583437723, 0, 0.0006369016091912105,
-0.0005282870613335487, 0.001164750535880678, -0.0006500975831864442, 0, -0.0003211551204138777, 0.0005073961848738282, -0.0006295947814313941, 0.0002488064575398137, -0.001152510224490547, -0.0003736621141331776, 0, 0, -0.0005285520018591814, 0.00153065609810009, 0.00154354034014039, 0.0006972519686044536, 3.08337813351038e-05, 4.513487173893473e-05, 0.0001397077526529754, 0, 0.0008559301837598657, 0.001046030219598251, -0.0008190859123006262, 0.0005705770105138656, 0.00176026098265257, 0, 0.001080942098513618, 0, -0.0001587238537807499, 0.0007816692426686664, -0.0004338588575163995, 0.0006691116691897825, 0.001067148026708977, 0.0005716566605524993, 0, 0, 0.0003065614874568282, 0.001130292401740543, -0.0007031955874265024, 0.0003808231333064229, 0.000552893851487825, 0, 0, 0, 0, 0.0001245824883600074, 0, -0.0005588373145581342, 0.0001087599119672953, 0.0003544213616152003, -0.0002547337175303834, 0, -0.0001130783214176591, 0.001235597718790671, -0.0006035464145972088, -0.0004370510152119622, -0.0007705729055050389, -0.0006540913947198707, 0, 0, 0.001093292360008058, 0.001997031967964288, -0.0001522603513047267, 0.001083159594598593,
-0.0005212883554332246, 0, -0.0005457506879040557, 0, 0.0002674765091751264, 0, 0, 0, -0.0007045391883735327, 0, 0, 0, -0.0002274488269852339, 0.0006762459961299487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0003494179056361881, 0.001743523501035028, 0.003794356117983103, 0, -4.506726852210933e-05, 0.001310141360035129, 0.0001767868159900574, 0, 0.0002954900302020207, 0.0007195148749204074, 0, 0, 0.002178761334721822, 0.0008786159966304981, 0, 0, 7.708171176717179e-05, 0.0004031017552062904, 0.001092522840136322, -0.0004003610819198207, -0.0003404918119365091, 0.0007308747937094636, -0.0007581476516083152, -0.0002527545377436355, 0.0003363710204594922, 0.001684596369058767, 0, 8.771696968696337e-05, 0.0008897924014884419, 0.001408073519623692, 0, 0.0002117706211589884,
-0.0006489279187611513, -0.0006496790457515377, -8.19825080629857e-05, 0.0002804007764078078, 2.161815475317778e-05, 0, -0.0002268126265638601, 0.0002824219052038137, 0, -0.0007675136187038781, 0.0009025345903105603, 4.717121651475738e-05, 0, 0, 0, 0.0002292485613595359, -0.0005062216632379406, 0, -0.0002380613551378201, 0.0008127284971336846, 0.0006887688189069004, 0.0004668110823582373, -0.000231675859922827, 0.000777332392265498, 0, 0, -0.0006518092457060098, 0.001352495779847311, 0, 0, 0, 0.0009186396322635862, -0.0006217921191886096, 0.0006482066252931012, 0.0002279883658830245, 0.0005261735323241207, -0.0005481730391160244, 0.0002187817437202093, -0.0002670045935624739, 0.0004957964923713062, 0, -0.0008581990322169832, 0.0007631848214097291, -0.0003192906942932084, 0, 0.00515198080105444, 0, 0.003985630503046841, 0.0009989950452279036, -0.0004553944350423184, -1.343000898998412e-05, 0.001582895324361249, 0, 0.0004487144391311561, 0.0005630409334113288, 0.0001525096336135096, 0, 0, -0.0004984969843695291, 0.001042742218003058, 0, -0.0006629163943397248, 0, 0.0005974963428309149,
0.0002170516517067603, 0.0007876691162149943, 0, 0, 0, 0, 0, 0, -0.001227363843474566, -0.0001959653515594488, 0, 0, 0, 0, 0, 0, -0.0002738808046290202, 0.0008760049422652747, -0.0002435244701737321, 0, 0, 0, 0, 0, -0.0002081103897847562, 0.0004923749999335665, -0.0007524813141046461, 8.630338282124273e-05, 0, 0, 0, 0, -0.0001624026256651176, 0.001179731392183913, -0.0006670678980145242, 0, -0.0005047805703074567, 0.0006101444780928422, 0.00453947875577079, 0, -0.0002037045197158563, 0.0001131818975487894, -0.0008240513885296781, 0, -0.0007522565669970368, -0.0003854408539137314, 0.0006645940830078677, 0, 0.000463350318690323, 0.001203692749810378, 0.0007373113971671686, -0.0004540528115840883, 0.001547257736448999, 0.003321969206038651, 0.0003546746628225741, 0, -0.000149590475343146, 0.0005052568723440818, 0.001794912678994772, 0, 0.0003455629400171498, 0, 0, 0,
-0.0007178045831724404, 0.0004981141330407629, -0.0007413049323460104, 0.0007176546558266867, 0, 0.0006719808420729147, 0, 0.0006401913796706865, -8.648541259663579e-05, 0.0005647415188083905, 0.0002431695626356949, 0.0001718953718876683, 0, 0.0006381675699296855, -0.0003759369360740713, 0.008359108087644859, 0, 0, 0, 0, 0, 0, 0, 0, -0.0004908405536888504, 0, 0.0005578160467455592, 0, 0, 0, 0, 0, 0, 0.000316895437906948, 0.0001646367805070749, 0.0003056773486273509, 0, 0, 0, 0, -0.0004625278811514009, 0.0003812279482689163, 0.0001159732456521491, 0, 0, 0, 0, 0, 0, 0, 0.0006562265859483474, 0, 0, 0, 0, 0, 0, 0, -0.0004460578265720108, 0, 0, 0.0004099122607782437, 0, 0,
-0.0001492009029290907, -0.00102239269719246, 0, 0.0002044452526835818, -0.0004545848407270164, 0.0005075177602549989, 0, 0.001156840928155775, 0.0008300127274579861, -0.0008800641041021749, 0, 0.0003215921067677863, 0.001155386645134764, -0.001162004333830272, 0, 0.001529548718265837, -0.0009069117477607764, -0.001212147995933681, 0, -0.0003730627555454459, -0.0008913310084429557, 8.656304142661673e-05, -0.0003834198468969425, -0.0003552160191481757, -0.0007149363131029685, -0.000823902034391087, 0.0006513048866637434, -0.001260553662433046, 0.0003785527225481859, -0.0007151696065013957, 0.0006575345050523648, 0.0004538570028157858, -0.0003544467984384763, 0, 0, 0, -4.943593271473418e-05, 3.954479014106659e-06, 0.0006783441752209699, 0.0017957794504069, 0, 0, 0, 0.0008965856659345148, 0, 0, 0, 0.001085454369968988, 0, 0, 0, 0.001308680832429898, -0.0004740393752326749, 0, 0, 0, 0, 0, 0, 0.0007842538652205567, 0, 0, 0, 0,
-0.0003990439790792018, -0.0004821798621621384, -0.0001610181462574562, 0.0001812106301363981, -0.0004842377701748443, 0, -0.000313526598776884, 0.0004019064102134589, 0.0001398245991767389, -0.0007298768234984797, 0.0002712268035926581, 0, -0.0003941612738160007, 0.007523308813294868, -0.0001727919708742731, -0.0009198036745743803, -0.0003822364643729187, 0, 0.0008166578112086133, 0, 0.0002863703775662639, 0, 0.001259227691181283, 0, -0.0004534517794160874, 0, 0.0005106077299911373, 0, 0.0009571485105116197, 0, 9.820775528159011e-05, 0, 0.0003349416146725067, 0.0003247936514508687, 0.0006054085177667196, 0.0007588970077844595, -0.0002091979780888813, 0, -0.0001336568646210719, 0, -0.0002805793407344189, 0.002838169782467469, 0.001382679845247175, 0.00259482323628804, -0.0003246220769437881, 0, 4.681568791377165e-05, 0.0005197850405744152, -0.0006203826967449353, 0, 5.013671940523663e-05, 0, -0.0003771225364869941, 0, -0.0003776715590948656, 0, 0.001254260438740283, 0, -2.365777722300138e-05, 0, -0.0003279144903418348, 0, 0.0002952192710481339, 0,
0.001950926019104994, 0, -0.0004391774904989133, 0, 0.002363808193670278, 0.0003167381924902551, -0.0001383792491355885, 0.0007493790789657993, -9.70890722003898e-05, 0, -0.0007946085354110022, 0, -0.0003345984748509313, 0, -0.0001347184630481842, 0.003882936652888907, 0.0005369145169917057, 0, -0.0005214826386612436, 0.001213626075023118, -0.0009913315473734105, 0.0009220740168859722, 0.0005636825495963616, 0.0003023144047971629, -0.0005450454563014517, 0, -0.0006339723495278656, -0.0003792482583569007, 0.002010136166101576, 0, 0.002725946089059442, 0, 0, 0, -4.82901356976868e-05, 0, 0.0004408673298967711, -0.0007823578545713906, -0.0002728427067274949, 0.0005466275895905316, 0, 0, -0.0007223512565759855, 0, 0, 0, 3.405200399439516e-05, 0, 0, 0, 0.001045376630608383, 0.0009707414832563971, 0, 0, 0.0002712607141750527, 0.001084054353192081, 0, 0, -0.0005581563941268185, 0, 0, 0, -0.0003903918401243576, 0,
-0.0006196315075538793, -0.0006910808662165247, -0.0001224844696092987, 0.0004372800138754034, 0, 0, 0, 0.0002643545500720938, -0.0009016923513010417, -0.000502039427749442, -0.0002501073088144953, -2.636440591673881e-05, 0, 0, 0, 0.0002889054197344695, -0.0004448019513303728, -0.000149423189539613, -0.0006597652095123425, 0.001021912159850919, 0, 0.0002102371002153657, 0, -0.0002348707332558688, 0, -0.0001874366538054503, 0.00152545293901053, 0.0001003363571303032, 0, 0.0008885366086245015, 0, 0.007383229179610353, -0.0006537754648640992, 0.0008824374100991473, 0.000189756051287432, 0.001433249544531068, 0, 0.0004721834240045291, 0, -0.000826918112725304, -0.0007066478084070252, -0.0003706131212316381, -0.0001005326458544585, 0.0003884941284693943, 0, 0, 0, -0.0006042728820981026, -0.000331348575189331, 0.0003059213717272676, -0.000890828175888655, 0.001015675831128037, 0, 0.0008480768642623447, 0, 0.0002671648727907882, 0.0006122201642172175, 0.0002548830621356045, -0.0005276261756635031, 0.0006063373753815434, 0, 0.0006489374277132869, 0, -0.000421531151114674,
-0.0003028029447608651, 0, 0.0005671044360817967, 0.006326465553354869, -0.0002549711739616011, -0.0003573557494494941, 0.0006819780034247841, 0.001454577563701034, 0.0006978168232710413, 0, 0, 0, 0.000634914215912555, 0, 0.0005663694569396666, 0, -0.0003538570653655576, 0, -7.076106198656742e-06, 0, -0.0003793820376887636, 0, -0.0005412562390712661, 0.0003947730348052385, 0, 0, 0, 0, -0.0005155821699022753, 0, 0, 0, 0.0009927257619761528, 0, -0.000777280663870836, 0.0001042517826894126, 0.0006899901350452442, 0, 0.0005379696905653081, 0.0003411723466078882, 0, 0, 0, 0, -0.0004190607392562176, 0, 0, 0, 0, 0, 0, 0, 0.0006604985196359605, 0, 0.0002044225907176652, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, -0.0004790298681194371, -6.084865826307465e-05, 0, 0, 0, -0.0002985383587053768, -0.0006219172558178527, -0.0009571965072128961, 0.0002658954599601075, 0.0008785582417795095, 0, 0.0003320327359693916, 0, 0.0007188922001779683, 0, 0, -0.0005577359513191936, -4.22211306120087e-05, 0, 0, 0, 0.005744979510954894, -0.0008207710558717742, -0.001142843563589792, -0.0009091361688109104, 0.0002567476460294396, 0, 0.0005901896568524734, 0, 0.0003801276698525161, 0, 0, -0.000274992120253715, 0.001769636848654943, 0, 0, 0, -0.0005668374388053646, -0.0004005890778079432, -0.0003714104902645104, 0.0001813038235686789, 0.001905230460963107, 0, 0, 0, 0.0007816327419452349, 0, 0, -0.0007403123384074313, 0.0002046207893103826, 0, 0, 0.0003918122371103782, -0.0006037756081727216, 0.0004227607285998697, 0.0004135684627064461, -7.490850316681599e-05, 0.0001919459138017029, 0, -0.0003462981641958502, 0, 0.0005809499545792391,
-0.0003182639234446333, 0, 0, -0.0006439838281657654, -9.494123887528625e-05, 0, -0.0006842956041700521, 0.002735136248791789, 0, 0, 0, 0, 0, 0, 0, 0, -8.765859462163949e-07, 0.005565822262220705, 0, 0, 0.0003858611934078806, 0, 3.896566534528896e-05, 0.0005065105476583948, 0.0006932240681061522, 0.0002140379785965487, 0, 0, -0.000207483518248694, 0.0001057089319769625, 0, 0.0003408525917057664, -0.0003260785896606366, 0, 0, 0, -0.0001316860150293959, 0, 0.002705962304439181, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0002488975340399148, 0.002903603485576867, 0, -0.0009693606834261898, 0.0006487094220706277, 0.0002286173899828995, 0.0005494269090367431, 0.0003855587781572249, 0.0003870529225646728, 0, 0, 0, 0, 0, 0, 0,
-5.914629769825754e-05, -0.0005467523423352674, 0, 0, -0.0008513663318191743, -0.000614287409260388, 0.001767711873079536, 0.001235741821954771, -0.0009429718581874365, -0.00045386011948859, 0, 0, 0, 0, 0, 0, -0.001024242660951422, -0.0001759683617931722, 0, 0, -0.0006710675856555387, -0.0008938056615604784, 0, 0, 0.0006883566792430163, -0.0008360598211957873, 0, 0, 0, 0, 0, 0, -0.0002392374126647858, 0.0004806332682152521, -0.001155015825976419, 0.0003882085323759743, -0.0005728430790727283, 0.0005458730236805303, 0.004512295579590315, 0.0006112723535823212, -2.94945851289714e-05, 0.001163856715909844, -0.0004323706494783549, 0, -0.0008736287787364131, 0.00242202187119025, 0, 0, -0.0001007143929565747, 4.688255259934234e-05, 0, -0.0002754882566175649, 0.0007879244202505447, 0.0001822096387112598, 0, 0, 0.0005739455927955991, 0.0009693967008349033, 0, 4.086877401605567e-05, 0.0001044315758125341, 0.002907775779334374, 0, 0,
0, 0, 0, 0, 0.001771328915377654, 0, -0.0001007219900669079, 0, 0.0006319104299630602, 0, -0.0005173571047440836, 0.0002446014639993832, -0.0001139898416681879, 0.0007350425942402013, -8.043788126631233e-05, 0.002171037291017734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0002186169021259087, 0.0003009141470916593, -0.0001431914528465128, 0.0005679099332130239, 0.0003078136225201359, 0.004961537213062171, 0.00483771823107261, 0, 0, 0, 0, 0.003914938106033923, 0, 0.001728321204643142, 0, 0, 0, 0, 0, -4.300248158907024e-05, 0.0001307406857818204, -9.059367360635358e-05, 0.003065354677328261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0003401921548586373, 0, -0.0003449198029973474, 0,
-0.0002178882251001709, 0.0008243863670617161, -0.0007575799171595997, -0.0006337646686780659, -0.0005748483118481625, 0, 0, 0, -0.0004277301005829455, -0.0002743954119729782, -0.0009160066759920216, 0, 0, 0, 0, 0, 0.0006304646283294304, 0.000638115377111812, -0.0006605611919280644, 0.0009593354840779701, 0, 0, 0, 0, -0.0008903084074489298, 0, -0.0005372884568307658, 0, 0, 0, 0, 0, 2.150196152513088e-05, 0.0007776101381981827, -0.0001711685514697422, -0.0002229922709993225, -0.0009520258388259406, 0, -7.056861560987551e-05, 0, -0.0002752557886519012, 0.004408171398760844, -0.0001405285219829221, 0, 0.004682814486391671, 0, 0, 0, 0.0001204471272110709, 0.000698671873143744, -0.0006103476220301672, -0.000214438262646315, 4.74931585642979e-05, 0, 0.001002780171725195, 6.968070654529998e-05, -0.0004074984376355384, 0, -0.0004313439368570032, 0, 0.000424210449110337, 0, 0, 0
]
cat_features_hashes = {
}
def hash_uint64(string):
return cat_features_hashes.get(str(string), 0x7fFFffFF)
### Applicator for the CatBoost model
def apply_catboost_model(float_features, cat_features=[], ntree_start=0, ntree_end=catboost_model.tree_count):
"""
Applies the model built by CatBoost.
Parameters
----------
float_features : list of float features
cat_features : list of categorical features
You need to pass float and categorical features separately in the same order they appeared in train dataset.
For example if you had features f1,f2,f3,f4, where f2 and f4 were considered categorical, you need to pass here float_features=f1,f3, cat_features=f2,f4
Returns
-------
prediction : formula value for the model and the features
"""
if ntree_end == 0:
ntree_end = catboost_model.tree_count
else:
ntree_end = min(ntree_end, catboost_model.tree_count)
model = catboost_model
assert len(float_features) >= model.float_feature_count
assert len(cat_features) >= model.cat_feature_count
# Binarise features
binary_features = [0] * model.binary_feature_count
binary_feature_index = 0
for i in range(len(model.float_feature_borders)):
for border in model.float_feature_borders[i]:
binary_features[binary_feature_index] += 1 if (float_features[model.float_features_index[i]] > border) else 0
binary_feature_index += 1
transposed_hash = [0] * model.cat_feature_count
for i in range(model.cat_feature_count):
transposed_hash[i] = hash_uint64(cat_features[i])
if len(model.one_hot_cat_feature_index) > 0:
cat_feature_packed_indexes = {}
for i in range(model.cat_feature_count):
cat_feature_packed_indexes[model.cat_features_index[i]] = i
for i in range(len(model.one_hot_cat_feature_index)):
cat_idx = cat_feature_packed_indexes[model.one_hot_cat_feature_index[i]]
hash = transposed_hash[cat_idx]
for border_idx in range(len(model.one_hot_hash_values[i])):
binary_features[binary_feature_index] |= (1 if hash == model.one_hot_hash_values[i][border_idx] else 0) * (border_idx + 1)
binary_feature_index += 1
if hasattr(model, 'model_ctrs') and model.model_ctrs.used_model_ctrs_count > 0:
ctrs = [0.] * model.model_ctrs.used_model_ctrs_count;
calc_ctrs(model.model_ctrs, binary_features, transposed_hash, ctrs)
for i in range(len(model.ctr_feature_borders)):
for border in model.ctr_feature_borders[i]:
binary_features[binary_feature_index] += 1 if ctrs[i] > border else 0
binary_feature_index += 1
# Extract and sum values from trees
result = 0.
tree_splits_index = 0
current_tree_leaf_values_index = 0
for tree_id in range(ntree_start, ntree_end):
current_tree_depth = model.tree_depth[tree_id]
index = 0
for depth in range(current_tree_depth):
border_val = model.tree_split_border[tree_splits_index + depth]
feature_index = model.tree_split_feature_index[tree_splits_index + depth]
xor_mask = model.tree_split_xor_mask[tree_splits_index + depth]
index |= ((binary_features[feature_index] ^ xor_mask) >= border_val) << depth
result += model.leaf_values[current_tree_leaf_values_index + index]
tree_splits_index += current_tree_depth
current_tree_leaf_values_index += (1 << current_tree_depth)
return result
| class Catboost_Model(object):
float_features_index = [0, 1, 2, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 17, 20, 22, 24, 27, 28, 31, 32, 33, 34, 35, 37, 38, 39, 46, 47, 48, 49]
float_feature_count = 50
cat_feature_count = 0
binary_feature_count = 31
tree_count = 40
float_feature_borders = [[0.175395012, 0.1838945, 0.378224492, 0.646430016, 0.794435978], [0.00386904506, 0.0143127497, 0.0237283502, 0.113178, 0.117846504, 0.140969992, 0.151769012, 0.156479999, 0.202911496, 0.38756001, 0.485974014], [0.00861673057, 0.557633996, 0.758180022, 0.817595959, 0.888193488, 0.902011514, 0.903753996, 0.937548518, 0.937671542, 0.937812984], [0.5], [0.5], [0.5], [0.5], [0.5], [0.5], [0.5], [0.386274517, 0.413725495, 0.421568513, 0.496078491, 0.566666484, 0.598039031], [0.46657151, 0.550505519, 0.587584972, 0.626136005, 0.658094525, 0.669399023, 0.748417497, 0.76047051, 0.778998971, 0.81042254, 0.834022045, 0.941508055], [0.0252820998, 0.0504557006, 0.0924388021, 0.240712494, 0.254698515, 0.318728, 0.333916008, 0.365603, 0.37875849, 0.387778997, 0.39003402, 0.540594995, 0.586225033, 0.651247025, 0.692146003, 0.735934496, 0.795647502], [0.0704644024, 0.1199295, 0.126112998, 0.128601998, 0.143661499, 0.149134487, 0.149136499, 0.150786504, 0.260086477, 0.261237979, 0.26285702, 0.277716517, 0.277717501, 0.277720511], [0.339215517, 0.382353008, 0.390195996, 0.394117475, 0.398038983, 0.413725495, 0.488235474, 0.492156982, 0.507843018, 0.531372488, 0.711764991, 0.750980496], [0.5], [0.0225447994, 0.0261416994, 0.182705492, 0.937511444, 0.939667463, 0.945958018, 0.952567995, 0.954834998], [0.5], [0.5], [0.0867389515, 0.0950040966, 0.141615003, 0.148920506, 0.348527014, 0.513378978, 0.516897023, 0.724137545], [0.5], [0.172385991, 0.185759991, 0.198566005, 0.451892495, 0.84256053], [0.5], [-0.0314164981, 0.0439245999, 0.117502004, 0.166823998, 0.245040998, 0.318073004, 0.344751, 0.345134497, 0.348299503, 0.361798525, 0.423586994, 0.476337016, 0.681255519], [0.00143194001, 0.00513814017, 0.0090128053, 0.0309973005, 0.0367250517], [0.02983425, 0.0453458503, 0.189270005, 0.357340515, 0.651507497, 0.654693007, 0.656473994, 0.726830006], [0.000425621984, 0.000653013994, 0.00177894998, 0.001926005, 0.00270928489, 0.00354014011, 0.00393318012, 0.005463365, 0.00603085477, 0.00666473527, 0.00760281505, 0.0188514516], [0.231252998, 0.42613101, 0.49158749, 0.599743009, 0.641760468], [0.432520002, 0.460792005, 0.472368002, 0.502859473, 0.525056005, 0.549761534, 0.595171452, 0.60571146, 0.695415974, 0.711432993, 0.715005994, 0.725735545, 0.772307515, 0.778638482, 0.873877525, 0.982075989], [0.261609018, 0.264095008, 0.273368478, 0.276944995, 0.340994507, 0.46727401, 0.48003298, 0.547486544, 0.640262485, 0.662613511, 0.718292952, 0.748547494, 0.758205533, 0.870769978, 0.911834955], [0.5]]
tree_depth = [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
tree_split_border = [1, 8, 8, 7, 2, 11, 1, 3, 5, 6, 2, 2, 10, 5, 12, 9, 6, 1, 8, 13, 13, 12, 2, 1, 1, 8, 3, 5, 4, 1, 9, 13, 14, 8, 5, 5, 5, 7, 15, 13, 1, 5, 12, 1, 3, 2, 10, 3, 1, 3, 6, 4, 14, 4, 6, 10, 3, 4, 3, 1, 12, 7, 1, 5, 2, 5, 9, 2, 10, 5, 4, 6, 8, 6, 2, 12, 9, 5, 13, 3, 4, 1, 7, 4, 14, 7, 15, 10, 8, 7, 1, 1, 5, 1, 4, 1, 11, 16, 1, 7, 7, 4, 4, 2, 3, 11, 8, 1, 1, 11, 1, 6, 7, 1, 1, 9, 2, 9, 4, 14, 9, 3, 7, 3, 5, 12, 3, 4, 16, 6, 14, 1, 5, 15, 3, 1, 3, 4, 7, 8, 1, 1, 9, 15, 1, 9, 5, 5, 3, 6, 7, 9, 2, 10, 4, 1, 11, 9, 7, 2, 2, 4, 2, 2, 8, 11, 1, 2, 2, 14, 11, 8, 12, 8, 1, 7, 7, 3, 1, 12, 1, 2, 2, 8, 7, 5, 6, 4, 4, 4, 5, 1, 4, 2, 3, 13, 10, 6, 1, 4, 6, 3, 6, 6, 8, 3, 1, 1, 11, 9, 1, 1, 7, 1, 5, 11, 10, 8, 5, 6, 1, 4, 10, 14, 10, 1, 1, 1, 15, 6, 1, 1, 8, 13, 4, 10, 17, 14, 5, 1]
tree_split_feature_index = [19, 1, 26, 11, 24, 23, 20, 26, 14, 23, 12, 21, 28, 29, 14, 1, 14, 6, 29, 12, 28, 13, 25, 21, 20, 12, 11, 1, 25, 18, 26, 29, 12, 25, 28, 23, 16, 26, 28, 12, 22, 14, 29, 9, 2, 11, 23, 16, 20, 1, 2, 0, 29, 25, 28, 2, 12, 24, 10, 1, 28, 12, 2, 13, 14, 10, 28, 1, 12, 26, 16, 10, 28, 1, 2, 23, 13, 11, 28, 26, 13, 3, 13, 21, 28, 1, 12, 1, 11, 29, 20, 9, 21, 26, 12, 14, 26, 12, 30, 14, 25, 2, 19, 29, 0, 1, 25, 25, 20, 12, 17, 26, 16, 0, 20, 2, 10, 23, 27, 12, 2, 23, 14, 21, 26, 12, 19, 26, 28, 10, 12, 17, 19, 12, 24, 17, 27, 13, 2, 23, 30, 11, 29, 12, 20, 11, 2, 12, 25, 29, 28, 14, 0, 29, 1, 18, 28, 12, 25, 24, 27, 29, 19, 26, 16, 29, 5, 23, 28, 12, 13, 14, 26, 13, 20, 23, 2, 13, 7, 11, 29, 28, 13, 25, 14, 0, 2, 11, 14, 23, 27, 3, 28, 16, 29, 13, 11, 25, 28, 13, 19, 14, 16, 11, 2, 28, 10, 8, 14, 12, 29, 13, 19, 3, 14, 11, 2, 19, 24, 12, 12, 10, 26, 12, 13, 24, 4, 15, 29, 13, 23, 16, 2, 23, 28, 14, 12, 13, 25, 27]
tree_split_xor_mask = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cat_features_index = []
one_hot_cat_feature_index = []
one_hot_hash_values = []
ctr_feature_borders = []
leaf_values = [0.05960256437951928, 0.06070146909282823, 0.06015918889076437, 0.05959448117928647, 0.0599721206163218, 0.06062821605892021, 0.0605089520658085, 0.06288086010413954, 0.05955195210314157, 0.06099448115395449, 0.06229438070265529, 0.06050201132893562, 0.06192215820207864, 0.06190509985324542, 0.06176463823760008, 0.06162483396958104, 0.06005946608783778, 0.06062279438329973, 0.06004824625411104, 0.06064448116028749, 0.06103598718641752, 0.06270338815639177, 0.06267781612256605, 0.06172957858253918, 0.05938985894333002, 0.06132279437063375, 0.0613444811476215, 0.06109824623511206, 0.0616944811412885, 0.0620775132274143, 0.06146759860387622, 0.06253466764112585, 0.05988602370841774, 0.0604175986228752, 0.05969421006123277, 0.06050201132893562, 0.06009357756463582, 0.0597648340096226, 0.06094687741927594, 0.06145321607326258, 0.06024776317952554, 0.06096483398790947, 0.06303508723080734, 0.06050201132893562, 0.0608775135811513, 0.06275863771560382, 0.06071954670341606, 0.06099448115395449, 0.05989259863237469, 0.0648667073624649, 0.06050201132893562, 0.06050201132893562, 0.06050201132893562, 0.06221517819009029, 0.06050201132893562, 0.06404448115730725, 0.05957821609654565, 0.06004824625411104, 0.06050201132893562, 0.06050201132893562, 0.06050201132893562, 0.06240996302870024, 0.06057324624461156, 0.06019598720161671, -0.0009068310388559024, 0.0005823790048818268, 0.0003022397759053274, 0.001236387425717793, -0.001110814547534013, 0, -0.0009955282825560336, 0.0005900790335013008, -0.0007270945767319858, -0.0004503618368394611, -0.0004830951003004704, 0, -0.0007312046291846942, 0, -0.0003228709852496245, 0.001331784484289174, -0.0009001571778393695, 0.0008336580731940341, 0.0001846719011632316, 0.001297891181080824, -0.0009618816738515486, 0, -8.710280354874739e-05, 0.000935069827523146, -0.000469122101802195, 0.000927062975956497, 0.0009596543982336384, 0.0001628772571593989, -0.0005596775005835593, 6.159951384984342e-05, -0.0003414199319814777, 0.002115943356260228, 0, -0.001142222399221946, 0, 0.001164318208439542, -0.000457458598429662, 0.0005900790335013008, 0, 9.584290627186962e-05, 0.001870434369045688, 0.0005927637363117251, 0.0005925413825713574, 0.0005833861550049742, 0.0002303670248576997, 0.005328653757534604, -0.000235488818658018, 0, 0, -0.0003494213597650448, -0.0003075385840448801, 0.001911465205838799, 0, 0, 0.0003968806892349656, 0.001932862827397617, -7.592085855706009e-05, 0, 0.001140556113073425, 0.002650395860214851, 0.0002143034913390684, 0, -0.0003199517355933474, 0.002342043877120708, -0.0008255076879879013, 0, 2.963474536994075e-05, 0.00133157584475381, 0, 0, 0, 0, 0.0007332090569434432, 0, 0.0008839420666393279, 0.0005411137808915025, 0, 0, 0, 0, -0.001174172258888733, 0, -4.880608934416334e-05, 0.00304220442197527, -0.0005631011493398127, 0.0005856534408489607, -0.0005797420271229933, 0.0004137618636092113, -0.0008903556334588118, 0, 0.000323080433781681, 0.002877251136554585, 0, 0, -0.00110589081834929, 0, 0.0006752537541109018, 0, 0.000859004559224972, 0.001944385151182034, 0, 0, 0, 0, 0.000903436633701007, 0, 9.139636452584899e-07, 0.003837850096914544, 0, 0, 0, 0, -0.0001616476694876037, 0.0005893602117203287, -0.0005399148187012325, 0.001545423564299556, -0.0007188761029023953, 0, -0.0006385464476446567, -0.0004582376131230649, 0.0003343360984731416, 0, -0.0002103706994374059, 0.00156091289019888, -0.0004528359406640871, 0, -0.0009069158758616088, 0, -0.000401568779496549, 0.000126501580156415, -0.0006511481172762662, 0.000624371256332249, 0.0009127066324430423, 0.001309104305710209, 0, 0, -0.0008082733811971049, 0.001317802216441966, 0.005863355179659432, -0.0002214717502162596, 0, 0, 0, 0, -0.000130804229269851, 0.0002501883127191267, 0, 0.0006507025885549615, 0.0005601015702535238, 0.001205826632256492, 0, 0.0003921999650066529, -0.000977879599203093, 0.0001450362731798309, -0.0003189307834865347, 0.002300871759266034, 0, 0, 0, 0, 0.001046991258519593, 0.0002194142615655317, 0, 0, 0, 0.004095668452432496, 0, 0, -0.001146915860843075, 0.002602714598010289, 0, 0, 0, 0, 0, 0, 0.0001941932952346267, -7.77357115687177e-06, 0, -0.0004107193418927222, 0.001420769828524477, 0.002088915532621854, 0, 0, -0.0004531241522537246, 0.00058433738518943, 0, 0, 0, 0.004054731721198525, 0, 0, -0.0008986334950566576, -0.0003815477805714486, 0.0001680492376123468, 0, -0.0008152289339438823, 0.001241603629413865, 6.038870670514412e-05, 0, -0.0006777894151986823, 0.002102271045086913, 0.0004503061015964687, 6.11546265669483e-05, 0.0001038563561778671, 0.0007176545796428096, 0.003414784714422588, -0.0009525145408156789, -0.0008958140255386376, 0.00578281017516635, -0.0005853509346225964, 2.475672695798763e-05, -0.0003011946281607049, 0.001594888585597788, -0.0002152025968347746, 0, 0.0006538688771301455, 0.0006035505368545839, 0.0004687583720916312, 0.0005727045197730552, 0.0002980731734116802, 0.001841195473683457, 0.00102922626796895, 0.0004567081468439011, -0.000345977341587908, 5.912827139725208e-05, 0, 0, 0.001843387323466271, 0, 0.0005850660534626809, 0, -0.0004503988499311936, 0.00302899319613218, 0.0007598776450626112, 0.0003016918923439847, 0.0007711134900818612, 0.003650110205298897, 0.002103213104474725, 0.0007489497931014422, -0.001014163973340277, -0.0001379779160878587, 0, 0, -0.0004398661035316483, 0.001115304487633738, 0, 0, -0.0007906387768084228, 0.0007188906932456458, -0.000489375435877958, -0.0004817550370255072, 0.0002620610283638666, 0.001626712002241777, -0.0005226102083038629, 0, -0.0007948534981611709, 0.0005256298072493532, 0, -0.0004549889615015632, 0.003689839804145559, 0.001351341131338389, 0, 0.001698023934270857, -0.0005047437686986064, -0.00122029721761542, 0, 0, 0, -0.0005946516372080023, 0, -0.0005829890844505032, 0.0004829617451990933, 0.001274351667237778, 0.0003364182016724926, 0.0007998888509950559, 0, 0, 0, 0, 0.001119482876265136, 0.001105979857942378, -0.0004952809722155348, 0.002478559937691653, 0, 0, 0, 0.0001484914796241115, -0.0004451098185261131, 0.0005219659759947921, 0.002625771677078105, -0.0004622626688093997, 0.003180176853643922, 0.000500793877487153, 0, 0, -0.0002482971942041805, -0.0007280251509266012, 0, -3.037432140477268e-05, 0, 0, 0, -0.0004793245006222285, 0.0004976954132640868, 0.001931034063756475, 0.002701688975660498, 0.002544442354066031, 0, 0, 0, 0, -0.0003050469065930951, 0.0005443530127708044, 0.002513587434501194, 0.001189114549536518, 0, 0, 0, -0.0004588780301996969, -0.0006018063431015334, -0.001027882254846747, 2.096042226701643e-05, 0.001465262300263499, 0, 0, 0, 0, 0.005799503978290448, 0, 0.0005145142843527017, -0.0007292303078440648, 0, 0, 0, 0, -0.0001376545879859117, 0.000638494729025773, 0.0005716629263118272, 0.001346967505691378, -0.0007881469465385549, -0.0001152312742054467, 0, 0.001811460642135851, 0, 0, -0.0003250594153976753, 0, 0, 0, 0, 0.0003776421757637712, -0.0008928773470896611, -0.0005702509148721005, 0.0001669308364415138, -0.0002957771092143147, 0, 0, 0, 0, 0.0017671583786665, 2.837842173810271e-05, 0.0008905397402366979, 0, 0, 0, 0, 0, -0.0004902131531725223, -0.0002656417725737849, -0.0003088892837797236, 0.0004202085992080763, 0, 0.005003087301980368, -0.0005056454655113847, 0.00214035032465187, -0.0004989248653304542, 0, 0.0003890801386909085, 0.002138011279776907, 0, 0, 0, 0, -0.0007755504715727673, 0, -0.0004204031612023624, 0, 0, 0, 0, 0, -0.0004779051632618724, 0.0001444596925768664, 0.0007942280630878249, 0.000476885076201495, 0, 0, 5.94703731287996e-05, 0, -0.0009695591590630888, -3.306461497428595e-05, -0.0003411943477162227, 0, 0, 0, 0, 0, -0.0005915237194839268, -0.00073286533616917, 0.001887835849914902, -0.0002159006130392399, 0, 0, -0.0004753391459828818, 0, -0.0004557268087725886, 0.0003625714795935948, 0, 0, -0.00046934253069617, 0.001482074976041942, 0, 0, -6.24648591147674e-05, 0.0006197511774949764, 0, 0, 0.0005291375057499191, 0.001811277370933497, 0, 0, -0.000251463684539595, 0.0003647218287826905, 0, 0, -0.00032442822753098, 0.008879695687050524, 0, 0, 0.0002095073790056473, 0.001286106916419528, 0, 0, 0.003316247698205191, 0.001868766907544536, 0, 0, -0.0009064867939690254, -6.289037836985422e-05, 0.000116801339250223, 0.0005817873910002115, 0, 0, -0.0004317378022444221, 0.003432489374344434, -0.0008790418360227249, 0.001456067401118563, 8.891999216473525e-05, 0.000246647422399483, 0, 0, 0, 0.002353324402389184, 0, 0, 0, 0, 0, -0.0004816708203667504, 0, 0, 0, 0, 0, 0.0005288136498155091, 0, 0, 0, 0.0005183401916112455, -0.0006703698588571763, -0.0002763252466532651, -2.992403102921954e-05, 0.001095334115751643, 0, 0, 0, 0.001145794722112049, -0.0003978397558084178, -0.0004953502641970411, -0.0001049304671522831, 0.001116795384311774, 0, 0, 0, 0.00113992338296903, 0, 0, 0, 0.002121715232935706, 0, 0, 0, 0, 0, -0.0005056097778732027, 0, 0.001630175745346752, 0, 0.005957641231429225, 0, 0.002564929792739056, -0.001309906402417095, -0.000483219173206812, 0, 0, 0, 0, 0, 0, 0, 0.0008790466595663336, 0, 0.003547242719709221, 0, 0, 0, 0, -0.0008567939602030077, -0.0001547517035176911, 0, 0, -0.0009220552743975222, 0, 0, 0, -0.000624409975612866, 0.002543656756142583, 0, -0.0004780582892947462, 0, 0, 0, 0, -0.0003446552011669872, 0.000713508286506049, 0, 0, 0.000333324690501642, 0.0009309298456827793, 0, 0.006240501932570201, 0, 0.001105751986493601, 0, 0, 0, 0.0005431102649102487, 0, 0.0008188683761877446, -0.0005535329218846543, 0.0008259885125883971, 0, 0.0005037592164560795, -1.835854270367367e-05, 0.001023440203380021, 0, 0.003560756342014944, -0.0007074878200965966, 0.000864907039003376, 0, 0, 0.0001366822670473724, 0.001582580905874072, 0, 0.002009939296764808, 0.0003865646072311214, 0, -0.0008022744565057487, 0, 0.0001632846231533874, 0.001101093882966966, 0.000983660079051305, 1.398142836853892e-05, -0.000374276171862653, 0, 0.001090262096296609, 0, 0.0001759454007802445, 0.001428484187277461, 0.0009458415932637716, 0.0004677293190348015, -1.742515794061892e-05, 0, -0.000343364609050618, 0, -0.0003360883810472326, 0.0009711315628411175, -0.0007338417623763982, 0, -0.000790314139660284, 0, 0.002384392712423223, 0, 9.287363993105999e-06, 0.008189467692436558, 0.0005459256059258664, -0.00051786086249799, -0.0003552316262792518, 0, -0.0004572245615290128, 0, 0.0001095514616914518, 0.00098596745429519, 0, 0, -0.0007204364400038682, 0, 0.0001850400591086591, 0, -0.0001150445134624198, 0.0005181616065208171, -0.0002437024959346003, 0, -0.0005240347212904336, 0, 0.0005750370476711794, 0, -0.000614637991021733, 0.001275885379234661, -0.0002186738053273664, 0.0001359248737806769, -0.0005628950067992402, 0, -8.330462968408475e-05, 0, -0.0004761528023739025, 0.0006668078737590364, 0.0003572580400984975, 0, -0.0009001456906606895, -0.0002887659605542936, -0.0003515075237394754, 0.0004660212511978738, 0, 0, 0.002884480251599634, 0, 0, 0, 1.967507107508503e-05, 0.001771653557518016, 0, 0, 0.0005239154188415987, -0.0001882160496348641, -0.000687330590958533, 0.00166661365481144, -0.0006774512019157835, 2.551181828164668e-05, 0, 0, 0.004519848792368262, -0.0003359477889158661, 0, 0, 0.0004363189612620683, 0.001778564661499693, 0, 0, 0.001309672216024785, 0.0006387400933526047, -0.0008897036182301449, 0, -0.0005687562950168401, 0, 0, 0, -0.0006682742383678824, 0, 0, 0, -0.0007895223815884316, 0.0006628195359962189, 0, 0, 0.0003208173185581129, 0, -0.0007436005351330468, 0.0004782120703594316, -0.0002993695759214539, 3.039771926011296e-05, 0, 0, -0.0004796557737105838, 0, 0, 0, 6.468464286064302e-05, 0.001231496653325923, 0, 0, 0.001351524381337044, 0, -0.0003607182746953023, 8.342659088005351e-05, -3.792485417691867e-05, 8.817478793318804e-05, 0.0004880137981154884, 0.002484633514056119, 0, 0.001539689968499958, -0.0004282892981098389, -0.0003787189308900001, 0.0004008838190664932, 0.0003382436136607516, -0.0004369668631456094, 0.005731073223260426, -0.0007165090810477431, -6.266960112617123e-05, -0.001005195742726514, 0, -0.000181415913445249, 0.0005060823612388878, 0, 0, 0, 0.003441934923247753, -0.0009982404651869968, 0.0006026634813043485, -0.0002925558123018868, 0.002543357705137985, 0, 0, -0.0007424316702627211, 0, -0.0004905369333963455, 0.001149670303717321, 0.0005271261641667226, 0.00131379082929632, -0.0004323341899003385, 0.0009195897287224263, 0.0005409085001641943, 0.001096147558352679, -4.444355793990361e-05, 0.0009018695044673152, -8.348759645998456e-05, 0.001027546298176011, 0, 0.001191740669631401, 0.001692944189272718, 0.0009039104341932828, -0.0009256239077937749, 0, 0.001610759470532655, 0.0008078862658923336, -0.0005041237934756058, 0.0004427882565628611, 0, 0.0005004867514804085, -0.0006142319257543264, 0, 0.00138205603554294, -0.0006616966980226391, -0.0004361756037415079, 0, 0, 0, -0.0003100762260366763, 0.0005696936735416498, -0.0002918711983689358, 0.0004593402181207647, -0.000778661499824759, 0.0006116415209738039, 0.0006892953674784969, 0.0005878839074900504, -0.001060813685411268, 0.0005252972770325391, -0.001037450897828913, 0.001309701813685781, 0.003833236617364886, -0.0005249132206310229, 0.001447892532411102, 0.001158230973475296, 0, 0, 0, 0, -0.0007023432640979511, 0.004055782447849766, 0.0002341090218033136, 0.00190906921612172, 0, 0, 0, 0, -0.0006513892268303017, 0, 0.0004214039553883565, 0.00408685473834532, 0.0004032546202407829, 0, -0.0006407252348500854, -5.47490988155267e-05, 0.000542852879399722, 0, 0, 0.0004552664164403495, -0.0008495864871459278, 0, -0.0008037785404702064, 0.0007687984699275836, 0, 0, 0.002964992637824279, 0.001199003947783432, 0, 0, 0, 0, -4.492563327991082e-05, -0.0003359607325220134, -0.0002737350398622196, -0.0001896911528852687, 0, 0, 0, 0, 0, 0, 0.001367005591721463, 0.000830415177474601, -0.0005922975104928046, 0, -0.0002480988775373451, 0, 0, 0, 0, 0, 0, 0, 0.0006300483373515697, 0, 0, 0, 0, 0, -0.0004573144983907264, 0.001091286583576242, 0.0006781599344728608, 0, 5.220755221257915e-05, 0, 0.005911611998946679, 0, 0, 0, 4.770673375686409e-05, 0, 0, 0, -0.0005130205348262159, 0, -0.00041308456890122, 0.001909674138879147, 0.000383437532933237, 0.0004161818696863879, -0.0004896711466610244, 0, -0.0002900618477335762, 0, 0, 0, -0.0003307083655943042, 0.002626984287612892, 0, 0, 0.0002640217245480382, 0, 0.001570042096149993, 0.001160225995206928, 0.00121195767908835, 0.001103270466016039, 0.0004788168363280853, 0, -0.0002974760073579056, 0, 0, 0, 0.0008375239849161263, 0.001706877074256596, 0, 0, 0.0007901085765057678, 0, -0.0008387326569321425, -0.0004642837694419319, 2.181429570635729e-05, 0, 0, -0.0008061889169466293, 0, 0, -3.925903689521952e-05, 0.00136495183055822, 0.002242724811532508, 0, 0, 0.0006855129230870715, 0, 0, 0.0006705576703690303, 0, 0, 0, 0, 0, 0, 0, 0.0006912675860396959, 0.0005585556655232268, 0.0006990797894025085, 0.0004363114999228074, -5.988204721918203e-06, -0.0004875327988745257, 0, 0.000413904701489834, -0.0006541348408683491, 0.003226841606081217, -0.000986912898728623, 0, 0, 0, 0, 0, -0.0004377378582959458, 0.001569843629875625, -7.432269969368904e-05, 0, 2.655706602049429e-05, 0.0002076499189021399, 0, 0, -0.001008540852362397, 0, 0, 0, 0, 0, 0, 0, 0.0001940196895036954, 0.00336833367407989, 0.0008940397976919873, 0.0004842171419448333, -0.0003707399394992528, -0.0001033286697848498, 0, 0, -0.0005139220607384141, 0.001775236067285709, -0.0005687552437221291, 0, -0.0002194256267725268, 0.0007155913442701823, 0.005479792935000214, 0.001186950352176549, -0.001132634030268097, 0, 0, 0, -0.000705799754490351, -0.0001586375554354446, -0.0004110954725492704, 0.001529213011242933, -0.0003766097537268949, 0, 0, 0, 8.527385754213993e-05, 0.0004972480261598167, 0, -0.0004786355054041181, 0, 0, 0, 0, -0.0004734754903939497, -0.0002957624214630304, 0, -0.0004087209808542659, -0.001300094971946572, 0.003741889257338882, 0, 0, 0.002202131882873028, 0.001439775380401392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.003167897360479746, 0.001749597467107576, 0, 0, 0, 0, 0, 0, 0.0004739922980191623, 0.001468015654403102, 0, 0, -0.000622314904225307, 0, 0.0003134535719556414, -0.0003624597139854685, -0.0007929047594539491, 0, -2.367167995594775e-05, 0.0006747441463032731, -0.000114788188616411, 0, -0.0004223239573958123, 0, -0.000453759659388407, 0, -0.0001519841334618926, 0.004100217728614046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0006842704547596028, 0, 0.0002156382771227791, 0.000207984113747602, -0.0004700797825847387, 0, -2.130000782661794e-05, 0.001587087583474172, 0.0007358198907464121, 0, 0.001941534311444831, 0.0004553721207502129, 0, 0, 0.000561174267045249, 0.0008762647566410481, 0.001328211590084119, 0, -0.0007818994481840134, 0.0009873076954653806, -0.0007770184610725231, 0.0007511802721041597, -0.0002976638527397413, 0.001427583446161596, 0, 0, -0.001407053598288401, -0.000499720546954694, 0, 0, -0.0002820000580067373, 0, -0.0007121509139062339, 0.000545779281095246, 0.001638452947966536, 0, -0.0005993326630697737, 0, 0.001614248317967841, 0, 0.0002075824980779936, 0.0002121679715456194, 0.0002792272663735482, -0.000495972642936306, -0.0004638996061298007, 0, 0.0002652262481260234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0004849211793977274, -1.125866561964281e-05, -0.001124295734614309, -0.0006140674987412387, -0.0001820533274725534, -0.0006044343068696831, 0.005400193231371145, 0, -5.952932211337427e-05, 0.001460719425495643, 5.99519812220615e-05, 3.163632177783052e-05, 0.0002108827238377316, -0.0005727924288831483, 0.001059972699607035, 0, -0.0003312741266880956, 0.001352313815616286, 0, 0, -0.0007377622855610496, 0.003577101740925375, 0, 0, 0.0006293174032087056, 0.001665066137564511, 0.002578211126730629, 0.0004929500714340629, 0, 0, 0, 0, -0.0002954664654785278, 0.0005864951594561294, 0, 0.0004292170709723919, -0.0003678688386845924, 0.0007907772826995123, 0, 0.001410770032307654, 5.167076618149004e-05, 0.0001642540840871912, 0, 0.007099257722754547, -0.0001620825513834635, 0.001314893255463926, 0, 0.002565456540710643, 0.0002306712774533697, -7.50344952613057e-05, 0, 0.0004425928003907333, -0.000124808261503574, 0.0005913553847132798, 0, 0, 0.0005683253383494204, -0.0001263605406442943, 0, 0, 0.0006762044569247078, 0.000445064788991649, 0, 0, 0.002081016406742053, 0, 0, 0, 0.002276941158701923, 0, 0, 0, 0.0002745193509923116, 0, 0, 0, 0.003662801783120258, 0, 0, 0, 0.0003099890211700397, 0, 0, 0, 0.0008544658059229007, 0, 0, 0, -0.0004595678089089375, 0, 0, 0, -0.0002681262942474649, 0, 0, 0, -0.0005164660968982846, 0, -0.0002373327515847143, 0, -0.0009331602091881144, 0, -0.0006924634468301878, 0, -0.001022379356392579, -0.0005964951120262703, 0.0003827667300133501, 0.003236939617934735, 0, 0.0004543071689330743, -0.0002757331170716728, 0, 0.0001046403722499957, 3.910978939640275e-05, 0.0007461238688411341, 0.0006885325537591038, -0.0003514871762202412, 0, -0.0004274930061124242, 0, 0.001262710308043749, 0.001016177180217889, 0.0009849488025742603, 0.005433817975342444, 0.0001108466517519861, 0, -0.0004484491192819035, 0, 0.004314607478882627, 0, 0.002868688759800591, 0, 8.004071405398389e-06, 0, -0.0004528168820165058, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0006568356507558093, 0, 0.0004801916916196813, 0, 0.0001868232974729486, 0, 0.001517376569213835, 0, 0, 0, -0.0006342705971868537, 0, 0, 0, -0.0002696963169297153, 0, -0.0005490173569461329, -0.0001340495986542373, 0.0001213378867074721, 0.001385420315328806, 0, 0.003212662571342859, 0, 0.001004435995980675, -0.0006514345221694063, 0.0004743332878228256, -0.000310072754311124, 0.00118507695410458, 0, 0, 0, 0.0003972999755034745, 0, 0, -8.884719077989255e-05, 0, 0, 0, 0, 0, -0.0004494207554772914, 0, 0.0008696431996384465, 0, 0, 0, 0, 0, -0.0003075955366866102, -0.0003189384833181915, 0.0002288081633146235, -0.0008653145118880545, 0, 0.003542191774869639, 0, 0, -0.000601992412989241, 0, -0.0002451877797700906, 0, 0, 0, 0, 0, 0.002223659505501968, 0, 0.004457345773998951, 0, 0, 0, 0, 0, 0.0003898688372761953, 0, 0.0009113323558796048, 0, 0, 0, 0, 0, -0.0009298210936643685, 0, 0, 0, 0.0001918506870822903, 0.001174761782469818, 0, 0, 0.0006125696462225585, -0.0006156726296602181, 0, 0, 0, 0, 0, 0, -0.0007610297484814893, 0, 0, 0, 0.0005594831841794762, 0.001086946744903949, 0, 0, -0.0002938202678815602, 0, 0, 0, 0, 0, 0, 0, -2.63091358902451e-05, -0.0002674717551010742, -0.0005404558560990199, 0, 3.818680382773025e-05, 0.002440858092546885, 0, 0, -0.0004170517139701833, -0.0007800662685253654, 0.004934259806461191, 0, -0.0005272982156458914, 0.003515625337151924, 0, 0, 0.000150587100402028, -0.0006475498690433246, -6.016406895805747e-07, 0, 0.0006473780236736808, 0.0008173536257096155, 0, 0, 0.0006154896162386124, 0, 0.001021397324993505, 0, 0, 0, 0, 0, -0.0003564239863574717, 0, -0.0005877639344017601, -0.0003811996155322642, -0.0003900110459469533, 0, -0.0002907570941250383, 0, -0.0006006553018258077, 0, -0.000283577328365979, 0, -0.0001307989646531506, 0.000675198928393724, 1.104233521540729e-06, 0, 0, -0.0005187609670918384, 0, 0, 0.0006689918457123774, -0.0003599038145766204, -3.375269414606901e-05, 0.006829657202815936, -0.0006188722928075964, -0.0008483284527585267, 0.0007393156859175925, 0.003581893815559212, 0.0005541668542417684, 0.001461992489605764, 0.00082729471351968, 0.002276291049118271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.002663000588130968, 0, 0.003814515035982651, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.000572435684179715, 0, 0, 0, 0.0006554829023213472, 0, -0.0004940502778910688, 0, -0.0003267745820650328, 0.0005061486131920225, -0.0006151674680893025, 0.0006999933772083161, -0.0003783406184796758, 0, -0.0003730021806642698, 0, 0.0001259916804019506, 0, 0.001797643619101716, 0, 0, 0, 0, 0, -0.000454927157795191, 0, 0.0001365473147184122, 0.0008297204915911099, 0, 0, 0, 0.0004239719385283957, 0.0003529897406152163, 0, 0.0005877473418613826, 0, 0, 0, 0, 0, 4.617635398262631e-05, 0.0001268717288902811, 0.0001519364689357805, 0.0008704841129007411, 0, -0.0006643455402924513, 0, 0.003112594298011938, 0.0004387517001378052, -0.0003374664051804209, 0.0003011028935926374, -0.0005781299826153703, 0, 0.001916803730313133, 0, 0.0004996671530416345, -0.0002134592950447389, 0.0009425299330270606, 0.0018344168117877, 0.0004919047643965695, 0, 0.005476842504188078, 0, 0.0009918242109488592, -0.0001563250074356722, 0.0005490852136023757, 0.0009435446389567662, 0.0006923468696776089, 0, 0.0004466933583437723, 0, 0.0006369016091912105, -0.0005282870613335487, 0.001164750535880678, -0.0006500975831864442, 0, -0.0003211551204138777, 0.0005073961848738282, -0.0006295947814313941, 0.0002488064575398137, -0.001152510224490547, -0.0003736621141331776, 0, 0, -0.0005285520018591814, 0.00153065609810009, 0.00154354034014039, 0.0006972519686044536, 3.08337813351038e-05, 4.513487173893473e-05, 0.0001397077526529754, 0, 0.0008559301837598657, 0.001046030219598251, -0.0008190859123006262, 0.0005705770105138656, 0.00176026098265257, 0, 0.001080942098513618, 0, -0.0001587238537807499, 0.0007816692426686664, -0.0004338588575163995, 0.0006691116691897825, 0.001067148026708977, 0.0005716566605524993, 0, 0, 0.0003065614874568282, 0.001130292401740543, -0.0007031955874265024, 0.0003808231333064229, 0.000552893851487825, 0, 0, 0, 0, 0.0001245824883600074, 0, -0.0005588373145581342, 0.0001087599119672953, 0.0003544213616152003, -0.0002547337175303834, 0, -0.0001130783214176591, 0.001235597718790671, -0.0006035464145972088, -0.0004370510152119622, -0.0007705729055050389, -0.0006540913947198707, 0, 0, 0.001093292360008058, 0.001997031967964288, -0.0001522603513047267, 0.001083159594598593, -0.0005212883554332246, 0, -0.0005457506879040557, 0, 0.0002674765091751264, 0, 0, 0, -0.0007045391883735327, 0, 0, 0, -0.0002274488269852339, 0.0006762459961299487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0003494179056361881, 0.001743523501035028, 0.003794356117983103, 0, -4.506726852210933e-05, 0.001310141360035129, 0.0001767868159900574, 0, 0.0002954900302020207, 0.0007195148749204074, 0, 0, 0.002178761334721822, 0.0008786159966304981, 0, 0, 7.708171176717179e-05, 0.0004031017552062904, 0.001092522840136322, -0.0004003610819198207, -0.0003404918119365091, 0.0007308747937094636, -0.0007581476516083152, -0.0002527545377436355, 0.0003363710204594922, 0.001684596369058767, 0, 8.771696968696337e-05, 0.0008897924014884419, 0.001408073519623692, 0, 0.0002117706211589884, -0.0006489279187611513, -0.0006496790457515377, -8.19825080629857e-05, 0.0002804007764078078, 2.161815475317778e-05, 0, -0.0002268126265638601, 0.0002824219052038137, 0, -0.0007675136187038781, 0.0009025345903105603, 4.717121651475738e-05, 0, 0, 0, 0.0002292485613595359, -0.0005062216632379406, 0, -0.0002380613551378201, 0.0008127284971336846, 0.0006887688189069004, 0.0004668110823582373, -0.000231675859922827, 0.000777332392265498, 0, 0, -0.0006518092457060098, 0.001352495779847311, 0, 0, 0, 0.0009186396322635862, -0.0006217921191886096, 0.0006482066252931012, 0.0002279883658830245, 0.0005261735323241207, -0.0005481730391160244, 0.0002187817437202093, -0.0002670045935624739, 0.0004957964923713062, 0, -0.0008581990322169832, 0.0007631848214097291, -0.0003192906942932084, 0, 0.00515198080105444, 0, 0.003985630503046841, 0.0009989950452279036, -0.0004553944350423184, -1.343000898998412e-05, 0.001582895324361249, 0, 0.0004487144391311561, 0.0005630409334113288, 0.0001525096336135096, 0, 0, -0.0004984969843695291, 0.001042742218003058, 0, -0.0006629163943397248, 0, 0.0005974963428309149, 0.0002170516517067603, 0.0007876691162149943, 0, 0, 0, 0, 0, 0, -0.001227363843474566, -0.0001959653515594488, 0, 0, 0, 0, 0, 0, -0.0002738808046290202, 0.0008760049422652747, -0.0002435244701737321, 0, 0, 0, 0, 0, -0.0002081103897847562, 0.0004923749999335665, -0.0007524813141046461, 8.630338282124273e-05, 0, 0, 0, 0, -0.0001624026256651176, 0.001179731392183913, -0.0006670678980145242, 0, -0.0005047805703074567, 0.0006101444780928422, 0.00453947875577079, 0, -0.0002037045197158563, 0.0001131818975487894, -0.0008240513885296781, 0, -0.0007522565669970368, -0.0003854408539137314, 0.0006645940830078677, 0, 0.000463350318690323, 0.001203692749810378, 0.0007373113971671686, -0.0004540528115840883, 0.001547257736448999, 0.003321969206038651, 0.0003546746628225741, 0, -0.000149590475343146, 0.0005052568723440818, 0.001794912678994772, 0, 0.0003455629400171498, 0, 0, 0, -0.0007178045831724404, 0.0004981141330407629, -0.0007413049323460104, 0.0007176546558266867, 0, 0.0006719808420729147, 0, 0.0006401913796706865, -8.64854125966358e-05, 0.0005647415188083905, 0.0002431695626356949, 0.0001718953718876683, 0, 0.0006381675699296855, -0.0003759369360740713, 0.008359108087644859, 0, 0, 0, 0, 0, 0, 0, 0, -0.0004908405536888504, 0, 0.0005578160467455592, 0, 0, 0, 0, 0, 0, 0.000316895437906948, 0.0001646367805070749, 0.0003056773486273509, 0, 0, 0, 0, -0.0004625278811514009, 0.0003812279482689163, 0.0001159732456521491, 0, 0, 0, 0, 0, 0, 0, 0.0006562265859483474, 0, 0, 0, 0, 0, 0, 0, -0.0004460578265720108, 0, 0, 0.0004099122607782437, 0, 0, -0.0001492009029290907, -0.00102239269719246, 0, 0.0002044452526835818, -0.0004545848407270164, 0.0005075177602549989, 0, 0.001156840928155775, 0.0008300127274579861, -0.0008800641041021749, 0, 0.0003215921067677863, 0.001155386645134764, -0.001162004333830272, 0, 0.001529548718265837, -0.0009069117477607764, -0.001212147995933681, 0, -0.0003730627555454459, -0.0008913310084429557, 8.656304142661673e-05, -0.0003834198468969425, -0.0003552160191481757, -0.0007149363131029685, -0.000823902034391087, 0.0006513048866637434, -0.001260553662433046, 0.0003785527225481859, -0.0007151696065013957, 0.0006575345050523648, 0.0004538570028157858, -0.0003544467984384763, 0, 0, 0, -4.943593271473418e-05, 3.954479014106659e-06, 0.0006783441752209699, 0.0017957794504069, 0, 0, 0, 0.0008965856659345148, 0, 0, 0, 0.001085454369968988, 0, 0, 0, 0.001308680832429898, -0.0004740393752326749, 0, 0, 0, 0, 0, 0, 0.0007842538652205567, 0, 0, 0, 0, -0.0003990439790792018, -0.0004821798621621384, -0.0001610181462574562, 0.0001812106301363981, -0.0004842377701748443, 0, -0.000313526598776884, 0.0004019064102134589, 0.0001398245991767389, -0.0007298768234984797, 0.0002712268035926581, 0, -0.0003941612738160007, 0.007523308813294868, -0.0001727919708742731, -0.0009198036745743803, -0.0003822364643729187, 0, 0.0008166578112086133, 0, 0.0002863703775662639, 0, 0.001259227691181283, 0, -0.0004534517794160874, 0, 0.0005106077299911373, 0, 0.0009571485105116197, 0, 9.820775528159011e-05, 0, 0.0003349416146725067, 0.0003247936514508687, 0.0006054085177667196, 0.0007588970077844595, -0.0002091979780888813, 0, -0.0001336568646210719, 0, -0.0002805793407344189, 0.002838169782467469, 0.001382679845247175, 0.00259482323628804, -0.0003246220769437881, 0, 4.681568791377165e-05, 0.0005197850405744152, -0.0006203826967449353, 0, 5.013671940523663e-05, 0, -0.0003771225364869941, 0, -0.0003776715590948656, 0, 0.001254260438740283, 0, -2.365777722300138e-05, 0, -0.0003279144903418348, 0, 0.0002952192710481339, 0, 0.001950926019104994, 0, -0.0004391774904989133, 0, 0.002363808193670278, 0.0003167381924902551, -0.0001383792491355885, 0.0007493790789657993, -9.70890722003898e-05, 0, -0.0007946085354110022, 0, -0.0003345984748509313, 0, -0.0001347184630481842, 0.003882936652888907, 0.0005369145169917057, 0, -0.0005214826386612436, 0.001213626075023118, -0.0009913315473734105, 0.0009220740168859722, 0.0005636825495963616, 0.0003023144047971629, -0.0005450454563014517, 0, -0.0006339723495278656, -0.0003792482583569007, 0.002010136166101576, 0, 0.002725946089059442, 0, 0, 0, -4.82901356976868e-05, 0, 0.0004408673298967711, -0.0007823578545713906, -0.0002728427067274949, 0.0005466275895905316, 0, 0, -0.0007223512565759855, 0, 0, 0, 3.405200399439516e-05, 0, 0, 0, 0.001045376630608383, 0.0009707414832563971, 0, 0, 0.0002712607141750527, 0.001084054353192081, 0, 0, -0.0005581563941268185, 0, 0, 0, -0.0003903918401243576, 0, -0.0006196315075538793, -0.0006910808662165247, -0.0001224844696092987, 0.0004372800138754034, 0, 0, 0, 0.0002643545500720938, -0.0009016923513010417, -0.000502039427749442, -0.0002501073088144953, -2.636440591673881e-05, 0, 0, 0, 0.0002889054197344695, -0.0004448019513303728, -0.000149423189539613, -0.0006597652095123425, 0.001021912159850919, 0, 0.0002102371002153657, 0, -0.0002348707332558688, 0, -0.0001874366538054503, 0.00152545293901053, 0.0001003363571303032, 0, 0.0008885366086245015, 0, 0.007383229179610353, -0.0006537754648640992, 0.0008824374100991473, 0.000189756051287432, 0.001433249544531068, 0, 0.0004721834240045291, 0, -0.000826918112725304, -0.0007066478084070252, -0.0003706131212316381, -0.0001005326458544585, 0.0003884941284693943, 0, 0, 0, -0.0006042728820981026, -0.000331348575189331, 0.0003059213717272676, -0.000890828175888655, 0.001015675831128037, 0, 0.0008480768642623447, 0, 0.0002671648727907882, 0.0006122201642172175, 0.0002548830621356045, -0.0005276261756635031, 0.0006063373753815434, 0, 0.0006489374277132869, 0, -0.000421531151114674, -0.0003028029447608651, 0, 0.0005671044360817967, 0.006326465553354869, -0.0002549711739616011, -0.0003573557494494941, 0.0006819780034247841, 0.001454577563701034, 0.0006978168232710413, 0, 0, 0, 0.000634914215912555, 0, 0.0005663694569396666, 0, -0.0003538570653655576, 0, -7.076106198656742e-06, 0, -0.0003793820376887636, 0, -0.0005412562390712661, 0.0003947730348052385, 0, 0, 0, 0, -0.0005155821699022753, 0, 0, 0, 0.0009927257619761528, 0, -0.000777280663870836, 0.0001042517826894126, 0.0006899901350452442, 0, 0.0005379696905653081, 0.0003411723466078882, 0, 0, 0, 0, -0.0004190607392562176, 0, 0, 0, 0, 0, 0, 0, 0.0006604985196359605, 0, 0.0002044225907176652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0004790298681194371, -6.084865826307465e-05, 0, 0, 0, -0.0002985383587053768, -0.0006219172558178527, -0.0009571965072128961, 0.0002658954599601075, 0.0008785582417795095, 0, 0.0003320327359693916, 0, 0.0007188922001779683, 0, 0, -0.0005577359513191936, -4.22211306120087e-05, 0, 0, 0, 0.005744979510954894, -0.0008207710558717742, -0.001142843563589792, -0.0009091361688109104, 0.0002567476460294396, 0, 0.0005901896568524734, 0, 0.0003801276698525161, 0, 0, -0.000274992120253715, 0.001769636848654943, 0, 0, 0, -0.0005668374388053646, -0.0004005890778079432, -0.0003714104902645104, 0.0001813038235686789, 0.001905230460963107, 0, 0, 0, 0.0007816327419452349, 0, 0, -0.0007403123384074313, 0.0002046207893103826, 0, 0, 0.0003918122371103782, -0.0006037756081727216, 0.0004227607285998697, 0.0004135684627064461, -7.490850316681599e-05, 0.0001919459138017029, 0, -0.0003462981641958502, 0, 0.0005809499545792391, -0.0003182639234446333, 0, 0, -0.0006439838281657654, -9.494123887528625e-05, 0, -0.0006842956041700521, 0.002735136248791789, 0, 0, 0, 0, 0, 0, 0, 0, -8.76585946216395e-07, 0.005565822262220705, 0, 0, 0.0003858611934078806, 0, 3.896566534528896e-05, 0.0005065105476583948, 0.0006932240681061522, 0.0002140379785965487, 0, 0, -0.000207483518248694, 0.0001057089319769625, 0, 0.0003408525917057664, -0.0003260785896606366, 0, 0, 0, -0.0001316860150293959, 0, 0.002705962304439181, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0002488975340399148, 0.002903603485576867, 0, -0.0009693606834261898, 0.0006487094220706277, 0.0002286173899828995, 0.0005494269090367431, 0.0003855587781572249, 0.0003870529225646728, 0, 0, 0, 0, 0, 0, 0, -5.914629769825754e-05, -0.0005467523423352674, 0, 0, -0.0008513663318191743, -0.000614287409260388, 0.001767711873079536, 0.001235741821954771, -0.0009429718581874365, -0.00045386011948859, 0, 0, 0, 0, 0, 0, -0.001024242660951422, -0.0001759683617931722, 0, 0, -0.0006710675856555387, -0.0008938056615604784, 0, 0, 0.0006883566792430163, -0.0008360598211957873, 0, 0, 0, 0, 0, 0, -0.0002392374126647858, 0.0004806332682152521, -0.001155015825976419, 0.0003882085323759743, -0.0005728430790727283, 0.0005458730236805303, 0.004512295579590315, 0.0006112723535823212, -2.94945851289714e-05, 0.001163856715909844, -0.0004323706494783549, 0, -0.0008736287787364131, 0.00242202187119025, 0, 0, -0.0001007143929565747, 4.688255259934234e-05, 0, -0.0002754882566175649, 0.0007879244202505447, 0.0001822096387112598, 0, 0, 0.0005739455927955991, 0.0009693967008349033, 0, 4.086877401605567e-05, 0.0001044315758125341, 0.002907775779334374, 0, 0, 0, 0, 0, 0, 0.001771328915377654, 0, -0.0001007219900669079, 0, 0.0006319104299630602, 0, -0.0005173571047440836, 0.0002446014639993832, -0.0001139898416681879, 0.0007350425942402013, -8.043788126631233e-05, 0.002171037291017734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0002186169021259087, 0.0003009141470916593, -0.0001431914528465128, 0.0005679099332130239, 0.0003078136225201359, 0.004961537213062171, 0.00483771823107261, 0, 0, 0, 0, 0.003914938106033923, 0, 0.001728321204643142, 0, 0, 0, 0, 0, -4.300248158907024e-05, 0.0001307406857818204, -9.059367360635358e-05, 0.003065354677328261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0003401921548586373, 0, -0.0003449198029973474, 0, -0.0002178882251001709, 0.0008243863670617161, -0.0007575799171595997, -0.0006337646686780659, -0.0005748483118481625, 0, 0, 0, -0.0004277301005829455, -0.0002743954119729782, -0.0009160066759920216, 0, 0, 0, 0, 0, 0.0006304646283294304, 0.000638115377111812, -0.0006605611919280644, 0.00095933548407797, 0, 0, 0, 0, -0.0008903084074489298, 0, -0.0005372884568307658, 0, 0, 0, 0, 0, 2.150196152513088e-05, 0.0007776101381981827, -0.0001711685514697422, -0.0002229922709993225, -0.0009520258388259406, 0, -7.056861560987551e-05, 0, -0.0002752557886519012, 0.004408171398760844, -0.0001405285219829221, 0, 0.004682814486391671, 0, 0, 0, 0.0001204471272110709, 0.000698671873143744, -0.0006103476220301672, -0.000214438262646315, 4.74931585642979e-05, 0, 0.001002780171725195, 6.968070654529998e-05, -0.0004074984376355384, 0, -0.0004313439368570032, 0, 0.000424210449110337, 0, 0, 0]
cat_features_hashes = {}
def hash_uint64(string):
return cat_features_hashes.get(str(string), 2147483647)
def apply_catboost_model(float_features, cat_features=[], ntree_start=0, ntree_end=catboost_model.tree_count):
"""
Applies the model built by CatBoost.
Parameters
----------
float_features : list of float features
cat_features : list of categorical features
You need to pass float and categorical features separately in the same order they appeared in train dataset.
For example if you had features f1,f2,f3,f4, where f2 and f4 were considered categorical, you need to pass here float_features=f1,f3, cat_features=f2,f4
Returns
-------
prediction : formula value for the model and the features
"""
if ntree_end == 0:
ntree_end = catboost_model.tree_count
else:
ntree_end = min(ntree_end, catboost_model.tree_count)
model = catboost_model
assert len(float_features) >= model.float_feature_count
assert len(cat_features) >= model.cat_feature_count
binary_features = [0] * model.binary_feature_count
binary_feature_index = 0
for i in range(len(model.float_feature_borders)):
for border in model.float_feature_borders[i]:
binary_features[binary_feature_index] += 1 if float_features[model.float_features_index[i]] > border else 0
binary_feature_index += 1
transposed_hash = [0] * model.cat_feature_count
for i in range(model.cat_feature_count):
transposed_hash[i] = hash_uint64(cat_features[i])
if len(model.one_hot_cat_feature_index) > 0:
cat_feature_packed_indexes = {}
for i in range(model.cat_feature_count):
cat_feature_packed_indexes[model.cat_features_index[i]] = i
for i in range(len(model.one_hot_cat_feature_index)):
cat_idx = cat_feature_packed_indexes[model.one_hot_cat_feature_index[i]]
hash = transposed_hash[cat_idx]
for border_idx in range(len(model.one_hot_hash_values[i])):
binary_features[binary_feature_index] |= (1 if hash == model.one_hot_hash_values[i][border_idx] else 0) * (border_idx + 1)
binary_feature_index += 1
if hasattr(model, 'model_ctrs') and model.model_ctrs.used_model_ctrs_count > 0:
ctrs = [0.0] * model.model_ctrs.used_model_ctrs_count
calc_ctrs(model.model_ctrs, binary_features, transposed_hash, ctrs)
for i in range(len(model.ctr_feature_borders)):
for border in model.ctr_feature_borders[i]:
binary_features[binary_feature_index] += 1 if ctrs[i] > border else 0
binary_feature_index += 1
result = 0.0
tree_splits_index = 0
current_tree_leaf_values_index = 0
for tree_id in range(ntree_start, ntree_end):
current_tree_depth = model.tree_depth[tree_id]
index = 0
for depth in range(current_tree_depth):
border_val = model.tree_split_border[tree_splits_index + depth]
feature_index = model.tree_split_feature_index[tree_splits_index + depth]
xor_mask = model.tree_split_xor_mask[tree_splits_index + depth]
index |= (binary_features[feature_index] ^ xor_mask >= border_val) << depth
result += model.leaf_values[current_tree_leaf_values_index + index]
tree_splits_index += current_tree_depth
current_tree_leaf_values_index += 1 << current_tree_depth
return result |
"""
Binary Search Algorithm (Iterative Solution)
"""
def binary_search(a, t):
s, e = 0, len(a) - 1
while s <= e:
i = (s + e) // 2
x = a[i]
if t is x:
return i
elif t < x:
e = i - 1
else:
s = i + 1
return -1
| """
Binary Search Algorithm (Iterative Solution)
"""
def binary_search(a, t):
(s, e) = (0, len(a) - 1)
while s <= e:
i = (s + e) // 2
x = a[i]
if t is x:
return i
elif t < x:
e = i - 1
else:
s = i + 1
return -1 |
def adding_numbers(num1, num2, num3):
print('Have to add three numbers')
print('First Number = {}'.format(num1))
print('Second Number = {}'.format(num2))
print('Third Number = {}'.format(num3))
return num1 + num2 + num3
x = adding_numbers(10, 20, 30)
print('The function returned a value of {}'.format(x))
| def adding_numbers(num1, num2, num3):
print('Have to add three numbers')
print('First Number = {}'.format(num1))
print('Second Number = {}'.format(num2))
print('Third Number = {}'.format(num3))
return num1 + num2 + num3
x = adding_numbers(10, 20, 30)
print('The function returned a value of {}'.format(x)) |
'''
>>> increments([1, 5, 7])
[2, 6, 8]
>>> increments([0, 0, 0, 0, 0])
[1, 1, 1, 1, 1]
>>> increments([0.5, 1.5, 1.75, 2.5])
[1.5, 2.5, 2.75, 3.5]
>>> increments([570, 968, 723, 179, 762, 377, 845, 320, 475, 952, 680, 874, 708, 493, 901, 896, 164, 165, 404, 147, 917, 936, 205, 615, 518, 254, 856, 584, 287, 336, 452, 551, 914, 706, 558, 842, 52, 593, 733, 398, 119, 874, 769, 585, 572, 261, 440, 404, 293, 176, 575, 224, 647, 241, 319, 974, 5, 373, 367, 609, 661, 691, 47, 64, 79, 744, 606, 205, 424, 88, 648, 419, 165, 399, 594, 760, 348, 638, 385, 754, 491, 284, 531, 258, 745, 634, 51, 557, 346, 577, 375, 979, 773, 523, 441, 952, 50, 534, 641, 621, 813, 511, 279, 565, 228, 86, 187, 395, 261, 287, 717, 989, 614, 92, 8, 229, 372, 378, 53, 350, 936, 654, 74, 750, 20, 978, 506, 793, 148, 944, 23, 962, 996, 586, 404, 216, 148, 284, 797, 805, 501, 161, 64, 608, 287, 127, 136, 902, 879, 433, 553, 366, 155, 763, 728, 117, 300, 990, 345, 982, 767, 279, 814, 516, 342, 291, 410, 612, 961, 445, 472, 507, 251, 832, 737, 62, 384, 273, 352, 752, 455, 216, 731, 7, 868, 111, 42, 190, 841, 283, 215, 860, 628, 835, 145, 97, 337, 57, 791, 443, 271, 925, 666, 452, 601, 571, 218, 901, 479, 75, 912, 708, 33, 575, 252, 753, 857, 150, 625, 852, 921, 178, 832, 126, 929, 16, 427, 533, 119, 256, 937, 107, 740, 607, 801, 827, 667, 776, 95, 940, 66, 982, 930, 825, 878, 512, 961, 701, 657, 584, 204, 348, 564, 505, 303, 562, 399, 415, 784, 588, 2, 729, 478, 396, 314, 130, 493, 947, 724, 540, 608, 431, 107, 497, 68, 791, 521, 583, 359, 221, 713, 683, 945, 274, 568, 666, 517, 241, 401, 437, 958, 572, 561, 929, 342, 149, 971, 762, 249, 538, 277, 761, 489, 728, 372, 131, 366, 702, 73, 382, 58, 223, 423, 642, 628, 6, 158, 946, 710, 232, 211, 747, 215, 579, 396, 521, 597, 966, 401, 749, 546, 310, 786, 691, 333, 817, 162, 961, 674, 132, 235, 481, 410, 477, 311, 932, 352, 64, 771, 837, 609, 654, 535, 530, 346, 294, 441, 532, 824, 422, 912, 99, 894, 246, 99, 111, 806, 360, 652, 753, 489, 735, 996, 8, 742, 793, 341, 498, 790, 402, 542, 892, 573, 78, 994, 676, 225, 675, 904, 196, 156, 819, 959, 501, 554, 381, 525, 608, 401, 937, 875, 373, 803, 258, 530, 901, 175, 656, 533, 91, 304, 497, 321, 906, 893, 995, 238, 51, 419, 70, 673, 479, 852, 864, 143, 224, 911, 207, 41, 603, 824, 764, 257, 653, 521, 28, 673, 333, 536, 748, 92, 98, 951, 655, 278, 437, 167, 253, 849, 343, 554, 313, 333, 556, 919, 636, 21, 841, 854, 550, 993, 291, 324, 224, 48, 927, 784, 387, 276, 652, 860, 100, 386, 153, 988, 805, 419, 75, 365, 920, 957, 23, 592, 280, 814, 800, 154, 776, 169, 635, 379, 919, 742, 145, 784, 201, 711, 209, 36, 317, 718, 84, 974, 768, 518, 884, 374, 447, 160, 295, 29, 23, 421, 384, 104, 123, 40, 945, 765, 32, 243, 696, 603, 129, 650, 957, 659, 863, 582, 165, 681, 33, 738, 917, 410, 803, 821, 636, 162, 662, 231, 75, 799, 591, 258, 722, 131, 805, 600, 704, 995, 793, 502, 624, 656, 43, 597, 353, 867, 116, 568, 26, 16, 251, 78, 764, 799, 287, 575, 190, 718, 619, 377, 465, 267, 688, 772, 359, 451, 459, 139, 71, 821, 312, 334, 988, 929, 797, 830, 26, 3, 90, 450, 715, 174, 910, 258, 229, 325, 517, 37, 260, 950, 20, 881, 156, 231, 114, 670, 287, 631, 982, 855, 841, 72, 561, 368, 289, 829, 428, 815, 207, 844, 68, 143, 707, 259, 669, 362, 943, 550, 133, 367, 900, 233, 109, 504, 803, 985, 333, 318, 680, 952, 408, 268, 890, 101, 423, 261, 641, 500, 389, 885, 76, 682, 811, 941, 142, 552, 401, 429, 973, 287, 472, 630, 383, 569, 630, 135, 823, 49, 507, 433, 550, 660, 403, 88, 879, 697, 571, 790, 896, 252, 172, 911, 485, 30, 657, 821, 412, 204, 801, 763, 329, 199, 315, 940, 515, 29, 22, 66, 221, 63, 678, 368, 545, 560, 301, 292, 987, 673, 573, 399, 148, 326, 418, 687, 85, 167, 774, 657, 754, 168, 113, 412, 353, 234, 923, 720, 691, 319, 711, 1000, 188, 969, 123, 547, 127, 69, 782, 533, 898, 574, 214, 848, 599, 112, 833, 26, 750, 462, 480, 511, 644, 929, 725, 310, 41, 559, 961, 399, 527, 960, 352, 468, 755, 732, 944, 115, 408, 642, 888, 922, 780, 727, 459, 473, 122, 716, 908, 576, 498, 196, 647, 912, 275, 238, 79, 75, 427, 299, 470, 347, 792, 969, 21, 424, 596, 88, 98, 475, 917, 683, 47, 843, 742, 673, 702, 983, 996, 430, 53, 327, 769, 666, 453, 93, 498, 942, 299, 200, 968, 202, 193, 508, 706, 247, 51, 721, 327, 484, 855, 565, 777, 33, 816, 827, 36, 962, 235, 297, 666, 111, 453, 445, 111, 653, 690, 325, 36, 187, 633, 854, 829, 74, 840, 744, 375, 124, 694, 236, 222, 88, 449, 134, 542, 812, 325, 373, 975, 131, 78, 390, 114, 969, 633, 57, 110, 635, 396, 947, 913, 148, 215, 465, 72, 463, 830, 885, 532, 728, 701, 31, 541, 54, 411, 916, 268, 596, 72, 971, 907, 856, 65, 55, 108, 222, 24, 482, 150, 864, 768, 332, 40, 961, 80, 745, 984, 170, 424, 28, 442, 146, 724, 32, 786, 985, 386, 326, 840, 416, 931, 606, 746, 39, 295, 355, 80, 663, 463, 716, 849, 606, 83, 512, 144, 854, 384, 976, 675, 549, 318, 893, 193, 562, 419, 444, 427, 612, 362, 567, 529, 273, 807, 381, 120, 66, 397, 738, 948, 99, 427, 560, 916, 283, 722, 111, 740, 156, 942, 215, 67, 944, 161, 544, 597, 468, 441, 483, 961, 503, 162, 706, 57, 37, 307, 142, 537, 861, 944])
[571, 969, 724, 180, 763, 378, 846, 321, 476, 953, 681, 875, 709, 494, 902, 897, 165, 166, 405, 148, 918, 937, 206, 616, 519, 255, 857, 585, 288, 337, 453, 552, 915, 707, 559, 843, 53, 594, 734, 399, 120, 875, 770, 586, 573, 262, 441, 405, 294, 177, 576, 225, 648, 242, 320, 975, 6, 374, 368, 610, 662, 692, 48, 65, 80, 745, 607, 206, 425, 89, 649, 420, 166, 400, 595, 761, 349, 639, 386, 755, 492, 285, 532, 259, 746, 635, 52, 558, 347, 578, 376, 980, 774, 524, 442, 953, 51, 535, 642, 622, 814, 512, 280, 566, 229, 87, 188, 396, 262, 288, 718, 990, 615, 93, 9, 230, 373, 379, 54, 351, 937, 655, 75, 751, 21, 979, 507, 794, 149, 945, 24, 963, 997, 587, 405, 217, 149, 285, 798, 806, 502, 162, 65, 609, 288, 128, 137, 903, 880, 434, 554, 367, 156, 764, 729, 118, 301, 991, 346, 983, 768, 280, 815, 517, 343, 292, 411, 613, 962, 446, 473, 508, 252, 833, 738, 63, 385, 274, 353, 753, 456, 217, 732, 8, 869, 112, 43, 191, 842, 284, 216, 861, 629, 836, 146, 98, 338, 58, 792, 444, 272, 926, 667, 453, 602, 572, 219, 902, 480, 76, 913, 709, 34, 576, 253, 754, 858, 151, 626, 853, 922, 179, 833, 127, 930, 17, 428, 534, 120, 257, 938, 108, 741, 608, 802, 828, 668, 777, 96, 941, 67, 983, 931, 826, 879, 513, 962, 702, 658, 585, 205, 349, 565, 506, 304, 563, 400, 416, 785, 589, 3, 730, 479, 397, 315, 131, 494, 948, 725, 541, 609, 432, 108, 498, 69, 792, 522, 584, 360, 222, 714, 684, 946, 275, 569, 667, 518, 242, 402, 438, 959, 573, 562, 930, 343, 150, 972, 763, 250, 539, 278, 762, 490, 729, 373, 132, 367, 703, 74, 383, 59, 224, 424, 643, 629, 7, 159, 947, 711, 233, 212, 748, 216, 580, 397, 522, 598, 967, 402, 750, 547, 311, 787, 692, 334, 818, 163, 962, 675, 133, 236, 482, 411, 478, 312, 933, 353, 65, 772, 838, 610, 655, 536, 531, 347, 295, 442, 533, 825, 423, 913, 100, 895, 247, 100, 112, 807, 361, 653, 754, 490, 736, 997, 9, 743, 794, 342, 499, 791, 403, 543, 893, 574, 79, 995, 677, 226, 676, 905, 197, 157, 820, 960, 502, 555, 382, 526, 609, 402, 938, 876, 374, 804, 259, 531, 902, 176, 657, 534, 92, 305, 498, 322, 907, 894, 996, 239, 52, 420, 71, 674, 480, 853, 865, 144, 225, 912, 208, 42, 604, 825, 765, 258, 654, 522, 29, 674, 334, 537, 749, 93, 99, 952, 656, 279, 438, 168, 254, 850, 344, 555, 314, 334, 557, 920, 637, 22, 842, 855, 551, 994, 292, 325, 225, 49, 928, 785, 388, 277, 653, 861, 101, 387, 154, 989, 806, 420, 76, 366, 921, 958, 24, 593, 281, 815, 801, 155, 777, 170, 636, 380, 920, 743, 146, 785, 202, 712, 210, 37, 318, 719, 85, 975, 769, 519, 885, 375, 448, 161, 296, 30, 24, 422, 385, 105, 124, 41, 946, 766, 33, 244, 697, 604, 130, 651, 958, 660, 864, 583, 166, 682, 34, 739, 918, 411, 804, 822, 637, 163, 663, 232, 76, 800, 592, 259, 723, 132, 806, 601, 705, 996, 794, 503, 625, 657, 44, 598, 354, 868, 117, 569, 27, 17, 252, 79, 765, 800, 288, 576, 191, 719, 620, 378, 466, 268, 689, 773, 360, 452, 460, 140, 72, 822, 313, 335, 989, 930, 798, 831, 27, 4, 91, 451, 716, 175, 911, 259, 230, 326, 518, 38, 261, 951, 21, 882, 157, 232, 115, 671, 288, 632, 983, 856, 842, 73, 562, 369, 290, 830, 429, 816, 208, 845, 69, 144, 708, 260, 670, 363, 944, 551, 134, 368, 901, 234, 110, 505, 804, 986, 334, 319, 681, 953, 409, 269, 891, 102, 424, 262, 642, 501, 390, 886, 77, 683, 812, 942, 143, 553, 402, 430, 974, 288, 473, 631, 384, 570, 631, 136, 824, 50, 508, 434, 551, 661, 404, 89, 880, 698, 572, 791, 897, 253, 173, 912, 486, 31, 658, 822, 413, 205, 802, 764, 330, 200, 316, 941, 516, 30, 23, 67, 222, 64, 679, 369, 546, 561, 302, 293, 988, 674, 574, 400, 149, 327, 419, 688, 86, 168, 775, 658, 755, 169, 114, 413, 354, 235, 924, 721, 692, 320, 712, 1001, 189, 970, 124, 548, 128, 70, 783, 534, 899, 575, 215, 849, 600, 113, 834, 27, 751, 463, 481, 512, 645, 930, 726, 311, 42, 560, 962, 400, 528, 961, 353, 469, 756, 733, 945, 116, 409, 643, 889, 923, 781, 728, 460, 474, 123, 717, 909, 577, 499, 197, 648, 913, 276, 239, 80, 76, 428, 300, 471, 348, 793, 970, 22, 425, 597, 89, 99, 476, 918, 684, 48, 844, 743, 674, 703, 984, 997, 431, 54, 328, 770, 667, 454, 94, 499, 943, 300, 201, 969, 203, 194, 509, 707, 248, 52, 722, 328, 485, 856, 566, 778, 34, 817, 828, 37, 963, 236, 298, 667, 112, 454, 446, 112, 654, 691, 326, 37, 188, 634, 855, 830, 75, 841, 745, 376, 125, 695, 237, 223, 89, 450, 135, 543, 813, 326, 374, 976, 132, 79, 391, 115, 970, 634, 58, 111, 636, 397, 948, 914, 149, 216, 466, 73, 464, 831, 886, 533, 729, 702, 32, 542, 55, 412, 917, 269, 597, 73, 972, 908, 857, 66, 56, 109, 223, 25, 483, 151, 865, 769, 333, 41, 962, 81, 746, 985, 171, 425, 29, 443, 147, 725, 33, 787, 986, 387, 327, 841, 417, 932, 607, 747, 40, 296, 356, 81, 664, 464, 717, 850, 607, 84, 513, 145, 855, 385, 977, 676, 550, 319, 894, 194, 563, 420, 445, 428, 613, 363, 568, 530, 274, 808, 382, 121, 67, 398, 739, 949, 100, 428, 561, 917, 284, 723, 112, 741, 157, 943, 216, 68, 945, 162, 545, 598, 469, 442, 484, 962, 504, 163, 707, 58, 38, 308, 143, 538, 862, 945]
'''
| """
>>> increments([1, 5, 7])
[2, 6, 8]
>>> increments([0, 0, 0, 0, 0])
[1, 1, 1, 1, 1]
>>> increments([0.5, 1.5, 1.75, 2.5])
[1.5, 2.5, 2.75, 3.5]
>>> increments([570, 968, 723, 179, 762, 377, 845, 320, 475, 952, 680, 874, 708, 493, 901, 896, 164, 165, 404, 147, 917, 936, 205, 615, 518, 254, 856, 584, 287, 336, 452, 551, 914, 706, 558, 842, 52, 593, 733, 398, 119, 874, 769, 585, 572, 261, 440, 404, 293, 176, 575, 224, 647, 241, 319, 974, 5, 373, 367, 609, 661, 691, 47, 64, 79, 744, 606, 205, 424, 88, 648, 419, 165, 399, 594, 760, 348, 638, 385, 754, 491, 284, 531, 258, 745, 634, 51, 557, 346, 577, 375, 979, 773, 523, 441, 952, 50, 534, 641, 621, 813, 511, 279, 565, 228, 86, 187, 395, 261, 287, 717, 989, 614, 92, 8, 229, 372, 378, 53, 350, 936, 654, 74, 750, 20, 978, 506, 793, 148, 944, 23, 962, 996, 586, 404, 216, 148, 284, 797, 805, 501, 161, 64, 608, 287, 127, 136, 902, 879, 433, 553, 366, 155, 763, 728, 117, 300, 990, 345, 982, 767, 279, 814, 516, 342, 291, 410, 612, 961, 445, 472, 507, 251, 832, 737, 62, 384, 273, 352, 752, 455, 216, 731, 7, 868, 111, 42, 190, 841, 283, 215, 860, 628, 835, 145, 97, 337, 57, 791, 443, 271, 925, 666, 452, 601, 571, 218, 901, 479, 75, 912, 708, 33, 575, 252, 753, 857, 150, 625, 852, 921, 178, 832, 126, 929, 16, 427, 533, 119, 256, 937, 107, 740, 607, 801, 827, 667, 776, 95, 940, 66, 982, 930, 825, 878, 512, 961, 701, 657, 584, 204, 348, 564, 505, 303, 562, 399, 415, 784, 588, 2, 729, 478, 396, 314, 130, 493, 947, 724, 540, 608, 431, 107, 497, 68, 791, 521, 583, 359, 221, 713, 683, 945, 274, 568, 666, 517, 241, 401, 437, 958, 572, 561, 929, 342, 149, 971, 762, 249, 538, 277, 761, 489, 728, 372, 131, 366, 702, 73, 382, 58, 223, 423, 642, 628, 6, 158, 946, 710, 232, 211, 747, 215, 579, 396, 521, 597, 966, 401, 749, 546, 310, 786, 691, 333, 817, 162, 961, 674, 132, 235, 481, 410, 477, 311, 932, 352, 64, 771, 837, 609, 654, 535, 530, 346, 294, 441, 532, 824, 422, 912, 99, 894, 246, 99, 111, 806, 360, 652, 753, 489, 735, 996, 8, 742, 793, 341, 498, 790, 402, 542, 892, 573, 78, 994, 676, 225, 675, 904, 196, 156, 819, 959, 501, 554, 381, 525, 608, 401, 937, 875, 373, 803, 258, 530, 901, 175, 656, 533, 91, 304, 497, 321, 906, 893, 995, 238, 51, 419, 70, 673, 479, 852, 864, 143, 224, 911, 207, 41, 603, 824, 764, 257, 653, 521, 28, 673, 333, 536, 748, 92, 98, 951, 655, 278, 437, 167, 253, 849, 343, 554, 313, 333, 556, 919, 636, 21, 841, 854, 550, 993, 291, 324, 224, 48, 927, 784, 387, 276, 652, 860, 100, 386, 153, 988, 805, 419, 75, 365, 920, 957, 23, 592, 280, 814, 800, 154, 776, 169, 635, 379, 919, 742, 145, 784, 201, 711, 209, 36, 317, 718, 84, 974, 768, 518, 884, 374, 447, 160, 295, 29, 23, 421, 384, 104, 123, 40, 945, 765, 32, 243, 696, 603, 129, 650, 957, 659, 863, 582, 165, 681, 33, 738, 917, 410, 803, 821, 636, 162, 662, 231, 75, 799, 591, 258, 722, 131, 805, 600, 704, 995, 793, 502, 624, 656, 43, 597, 353, 867, 116, 568, 26, 16, 251, 78, 764, 799, 287, 575, 190, 718, 619, 377, 465, 267, 688, 772, 359, 451, 459, 139, 71, 821, 312, 334, 988, 929, 797, 830, 26, 3, 90, 450, 715, 174, 910, 258, 229, 325, 517, 37, 260, 950, 20, 881, 156, 231, 114, 670, 287, 631, 982, 855, 841, 72, 561, 368, 289, 829, 428, 815, 207, 844, 68, 143, 707, 259, 669, 362, 943, 550, 133, 367, 900, 233, 109, 504, 803, 985, 333, 318, 680, 952, 408, 268, 890, 101, 423, 261, 641, 500, 389, 885, 76, 682, 811, 941, 142, 552, 401, 429, 973, 287, 472, 630, 383, 569, 630, 135, 823, 49, 507, 433, 550, 660, 403, 88, 879, 697, 571, 790, 896, 252, 172, 911, 485, 30, 657, 821, 412, 204, 801, 763, 329, 199, 315, 940, 515, 29, 22, 66, 221, 63, 678, 368, 545, 560, 301, 292, 987, 673, 573, 399, 148, 326, 418, 687, 85, 167, 774, 657, 754, 168, 113, 412, 353, 234, 923, 720, 691, 319, 711, 1000, 188, 969, 123, 547, 127, 69, 782, 533, 898, 574, 214, 848, 599, 112, 833, 26, 750, 462, 480, 511, 644, 929, 725, 310, 41, 559, 961, 399, 527, 960, 352, 468, 755, 732, 944, 115, 408, 642, 888, 922, 780, 727, 459, 473, 122, 716, 908, 576, 498, 196, 647, 912, 275, 238, 79, 75, 427, 299, 470, 347, 792, 969, 21, 424, 596, 88, 98, 475, 917, 683, 47, 843, 742, 673, 702, 983, 996, 430, 53, 327, 769, 666, 453, 93, 498, 942, 299, 200, 968, 202, 193, 508, 706, 247, 51, 721, 327, 484, 855, 565, 777, 33, 816, 827, 36, 962, 235, 297, 666, 111, 453, 445, 111, 653, 690, 325, 36, 187, 633, 854, 829, 74, 840, 744, 375, 124, 694, 236, 222, 88, 449, 134, 542, 812, 325, 373, 975, 131, 78, 390, 114, 969, 633, 57, 110, 635, 396, 947, 913, 148, 215, 465, 72, 463, 830, 885, 532, 728, 701, 31, 541, 54, 411, 916, 268, 596, 72, 971, 907, 856, 65, 55, 108, 222, 24, 482, 150, 864, 768, 332, 40, 961, 80, 745, 984, 170, 424, 28, 442, 146, 724, 32, 786, 985, 386, 326, 840, 416, 931, 606, 746, 39, 295, 355, 80, 663, 463, 716, 849, 606, 83, 512, 144, 854, 384, 976, 675, 549, 318, 893, 193, 562, 419, 444, 427, 612, 362, 567, 529, 273, 807, 381, 120, 66, 397, 738, 948, 99, 427, 560, 916, 283, 722, 111, 740, 156, 942, 215, 67, 944, 161, 544, 597, 468, 441, 483, 961, 503, 162, 706, 57, 37, 307, 142, 537, 861, 944])
[571, 969, 724, 180, 763, 378, 846, 321, 476, 953, 681, 875, 709, 494, 902, 897, 165, 166, 405, 148, 918, 937, 206, 616, 519, 255, 857, 585, 288, 337, 453, 552, 915, 707, 559, 843, 53, 594, 734, 399, 120, 875, 770, 586, 573, 262, 441, 405, 294, 177, 576, 225, 648, 242, 320, 975, 6, 374, 368, 610, 662, 692, 48, 65, 80, 745, 607, 206, 425, 89, 649, 420, 166, 400, 595, 761, 349, 639, 386, 755, 492, 285, 532, 259, 746, 635, 52, 558, 347, 578, 376, 980, 774, 524, 442, 953, 51, 535, 642, 622, 814, 512, 280, 566, 229, 87, 188, 396, 262, 288, 718, 990, 615, 93, 9, 230, 373, 379, 54, 351, 937, 655, 75, 751, 21, 979, 507, 794, 149, 945, 24, 963, 997, 587, 405, 217, 149, 285, 798, 806, 502, 162, 65, 609, 288, 128, 137, 903, 880, 434, 554, 367, 156, 764, 729, 118, 301, 991, 346, 983, 768, 280, 815, 517, 343, 292, 411, 613, 962, 446, 473, 508, 252, 833, 738, 63, 385, 274, 353, 753, 456, 217, 732, 8, 869, 112, 43, 191, 842, 284, 216, 861, 629, 836, 146, 98, 338, 58, 792, 444, 272, 926, 667, 453, 602, 572, 219, 902, 480, 76, 913, 709, 34, 576, 253, 754, 858, 151, 626, 853, 922, 179, 833, 127, 930, 17, 428, 534, 120, 257, 938, 108, 741, 608, 802, 828, 668, 777, 96, 941, 67, 983, 931, 826, 879, 513, 962, 702, 658, 585, 205, 349, 565, 506, 304, 563, 400, 416, 785, 589, 3, 730, 479, 397, 315, 131, 494, 948, 725, 541, 609, 432, 108, 498, 69, 792, 522, 584, 360, 222, 714, 684, 946, 275, 569, 667, 518, 242, 402, 438, 959, 573, 562, 930, 343, 150, 972, 763, 250, 539, 278, 762, 490, 729, 373, 132, 367, 703, 74, 383, 59, 224, 424, 643, 629, 7, 159, 947, 711, 233, 212, 748, 216, 580, 397, 522, 598, 967, 402, 750, 547, 311, 787, 692, 334, 818, 163, 962, 675, 133, 236, 482, 411, 478, 312, 933, 353, 65, 772, 838, 610, 655, 536, 531, 347, 295, 442, 533, 825, 423, 913, 100, 895, 247, 100, 112, 807, 361, 653, 754, 490, 736, 997, 9, 743, 794, 342, 499, 791, 403, 543, 893, 574, 79, 995, 677, 226, 676, 905, 197, 157, 820, 960, 502, 555, 382, 526, 609, 402, 938, 876, 374, 804, 259, 531, 902, 176, 657, 534, 92, 305, 498, 322, 907, 894, 996, 239, 52, 420, 71, 674, 480, 853, 865, 144, 225, 912, 208, 42, 604, 825, 765, 258, 654, 522, 29, 674, 334, 537, 749, 93, 99, 952, 656, 279, 438, 168, 254, 850, 344, 555, 314, 334, 557, 920, 637, 22, 842, 855, 551, 994, 292, 325, 225, 49, 928, 785, 388, 277, 653, 861, 101, 387, 154, 989, 806, 420, 76, 366, 921, 958, 24, 593, 281, 815, 801, 155, 777, 170, 636, 380, 920, 743, 146, 785, 202, 712, 210, 37, 318, 719, 85, 975, 769, 519, 885, 375, 448, 161, 296, 30, 24, 422, 385, 105, 124, 41, 946, 766, 33, 244, 697, 604, 130, 651, 958, 660, 864, 583, 166, 682, 34, 739, 918, 411, 804, 822, 637, 163, 663, 232, 76, 800, 592, 259, 723, 132, 806, 601, 705, 996, 794, 503, 625, 657, 44, 598, 354, 868, 117, 569, 27, 17, 252, 79, 765, 800, 288, 576, 191, 719, 620, 378, 466, 268, 689, 773, 360, 452, 460, 140, 72, 822, 313, 335, 989, 930, 798, 831, 27, 4, 91, 451, 716, 175, 911, 259, 230, 326, 518, 38, 261, 951, 21, 882, 157, 232, 115, 671, 288, 632, 983, 856, 842, 73, 562, 369, 290, 830, 429, 816, 208, 845, 69, 144, 708, 260, 670, 363, 944, 551, 134, 368, 901, 234, 110, 505, 804, 986, 334, 319, 681, 953, 409, 269, 891, 102, 424, 262, 642, 501, 390, 886, 77, 683, 812, 942, 143, 553, 402, 430, 974, 288, 473, 631, 384, 570, 631, 136, 824, 50, 508, 434, 551, 661, 404, 89, 880, 698, 572, 791, 897, 253, 173, 912, 486, 31, 658, 822, 413, 205, 802, 764, 330, 200, 316, 941, 516, 30, 23, 67, 222, 64, 679, 369, 546, 561, 302, 293, 988, 674, 574, 400, 149, 327, 419, 688, 86, 168, 775, 658, 755, 169, 114, 413, 354, 235, 924, 721, 692, 320, 712, 1001, 189, 970, 124, 548, 128, 70, 783, 534, 899, 575, 215, 849, 600, 113, 834, 27, 751, 463, 481, 512, 645, 930, 726, 311, 42, 560, 962, 400, 528, 961, 353, 469, 756, 733, 945, 116, 409, 643, 889, 923, 781, 728, 460, 474, 123, 717, 909, 577, 499, 197, 648, 913, 276, 239, 80, 76, 428, 300, 471, 348, 793, 970, 22, 425, 597, 89, 99, 476, 918, 684, 48, 844, 743, 674, 703, 984, 997, 431, 54, 328, 770, 667, 454, 94, 499, 943, 300, 201, 969, 203, 194, 509, 707, 248, 52, 722, 328, 485, 856, 566, 778, 34, 817, 828, 37, 963, 236, 298, 667, 112, 454, 446, 112, 654, 691, 326, 37, 188, 634, 855, 830, 75, 841, 745, 376, 125, 695, 237, 223, 89, 450, 135, 543, 813, 326, 374, 976, 132, 79, 391, 115, 970, 634, 58, 111, 636, 397, 948, 914, 149, 216, 466, 73, 464, 831, 886, 533, 729, 702, 32, 542, 55, 412, 917, 269, 597, 73, 972, 908, 857, 66, 56, 109, 223, 25, 483, 151, 865, 769, 333, 41, 962, 81, 746, 985, 171, 425, 29, 443, 147, 725, 33, 787, 986, 387, 327, 841, 417, 932, 607, 747, 40, 296, 356, 81, 664, 464, 717, 850, 607, 84, 513, 145, 855, 385, 977, 676, 550, 319, 894, 194, 563, 420, 445, 428, 613, 363, 568, 530, 274, 808, 382, 121, 67, 398, 739, 949, 100, 428, 561, 917, 284, 723, 112, 741, 157, 943, 216, 68, 945, 162, 545, 598, 469, 442, 484, 962, 504, 163, 707, 58, 38, 308, 143, 538, 862, 945]
""" |
def parallel(task_id, file_name, workers, parameters={}):
response = {
'task_id': task_id,
"user_output": "Command received",
'completed': True
}
responses.append(response)
return | def parallel(task_id, file_name, workers, parameters={}):
response = {'task_id': task_id, 'user_output': 'Command received', 'completed': True}
responses.append(response)
return |
#First
i1 = str(input())
for i in i1:
print(i, end=" ")
#Second
i1 = "anant"
for i in range(0,len(i1)):
if i == len(i1) - 1:
print(i1[i],end="")
else:
print(i1[i], end=" ")
for i in range(0,3):
x = input()
print(x)
#Third
tuples = [
(-2.3391885553668246e-10, 8.473071450645254e-10),
(-2.91634014818891e-10, 8.913956007163883e-10),
(-3.470135547671147e-10, 9.186162538099684e-10),
(-3.9905561869610444e-10, 8.425016542750256e-10),
(-4.4700997526371524e-10, 8.681513230068634e-10),
(-4.903967399792693e-10, 9.204845678073805e-10),
]
result = sum(t[0] for t in tuples)
print(result)
#Fourth
a,b = input().split()
if a > b:
print(b)
else:
print(a)
#Fifth
a = 'abc'
result = 0
for x in range(0,len(a)):
result += ord(a[x])
print(result)
#Sixth
list1 = [1,2,3,4,5]
mapped_list = list(map(lambda x: 5*x, list1))
print(mapped_list)
#Seventh
number = int(input("Enter the integer number: "))
revs_number = 0
while (number > 0):
# Logic
remainder = number % 10
revs_number = (revs_number * 10) + remainder
number = number // 10
print("The reverse number is : {}".format(revs_number)) | i1 = str(input())
for i in i1:
print(i, end=' ')
i1 = 'anant'
for i in range(0, len(i1)):
if i == len(i1) - 1:
print(i1[i], end='')
else:
print(i1[i], end=' ')
for i in range(0, 3):
x = input()
print(x)
tuples = [(-2.3391885553668246e-10, 8.473071450645254e-10), (-2.91634014818891e-10, 8.913956007163883e-10), (-3.470135547671147e-10, 9.186162538099684e-10), (-3.9905561869610444e-10, 8.425016542750256e-10), (-4.4700997526371524e-10, 8.681513230068634e-10), (-4.903967399792693e-10, 9.204845678073805e-10)]
result = sum((t[0] for t in tuples))
print(result)
(a, b) = input().split()
if a > b:
print(b)
else:
print(a)
a = 'abc'
result = 0
for x in range(0, len(a)):
result += ord(a[x])
print(result)
list1 = [1, 2, 3, 4, 5]
mapped_list = list(map(lambda x: 5 * x, list1))
print(mapped_list)
number = int(input('Enter the integer number: '))
revs_number = 0
while number > 0:
remainder = number % 10
revs_number = revs_number * 10 + remainder
number = number // 10
print('The reverse number is : {}'.format(revs_number)) |
img = tf.placeholder(tf.float32, [None, None, None, 3])
cost = tf.reduce_sum(...)
my_img_summary = tf.summary.image("img", img)
my_cost_summary = tf.summary.scalar("cost", cost) | img = tf.placeholder(tf.float32, [None, None, None, 3])
cost = tf.reduce_sum(...)
my_img_summary = tf.summary.image('img', img)
my_cost_summary = tf.summary.scalar('cost', cost) |
class Stack:
def __init__(self, name, service_list):
self.name = name
self.service_list = service_list
def services(self):
return [x.attrs() for x in self.service_list]
def serializable(self):
return {
"name": self.name,
"services": self.services()
}
| class Stack:
def __init__(self, name, service_list):
self.name = name
self.service_list = service_list
def services(self):
return [x.attrs() for x in self.service_list]
def serializable(self):
return {'name': self.name, 'services': self.services()} |
class Message:
EVENT = "event"
MESSAGE = "message"
UPDATE = "update"
EPHEMERAL = "ephemeral"
| class Message:
event = 'event'
message = 'message'
update = 'update'
ephemeral = 'ephemeral' |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
basic usage::
>>> # Here is a quick simhash example
>>> from changanya.simhash import Simhash
>>>
>>> hash1 = Simhash('This is a test string one.')
>>> hash2 = Simhash('This is a test string TWO.')
>>> hash1 # doctest: +ELLIPSIS
<changanya.simhash.Simhash object at 0x...>
>>> print(hash1)
11537571312501063112
>>> print(hash2)
11537571196679550920
>>> hash1.hex()
'0xa01daffae45cfdc8'
>>> # % of bits in common (calculated via hamming distance)
>>> hash1.similarity(hash2)
0.890625
>>> int(hash1) - int(hash2)
115821512192
>>> hash1 < hash2 # Hashes of the same type can be compared
False
>>> a_list = [hash2, hash1]
>>> for item in a_list:
... print(item)
11537571196679550920
11537571312501063112
>>>
>>> a_list.sort(reverse=True) # Because comparisons work, so does sorting
>>> for item in a_list:
... print(item)
11537571312501063112
11537571196679550920
>>> # It can be extended to any bitlength using the `hashbits` parameter.
>>> hash3 = Simhash('this is yet another test', hashbits=8)
>>> hash3.hex()
'0x18'
>>> hash4 = Simhash('extremely long hash bitlength', hashbits=2048)
>>> hash4.hex()
'0xf00020585012016060260443bab0f7d76fde5549a6857ec'
>>> # But be careful; it only makes sense to compare equal-length hashes!
>>> hash3.similarity(hash4) # doctest: +ELLIPSIS
Traceback (most recent call last):
ValueError: Hashes must be of equal size to find similarity
>>> # Use the Simhash Index
>>> from changanya.simhash import SimhashIndex
>>>
>>> data = [
... 'How are you? I Am fine. blar blar blar blar blar Thanks.',
... 'How are you i am fine. blar blar blar blar blar than',
... 'This is simhash test.']
>>> hashes = [Simhash(text) for text in data]
>>> for simhash in hashes:
... print(simhash)
1318951168287673739
1318951168283479435
13366613251191922586
>>> index = SimhashIndex(hashes, num_blocks=6)
>>> len(index.bucket)
13
>>> simhash = Simhash('How are you im fine. blar blar blar blar thank')
>>> dupe = next(index.find_dupes(simhash))
>>> dupe == hashes[0]
True
>>> index.add(simhash)
>>> simhash.hash
1318986352659762571
>>> dupe = next(index.find_dupes(simhash))
>>> dupe == simhash
True
>>> result = next(index.find_all_dupes())
>>> dupe1, dupe2 = result
>>> (dupe1, dupe2) == (hashes[1], hashes[0])
True
>>> dupe1.similarity(dupe2)
0.984375
>>> dupe1.hamming_distance(dupe2)
1
>>> # Here is the basic Bloom filter use case
>>> from changanya.bloom import Bloomfilter
>>>
>>> hash1 = Bloomfilter('test')
>>> hash1.hashbits, hash1.num_hashes # default values (see below)
(28756, 7)
>>> hash1.add('test string')
>>> 'test string' in hash1
True
>>> 'holy diver' in hash1
False
>>> for word in 'these are some tokens to add to the filter'.split():
... hash1.add(word)
>>> 'these' in hash1
True
>>> hash2 = Bloomfilter(capacity=100, false_positive_rate=0.01)
>>> hash2.hashbits, hash2.num_hashes
(959, 7)
>>> hash3 = Bloomfilter(capacity=1000000, false_positive_rate=0.01)
>>> hash3.hashbits, hash3.num_hashes
(9585059, 7)
>>> hash4 = Bloomfilter(capacity=1000000, false_positive_rate=0.0001)
>>> hash4.hashbits, hash4.num_hashes
(19170117, 14)
>>> hash1.hex() # doctest: +ELLIPSIS
'0x100000000000000004...'
>>> import zlib
>>> len(hash1.hex())
7062
>>> len(zlib.compress(hash1.hex().encode('utf-8')))
220
>>> # Geohash example
>>> from changanya.geohash import Geohash
>>>
>>> here = Geohash('33.050500000000', '-1.024', precision=4)
>>> there = Geohash('34.5000000000', '-2.500', precision=4)
>>> here.hash, there.hash
('evzs', 'eynk')
>>> here.decode()
(Decimal('33.050500'), Decimal('-1.024'))
>>> here.distance_in_miles(there)
Decimal('131.24743')
>>> # The higher the precision, the longer the hash is
>>> here.encode(precision=8)
>>> here.hash
'evzk08wt'
>>> here.decode()
(Decimal('33.0505000000'), Decimal('-1.024'))
>>> # We can also decode arbitrary hashes
>>> here.decode('evzk08wt')
(Decimal('33.0504798889'), Decimal('-1.024'))
>>> here.distance_in_miles(there)
Decimal('131.247434251')
>>> # But we can't gain more precision than we started with
>>> here.encode(precision=16)
>>> here.precision
10
>>> here.max_precision
10
>>> here.hash
'evzk08wm57'
>>> here.decode()
(Decimal('33.050500000000'), Decimal('-1.024'))
>>> there.max_precision
8
>>> here.distance_precision
8
>>> here.distance_in_miles(there)
Decimal('131.247434251')
"""
| """
basic usage::
>>> # Here is a quick simhash example
>>> from changanya.simhash import Simhash
>>>
>>> hash1 = Simhash('This is a test string one.')
>>> hash2 = Simhash('This is a test string TWO.')
>>> hash1 # doctest: +ELLIPSIS
<changanya.simhash.Simhash object at 0x...>
>>> print(hash1)
11537571312501063112
>>> print(hash2)
11537571196679550920
>>> hash1.hex()
'0xa01daffae45cfdc8'
>>> # % of bits in common (calculated via hamming distance)
>>> hash1.similarity(hash2)
0.890625
>>> int(hash1) - int(hash2)
115821512192
>>> hash1 < hash2 # Hashes of the same type can be compared
False
>>> a_list = [hash2, hash1]
>>> for item in a_list:
... print(item)
11537571196679550920
11537571312501063112
>>>
>>> a_list.sort(reverse=True) # Because comparisons work, so does sorting
>>> for item in a_list:
... print(item)
11537571312501063112
11537571196679550920
>>> # It can be extended to any bitlength using the `hashbits` parameter.
>>> hash3 = Simhash('this is yet another test', hashbits=8)
>>> hash3.hex()
'0x18'
>>> hash4 = Simhash('extremely long hash bitlength', hashbits=2048)
>>> hash4.hex()
'0xf00020585012016060260443bab0f7d76fde5549a6857ec'
>>> # But be careful; it only makes sense to compare equal-length hashes!
>>> hash3.similarity(hash4) # doctest: +ELLIPSIS
Traceback (most recent call last):
ValueError: Hashes must be of equal size to find similarity
>>> # Use the Simhash Index
>>> from changanya.simhash import SimhashIndex
>>>
>>> data = [
... 'How are you? I Am fine. blar blar blar blar blar Thanks.',
... 'How are you i am fine. blar blar blar blar blar than',
... 'This is simhash test.']
>>> hashes = [Simhash(text) for text in data]
>>> for simhash in hashes:
... print(simhash)
1318951168287673739
1318951168283479435
13366613251191922586
>>> index = SimhashIndex(hashes, num_blocks=6)
>>> len(index.bucket)
13
>>> simhash = Simhash('How are you im fine. blar blar blar blar thank')
>>> dupe = next(index.find_dupes(simhash))
>>> dupe == hashes[0]
True
>>> index.add(simhash)
>>> simhash.hash
1318986352659762571
>>> dupe = next(index.find_dupes(simhash))
>>> dupe == simhash
True
>>> result = next(index.find_all_dupes())
>>> dupe1, dupe2 = result
>>> (dupe1, dupe2) == (hashes[1], hashes[0])
True
>>> dupe1.similarity(dupe2)
0.984375
>>> dupe1.hamming_distance(dupe2)
1
>>> # Here is the basic Bloom filter use case
>>> from changanya.bloom import Bloomfilter
>>>
>>> hash1 = Bloomfilter('test')
>>> hash1.hashbits, hash1.num_hashes # default values (see below)
(28756, 7)
>>> hash1.add('test string')
>>> 'test string' in hash1
True
>>> 'holy diver' in hash1
False
>>> for word in 'these are some tokens to add to the filter'.split():
... hash1.add(word)
>>> 'these' in hash1
True
>>> hash2 = Bloomfilter(capacity=100, false_positive_rate=0.01)
>>> hash2.hashbits, hash2.num_hashes
(959, 7)
>>> hash3 = Bloomfilter(capacity=1000000, false_positive_rate=0.01)
>>> hash3.hashbits, hash3.num_hashes
(9585059, 7)
>>> hash4 = Bloomfilter(capacity=1000000, false_positive_rate=0.0001)
>>> hash4.hashbits, hash4.num_hashes
(19170117, 14)
>>> hash1.hex() # doctest: +ELLIPSIS
'0x100000000000000004...'
>>> import zlib
>>> len(hash1.hex())
7062
>>> len(zlib.compress(hash1.hex().encode('utf-8')))
220
>>> # Geohash example
>>> from changanya.geohash import Geohash
>>>
>>> here = Geohash('33.050500000000', '-1.024', precision=4)
>>> there = Geohash('34.5000000000', '-2.500', precision=4)
>>> here.hash, there.hash
('evzs', 'eynk')
>>> here.decode()
(Decimal('33.050500'), Decimal('-1.024'))
>>> here.distance_in_miles(there)
Decimal('131.24743')
>>> # The higher the precision, the longer the hash is
>>> here.encode(precision=8)
>>> here.hash
'evzk08wt'
>>> here.decode()
(Decimal('33.0505000000'), Decimal('-1.024'))
>>> # We can also decode arbitrary hashes
>>> here.decode('evzk08wt')
(Decimal('33.0504798889'), Decimal('-1.024'))
>>> here.distance_in_miles(there)
Decimal('131.247434251')
>>> # But we can't gain more precision than we started with
>>> here.encode(precision=16)
>>> here.precision
10
>>> here.max_precision
10
>>> here.hash
'evzk08wm57'
>>> here.decode()
(Decimal('33.050500000000'), Decimal('-1.024'))
>>> there.max_precision
8
>>> here.distance_precision
8
>>> here.distance_in_miles(there)
Decimal('131.247434251')
""" |
expected_output = {
"software-information": {
"package-information": [
{"comment": "EX Software Suite [18.2R2-S1]", "name": "ex-software-suite"},
{
"comment": "FIPS mode utilities [18.2R2-S1]",
"name": "fips-mode-utilities",
},
{
"comment": "Crypto Software Suite [18.2R2-S1]",
"name": "crypto-software-suite",
},
{
"comment": "Online Documentation [18.2R2-S1]",
"name": "online-documentation",
},
{
"comment": "Phone-Home Software Suite [18.2R2-S1]",
"name": "phone-home-software-suite",
},
],
"host-name": "JunosHostname-1",
"product-model": "ex4200-24p",
"product-name": "ex4200-24p",
"junos-version": "18.2R2-S1",
}
}
| expected_output = {'software-information': {'package-information': [{'comment': 'EX Software Suite [18.2R2-S1]', 'name': 'ex-software-suite'}, {'comment': 'FIPS mode utilities [18.2R2-S1]', 'name': 'fips-mode-utilities'}, {'comment': 'Crypto Software Suite [18.2R2-S1]', 'name': 'crypto-software-suite'}, {'comment': 'Online Documentation [18.2R2-S1]', 'name': 'online-documentation'}, {'comment': 'Phone-Home Software Suite [18.2R2-S1]', 'name': 'phone-home-software-suite'}], 'host-name': 'JunosHostname-1', 'product-model': 'ex4200-24p', 'product-name': 'ex4200-24p', 'junos-version': '18.2R2-S1'}} |
#MenuTitle: Masters Overview
# -*- coding: utf-8 -*-
__doc__="""
Creates a new tab with rows of selected glyphs in all available master layers. Useful for comparing the different weights of a typeface.
"""
Font = Glyphs.font
Font.newTab()
for glyph in Font.selection:
Font.currentTab.layers.append(GSControlLayer(10))
for layer in glyph.layers:
if layer.isMasterLayer is True :
Font.currentTab.layers.append(layer)
| __doc__ = '\nCreates a new tab with rows of selected glyphs in all available master layers. Useful for comparing the different weights of a typeface.\n'
font = Glyphs.font
Font.newTab()
for glyph in Font.selection:
Font.currentTab.layers.append(gs_control_layer(10))
for layer in glyph.layers:
if layer.isMasterLayer is True:
Font.currentTab.layers.append(layer) |
# reassign the dataframe to be the result of the following .loc
# .loc[start_row:end_row, start_column:end_column]
# .loc[:, "Under 5":"18 years"] will return all columns between and including
df["age_bin_0-19"] = df.loc[:, 'Estimate Male Under 5':'Estimate Male 18']
df = DataFrame(np.random.rand(4,5), columns = list('abcde'))
df.loc[:, "b":"d"] # returns the b, c, and d columns
| df['age_bin_0-19'] = df.loc[:, 'Estimate Male Under 5':'Estimate Male 18']
df = data_frame(np.random.rand(4, 5), columns=list('abcde'))
df.loc[:, 'b':'d'] |
class Node:
pass
class ProgramNode(Node):
def __init__(self, declarations):
self.declarations = declarations
class DeclarationNode(Node):
pass
class ExpressionNode(Node):
pass
class ClassDeclarationNode(DeclarationNode):
def __init__(self, idx, features, parent, row , column):
self.id = idx
self.parent = parent
self.features = features
self.place_holder = None
self.row = row
self.column = column
class FuncDeclarationNode(DeclarationNode):
def __init__(self, idx, params, return_type, body, row, column):
self.id = idx
self.params = params
self.type = return_type
self.body = body
self.place_holder = None
self.row = row
self.column = column
class IfNode(ExpressionNode):
def __init__(self,ifexp, thenexp,elseexp, row, column):
self.ifexp = ifexp
self.thenexp = thenexp
self.elseexp = elseexp
self.place_holder = None
self.row = row
self.column = column
class WhileNode(ExpressionNode):
def __init__(self, condition, body, row, column):
self.condition = condition
self.body = body
self.place_holder = None
self.row = row
self.column = column
class CaseNode(ExpressionNode):
def __init__(self,case,body, row, column):
self.case = case
self.body = body
self.place_holder = None
self.row = row
self.column = column
class LetNode(ExpressionNode):
def __init__(self, params, body, row, column):
self.params = params
self.body = body
self.place_holder = None
self.row = row
self.column = column
class ExpressionGroupNode(ExpressionNode):
def __init__(self, body, row, column):
self.body = body
self.place_holder = None
self.row = row
self.column = column
class AttrDeclarationNode(DeclarationNode):
def __init__(self, idx, typex, expr, row = 0, column = 0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class ParamDeclarationNode(DeclarationNode):
def __init__(self, idx, typex, row = 0, column = 0):
self.id = idx
self.type = typex
self.row = row
self.column = column
class VarDeclarationNode(ExpressionNode): #Case expr
def __init__(self, idx, typex, expr, row = 0, column = 0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class LetDeclarationNode(ExpressionNode): #Let expr
def __init__(self, idx, typex, expr, row = 0, column = 0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class AssignNode(ExpressionNode):
def __init__(self, idx, expr, row, column):
self.id = idx
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class CallNode(ExpressionNode):
def __init__(self, obj, idx, args, parent,call_type, row = 0, column = 0):
self.obj = obj
self.id = idx
self.args = args
self.parent = parent
self.place_holder = None
self.call_type = call_type
self.row = row
self.column = column
class ExpressionGroupNode(ExpressionNode):
def __init__(self, body, row, column):
self.body = body
self.place_holder = None
self.row = row
self.column = column
class AtomicNode(ExpressionNode):
def __init__(self, lex, row, column):
self.lex = lex
self.place_holder = None
self.row = row
self.column = column
class BinaryNode(ExpressionNode):
def __init__(self, tok, left, right, row, column):
self.left = left
self.right = right
self.lex = tok.value
self.row = row
self.column = column
class BinaryIntNode(BinaryNode):
pass
class BinaryBoolNode(BinaryNode):
pass
class UnaryNode(ExpressionNode):
def __init__(self,right, row, column):
self.right = right
self.place_holder = None
self.row = row
self.column = column
class StringNode(AtomicNode):
pass
class ConstantNumNode(AtomicNode):
pass
class VariableNode(AtomicNode):
pass
class InstantiateNode(AtomicNode):
pass
class BooleanNode(AtomicNode):
pass
class SelfNode(AtomicNode):
pass
class PlusNode(BinaryIntNode):
pass
class MinusNode(BinaryIntNode):
pass
class StarNode(BinaryIntNode):
pass
class DivNode(BinaryIntNode):
pass
class EqualNode(BinaryNode):
pass
class LessEqual(BinaryBoolNode):
pass
class LessNode(BinaryBoolNode):
pass
class IsVoidNode(UnaryNode):
pass
class NotNode(UnaryNode):
pass
class NegateNode(UnaryNode):
pass | class Node:
pass
class Programnode(Node):
def __init__(self, declarations):
self.declarations = declarations
class Declarationnode(Node):
pass
class Expressionnode(Node):
pass
class Classdeclarationnode(DeclarationNode):
def __init__(self, idx, features, parent, row, column):
self.id = idx
self.parent = parent
self.features = features
self.place_holder = None
self.row = row
self.column = column
class Funcdeclarationnode(DeclarationNode):
def __init__(self, idx, params, return_type, body, row, column):
self.id = idx
self.params = params
self.type = return_type
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Ifnode(ExpressionNode):
def __init__(self, ifexp, thenexp, elseexp, row, column):
self.ifexp = ifexp
self.thenexp = thenexp
self.elseexp = elseexp
self.place_holder = None
self.row = row
self.column = column
class Whilenode(ExpressionNode):
def __init__(self, condition, body, row, column):
self.condition = condition
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Casenode(ExpressionNode):
def __init__(self, case, body, row, column):
self.case = case
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Letnode(ExpressionNode):
def __init__(self, params, body, row, column):
self.params = params
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Expressiongroupnode(ExpressionNode):
def __init__(self, body, row, column):
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Attrdeclarationnode(DeclarationNode):
def __init__(self, idx, typex, expr, row=0, column=0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class Paramdeclarationnode(DeclarationNode):
def __init__(self, idx, typex, row=0, column=0):
self.id = idx
self.type = typex
self.row = row
self.column = column
class Vardeclarationnode(ExpressionNode):
def __init__(self, idx, typex, expr, row=0, column=0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class Letdeclarationnode(ExpressionNode):
def __init__(self, idx, typex, expr, row=0, column=0):
self.id = idx
self.type = typex
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class Assignnode(ExpressionNode):
def __init__(self, idx, expr, row, column):
self.id = idx
self.expr = expr
self.place_holder = None
self.row = row
self.column = column
class Callnode(ExpressionNode):
def __init__(self, obj, idx, args, parent, call_type, row=0, column=0):
self.obj = obj
self.id = idx
self.args = args
self.parent = parent
self.place_holder = None
self.call_type = call_type
self.row = row
self.column = column
class Expressiongroupnode(ExpressionNode):
def __init__(self, body, row, column):
self.body = body
self.place_holder = None
self.row = row
self.column = column
class Atomicnode(ExpressionNode):
def __init__(self, lex, row, column):
self.lex = lex
self.place_holder = None
self.row = row
self.column = column
class Binarynode(ExpressionNode):
def __init__(self, tok, left, right, row, column):
self.left = left
self.right = right
self.lex = tok.value
self.row = row
self.column = column
class Binaryintnode(BinaryNode):
pass
class Binaryboolnode(BinaryNode):
pass
class Unarynode(ExpressionNode):
def __init__(self, right, row, column):
self.right = right
self.place_holder = None
self.row = row
self.column = column
class Stringnode(AtomicNode):
pass
class Constantnumnode(AtomicNode):
pass
class Variablenode(AtomicNode):
pass
class Instantiatenode(AtomicNode):
pass
class Booleannode(AtomicNode):
pass
class Selfnode(AtomicNode):
pass
class Plusnode(BinaryIntNode):
pass
class Minusnode(BinaryIntNode):
pass
class Starnode(BinaryIntNode):
pass
class Divnode(BinaryIntNode):
pass
class Equalnode(BinaryNode):
pass
class Lessequal(BinaryBoolNode):
pass
class Lessnode(BinaryBoolNode):
pass
class Isvoidnode(UnaryNode):
pass
class Notnode(UnaryNode):
pass
class Negatenode(UnaryNode):
pass |
a, b = map(int, input().split())
b -= 1
print(a * b + 1) | (a, b) = map(int, input().split())
b -= 1
print(a * b + 1) |
#!/anaconda3/bin/python
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class LeetCode_21_495(object):
def mergeTwoLists(self, l1, l2):
prehead = ListNode(-1)
prev = prehead
while l1 and l2:
if l1.val <= l2.val:
prev.next = l1
l1 = l1.next
else:
prev.next = l2
l2 = l2.next
prev = prev.next
prev.next = l1 if l1 is not None else l2
return prehead.next
if __name__ == '__main__':
a = ListNode(11)
ab = ListNode(2)
ac = ListNode(3)
ad = ListNode(4)
ad = ListNode(4)
a.next = ab
ab.next = ac
ac.next = ad
b = ListNode(55)
bb = ListNode(6)
bc = ListNode(7)
bd = ListNode(8)
be = ListNode(9)
bf = ListNode(10)
bg = ListNode(12)
b.next = bb
bb.next = bc
bc.next = bd
bd.next = be
be.next = bf
bf.next = bg
c = LeetCode_21_495().mergeTwoLists(a,b)
while c.next:
print(c.val)
c = c.next
| class Listnode:
def __init__(self, x):
self.val = x
self.next = None
class Leetcode_21_495(object):
def merge_two_lists(self, l1, l2):
prehead = list_node(-1)
prev = prehead
while l1 and l2:
if l1.val <= l2.val:
prev.next = l1
l1 = l1.next
else:
prev.next = l2
l2 = l2.next
prev = prev.next
prev.next = l1 if l1 is not None else l2
return prehead.next
if __name__ == '__main__':
a = list_node(11)
ab = list_node(2)
ac = list_node(3)
ad = list_node(4)
ad = list_node(4)
a.next = ab
ab.next = ac
ac.next = ad
b = list_node(55)
bb = list_node(6)
bc = list_node(7)
bd = list_node(8)
be = list_node(9)
bf = list_node(10)
bg = list_node(12)
b.next = bb
bb.next = bc
bc.next = bd
bd.next = be
be.next = bf
bf.next = bg
c = leet_code_21_495().mergeTwoLists(a, b)
while c.next:
print(c.val)
c = c.next |
countries = [[('Finland', 'Helsinki')], [('Sweden', 'Stockholm')], [('Norway', 'Oslo')]]
flatten = [p for p in countries for p in p]
dictofcountries = [{'country': flatten[i][0].upper(), 'city': flatten[i][1].upper()} for i in range(len(flatten))]
print(dictofcountries)
| countries = [[('Finland', 'Helsinki')], [('Sweden', 'Stockholm')], [('Norway', 'Oslo')]]
flatten = [p for p in countries for p in p]
dictofcountries = [{'country': flatten[i][0].upper(), 'city': flatten[i][1].upper()} for i in range(len(flatten))]
print(dictofcountries) |
#!/usr/bin/env python3
# Modify the higher or lower program from this section to keep track of how
# many times the user has entered the wrong number. If it is more than 3
# times, print "That must have been complicated." at the end, otherwise
# print "Good job!"
number = 7
guess = -1
count = 0
print("Guess the number!")
while guess != number:
guess = int(input("Is it... "))
count = count + 1
if guess == number:
print("Hooray! You guessed it right!")
elif guess < number:
print("It's bigger... ")
elif guess > number:
print("It's not so big.")
if count > 3:
print("That must have been complicated.")
else:
print("Good job!")
| number = 7
guess = -1
count = 0
print('Guess the number!')
while guess != number:
guess = int(input('Is it... '))
count = count + 1
if guess == number:
print('Hooray! You guessed it right!')
elif guess < number:
print("It's bigger... ")
elif guess > number:
print("It's not so big.")
if count > 3:
print('That must have been complicated.')
else:
print('Good job!') |
def test_model_with_one_index():
ddl = """
CREATE table v2.task_requests (
runid decimal(21) not null
,job_id decimal(21) not null
,object_id varchar(100) not null default 'none'
,pipeline_id varchar(100) not null default 'none'
,sequence smallint not null
,processor_id varchar(100) not null
,source_file varchar(1000) not null default 'none'
,job_args varchar array null
,request_time timestamp not null default now()
,status varchar(25) not null
,status_update_time timestamp null default now()
) ;
create unique index task_requests_pk on v2.task_requests (runid) ;
"""
pass | def test_model_with_one_index():
ddl = "\n \n CREATE table v2.task_requests (\n runid decimal(21) not null\n ,job_id decimal(21) not null\n ,object_id varchar(100) not null default 'none'\n ,pipeline_id varchar(100) not null default 'none'\n ,sequence smallint not null\n ,processor_id varchar(100) not null\n ,source_file varchar(1000) not null default 'none'\n ,job_args varchar array null\n ,request_time timestamp not null default now()\n ,status varchar(25) not null\n ,status_update_time timestamp null default now()\n ) ;\n create unique index task_requests_pk on v2.task_requests (runid) ;\n \n "
pass |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 for python
#
# written in python3, (c) 2019-2021 by mworion
#
# Licence APL2.0
#
###########################################################
#
# this file is auto generated for the purpose of getting data prepared
# to show the alignment stars in mountwizzard
#
# standard libraries
# external packages
# local import
def generateAlignStars():
"""
generateAlignStars is the function where the alignment stars which were
present in the mount computer from hipparcos catalogue are stored. for a
correct calculation we need beside the J2000 coordinated the proper motion in
ra and dec, the parallax and the radial velocity as the stars move over time.
the data is calculated from the hipparcos catalogue using skyfield library
the data is written in
[name, hip no, ra, dec, ra proper motion, dec proper motion, parallax,
radial velocity] based on J2000 epoch. the units are fitting erfa needs:
[str, int, radians, radians, radians / year, radians/year, arc sec, km /s]
"""
star = dict()
star['Achernar'] = [0.42635506995907607, -0.9989698721359219,
4.2673525759820365e-07, -1.943125977115248e-07,
0.02267999999992084, 0.0003167502564713614]
star['Acrux'] = [3.2576512864528886, -1.101286904826098,
-1.7147902160979606e-07, -7.141295136130161e-08,
0.010170000000154411, 9.35888419199978e-06]
star['Adhara'] = [1.8265996517525316, -0.505658252449314,
1.2750598440896192e-08, 1.110223390053311e-08,
0.007570000000003465, 2.800807867466727e-07]
star['Albireo'] = [5.1082355548040095, 0.487988493164614,
-3.4373281271162636e-08, -2.729501452991444e-08,
0.008460000000023256, 1.6864932050137538e-06]
star['Alcor'] = [3.513455837250785, 0.9597209098682812,
5.834720675264054e-07, -8.21288380803576e-08,
0.04019000000151324, 2.530550909884062e-05]
star['Aldebaran'] = [1.2039308165580604, 0.28814166253131995,
3.0436457894318447e-07, -9.180434074427846e-07,
0.05009000001146675, 0.0001585789211928221]
star['Alderamin'] = [5.57884816439538, 1.092324307334224,
7.267899307112835e-07, 2.3401767388248366e-07,
0.06684000000195339, 2.1353840766936493e-05]
star['Algenib'] = [0.8915260068606703, 0.8702417522558126,
1.168882724683577e-07, -1.2610009740186727e-07,
0.0055100000003035126, 3.352331537061314e-05]
star['Algieba'] = [2.705139847445134, 0.346299303753731,
1.506648421275404e-06, -7.411895001776125e-07,
0.025960000033972072, 0.0008434026928508933]
star['Algol'] = [0.8210415037834745, 0.7148108996219749,
1.158704574925575e-08, -6.981317589803856e-09,
0.035140000000001614, 3.05256816398171e-08]
star['Alhena'] = [1.7353445977036466, 0.28622094379493473,
-9.890182560437117e-09, -3.244373156278081e-07,
0.03112000000137838, 2.8977450370070085e-05]
star['Alioth'] = [3.377335599016013, 0.976683127865405,
5.417301952979467e-07, -4.358594163516689e-08,
0.040300000001195005, 1.9935819844802488e-05]
star['Alkaid'] = [3.610829903320896, 0.8606788398861204,
-5.877387226590185e-07, -7.543850370132115e-08,
0.032390000001987905, 4.030266398028019e-05]
star['Almach'] = [0.5406116794736521, 0.7387930668804668,
2.0885691266108436e-07, -2.465279469506438e-07,
0.009190000001178217, 7.881471025189807e-05]
star['Alnair'] = [5.795507653347898, -0.819623644322571,
6.186305746827898e-07, -7.170862444881037e-07,
0.032160000009032644, 0.00018431299531260673]
star['Alnilam'] = [1.4670083915012704, -0.02097745833746889,
7.2237238621687114e-09, -5.1390250101810046e-09,
0.002430000000001115, 2.767647528554548e-07]
star['Alnitak'] = [1.4868406913498162, -0.03390428143013612,
1.9344065734811443e-08, 1.2314267611160056e-08,
0.003990000000007422, 1.1271649225724928e-06]
star['Alphard'] = [2.4765671847023185, -0.15112112215068238,
-7.024947219927349e-08, 1.6120055539839789e-07,
0.01840000000041811, 1.433254439299072e-05]
star['Alpheratz'] = [0.03659716798611327, 0.5077238156833932,
6.577901367872488e-07, -7.900054984440228e-07,
0.03359999999877105, 0.0015913509611004788]
star['Altair'] = [5.195772123915302, 0.15478142574597795,
2.6025900895845885e-06, 1.8691416330407734e-06,
0.19444000006898107, 0.00044490620582886075]
star['Aludra'] = [1.9377301930466717, -0.5114356387785041,
-1.8228988625897067e-08, 3.228859240346924e-08,
0.0010200000000184408, 1.0869774259672181e-05]
star['Ankaa'] = [0.1146829107879592, -0.7383786779763821,
1.1284831383404688e-06, -1.7144895291169717e-06,
0.04213999999412877, 0.0040035348174432]
star['Antares'] = [4.317105473309646, -0.4613254718829243,
-4.925711810625137e-08, -1.1252524661051282e-07,
0.0053999999999969775, 0.0008219386508180743]
star['Arcturus'] = [3.733529012714681, 0.3347961767029305,
-5.300882113287412e-06, -9.693441003092346e-06,
0.0888500012940421, 0.011467277405555558]
star['Atria'] = [4.401129594008038, -1.2047609033269415,
8.653987296196387e-08, -1.5960064190983694e-07,
0.007850000000369397, 2.8821943319029024e-05]
star['Avior'] = [2.192631681379373, -1.0386364152210767,
-1.2285138441820442e-07, 1.1014972611646225e-07,
0.00516000000022552, 2.657294475548769e-05]
star['Becrux'] = [3.34981703178929, -1.0417654518737323,
-2.3387455510248137e-07, -6.21529052883799e-08,
0.009250000000247748, 1.646772425062188e-05]
star['Bellatrix'] = [1.4186518374129689, 0.11082321019807921,
-4.2421191775724186e-08, -6.438325858295131e-08,
0.013420000000081509, 3.77778985795775e-06]
star['Betelgeuse'] = [1.5497291218333036, 0.12927763286721894,
1.324995949259527e-07, 5.2650746120233373e-08,
0.0076300000002801896, 2.2478299265541744e-05]
star['Birdun'] = [3.577435124514057, -0.9331646108382332,
-7.078290116660212e-08, -6.200764883423321e-08,
0.00868000000007837, 5.542656158511533e-06]
star['Canopus'] = [1.6753053550581112, -0.9197127760270881,
9.691399928699686e-08, 1.1475543795563986e-07,
0.01043000000023061, 1.3638797482580787e-05]
star['Capella'] = [1.3818164179749326, 0.8028163852556699,
3.661175465513113e-07, -2.0707852618187437e-06,
0.07729000004925092, 0.0004820766940057257]
star['Caph'] = [0.040025864271171274, 1.0323584023330052,
2.537401264788819e-06, -8.747256573612981e-07,
0.05989000002945251, 0.0003513394160527818]
star['Castor'] = [1.9835582691444889, 0.55655541096058,
-1.0003082378134486e-06, -7.18400840114895e-07,
0.06326999999699984, 0.0006603500780342239]
star['Deneb'] = [5.416768549639101, 0.7902909845019924,
7.563094426808563e-09, 7.514611803495459e-09,
0.0010099999999999966, 0.00013325736873785185]
star['Denebola'] = [3.0938569610040525, 0.2543304289930705,
-2.419311156063305e-06, -5.516334832548955e-07,
0.09016000006262251, 0.0005494092119495847]
star['Diphda'] = [0.1901946478083879, -0.313925470771022,
1.1285967507789465e-06, 1.5858583005313695e-07,
0.03404000001527349, 0.0002960809516413248]
star['Dschubba'] = [4.1902451316147795, -0.39482332143123317,
-4.2033400895683004e-08, -1.7889624233267226e-07,
0.008119999999989573, 0.0008457168978493212]
star['Dubhe'] = [2.8960653511533034, 1.0777588451611648,
-6.615730649573739e-07, -1.7089842010161175e-07,
0.02638000000168808, 4.129163182305979e-05]
star['Durre Menthor'] = [0.45408540819664434, -0.2781614838923893,
-8.347446041643784e-06, 4.140809252755996e-06,
0.2741700003075673, 0.0025467724108209243]
star['Elnath'] = [1.4237168137688543, 0.49929418963649913,
1.1286371385556528e-07, -8.446424361125599e-07,
0.02488999999931021, 0.0021102759572637353]
star['Enif'] = [5.690584783936927, 0.1723514602597197,
1.4554107003664866e-07, 6.690397468497408e-09,
0.004850000000290319, 3.6364339479757246e-05]
star['Etamin'] = [4.69758079842709, 0.8986507452358823,
-4.13060240615731e-08, -1.1174956075521153e-07,
0.022099999999988868, 4.802365092647439e-05]
star['Fomalhaut'] = [6.011133398285404, -0.5170055560865453,
1.596116251175188e-06, -7.961514442642038e-07,
0.13008000002377812, 0.00016839652699463895]
star['Foramen'] = [4.975479708318686, -0.9602030279549373,
8.193332974001665e-09, 8.896331075961123e-08,
0.004790000000111848, 1.4182818294769256e-05]
star['Gacrux'] = [3.277578934434846, -0.9968135958390298,
1.3546164292018533e-07, -1.2815079298710082e-06,
0.03709000002118096, 0.00038026031212998385]
star['Gemma'] = [4.078344297757775, 0.4662593500177362,
5.836164784602716e-07, -4.3361855305783936e-07,
0.04364999999923094, 0.0004749733026092676]
star['Gienah'] = [5.437619832660372, 0.5928928235555605,
1.7267450215552336e-06, 1.6012305300227907e-06,
0.04526000005787727, 0.0008727564774680463]
star['Girtab'] = [4.613423671040447, -0.750453597552295,
2.9379711284354737e-08, -4.605726201560463e-09,
0.011990000000006672, 3.447754303400006e-07]
star['Gruid'] = [5.9457560075832445, -0.8182902354262535,
6.57795471464524e-07, -2.186320714946966e-08,
0.01917000000274361, 9.046731034516553e-05]
star['Hadar'] = [3.681875666769781, -1.0537083159099074,
-1.6464334143778704e-07, -1.2149420614057753e-07,
0.006209999999994911, 0.0009137322626429944]
star['Hamal'] = [0.5548981381429913, 0.40949653104300493,
9.246801678210333e-07, -7.067156367318856e-07,
0.04948000001509084, 0.00021087217637601825]
star['Herschel Star'] = [5.6876250069680605, 1.0259053385102446,
2.5404226643504052e-08, -1.3962636520298012e-08,
0.0006200000000052498, 5.085416049876108e-06]
star['Izar'] = [3.8614843432159414, 0.4725343244285851,
-2.4555834257143246e-07, 9.696252229133127e-08,
0.015550000000782651, 3.1492226299260285e-05]
star['Kaus Australis'] = [4.81785946005412, -0.6001247657331712,
-1.920360828391738e-07, -6.014112209360647e-07,
0.02255000000518801, 0.00014683170217628355]
star['Kochab'] = [3.88643929589975, 1.2942577193687248,
-1.5654689526730107e-07, 5.7741253070346283e-08,
0.02579000000006858, 1.7129342004436014e-06]
star['Koo She'] = [2.289451216840046, -0.9548490600305676,
1.3953112000316027e-07, -5.048848871271923e-07,
0.040900000003322244, 5.470925163339363e-05]
star['Marchab'] = [6.042159155901372, 0.265381926804241,
2.962208678925014e-07, -2.0633689681602876e-07,
0.023359999999888748, 0.0004087188162900425]
star['Marfikent'] = [3.8201207423147325, -0.7357928431030926,
-1.7118813759578646e-07, -1.5727343050882903e-07,
0.01057000000056649, 3.307245114865675e-05]
star['Markab'] = [2.4526837794332965, -0.9601172799234833,
-5.197195577037533e-08, 5.4493068865207765e-08,
0.0060500000000541804, 5.458012450383491e-06]
star['Megrez'] = [3.208897607188377, 0.9954069461371868,
5.020735613243368e-07, 3.786294101930466e-08,
0.040050000000969345, 1.6259857547990848e-05]
star['Men'] = [3.8481427681460767, -0.8270801195052182,
-1.0253832271040569e-07, -1.1742182770277311e-07,
0.0059500000002614, 2.6768924741820013e-05]
star['Menkalinan'] = [1.5687409473992977, 0.7844806923295367,
-2.734833771211616e-07, -4.2666877732678e-09,
0.03972000000047807, 8.077866841049545e-06]
star['Menkent'] = [3.694354541960444, -0.6347754647829705,
-2.517670402545959e-06, -2.5106780511175216e-06,
0.05351999997864442, 0.007462351002327535]
star['Merak'] = [2.8878245742140867, 0.9840589883938196,
3.9590055731762915e-07, 1.6357550334360702e-07,
0.041069999999882284, 8.630312273508286e-05]
star['Miaplacidus'] = [2.413801174909946, -1.2167948180623211,
-7.643381275655257e-07, 5.280122417775545e-07,
0.029339999999607635, 0.0007482912564705958]
star['Mintaka'] = [1.448652420586415, -0.00522014083349973,
8.09638847252015e-09, 2.7149566172089492e-09,
0.0035600000000010315, 1.7533466749502158e-07]
star['Mira'] = [0.6080140011354599, -0.05196967262254898,
5.008130002773315e-08, -1.1610316590840949e-06,
0.007789999999596873, 0.036970271155935756]
star['Mirach'] = [0.30426179810445714, 0.6216960108990267,
8.512785321533603e-07, -5.441093978100774e-07,
0.016360000010577143, 0.00040545055744113315]
star['Mirzam'] = [1.6698426991230342, -0.31338988448214705,
-1.6726072214528015e-08, -2.2786235829647604e-09,
0.006530000000003624, 3.3867852993203564e-07]
star['Mizar'] = [3.5077838638014485, 0.958628404984348,
5.877380617263158e-07, -1.06708913392451e-07,
0.041730000001590425, 2.5733916214793855e-05]
star['Muhlifein'] = [3.3227502442743475, -0.8545112548127091,
-9.079591681664306e-07, -5.814190122337764e-09,
0.025010000004733652, 0.00012164997237657486]
star['Naos'] = [2.1100341367394244, -0.6981866381710968,
-1.4941939802191323e-07, 8.13033505639689e-08,
0.0023300000002796344, 7.2411876515134e-05]
star['Nunki'] = [4.953529835884698, -0.45896438681501256,
6.724380594918214e-08, -2.5525438690477914e-07,
0.014539999999961669, 0.0005593364499884]
star['Peacock'] = [5.347896386484919, -0.9902141254885577,
3.7379551496239335e-08, -4.1766698066042975e-07,
0.01780000000237717, 8.409157509678797e-05]
star['Phad'] = [3.114671253650366, 0.9371503547781461,
5.224358961370977e-07, 5.410406670048923e-08,
0.03898999999985267, 0.0001250822294595826]
star['Polaris'] = [0.6622870783855511, 1.5579526146588887,
2.143679770371289e-07, -5.6917131328885613e-08,
0.007560000000045417, 3.6765977876544674e-06]
star['Pollux'] = [2.0303268775181493, 0.4891494417418841,
-3.0334244212418148e-06, -2.2280529815649845e-07,
0.09674000007630805, 0.0006388254687689694]
star['Procyon'] = [2.0040830303405817, 0.09119331089376545,
-3.4740014789585755e-06, -5.015794951595126e-06,
0.28593000012325565, 0.0011114621313062132]
star['Rasalhague'] = [4.603020032838227, 0.21921395635258004,
5.336806521497666e-07, -1.0792442623224807e-06,
0.06983999999615671, 0.0006455022142178615]
star['Regor'] = [2.1359886171340388, -0.8261793119496096,
-2.874942507470025e-08, 4.7996558035644583e-08,
0.003880000000037908, 5.919686689624988e-06]
star['Regulus'] = [2.654523170215836, 0.2088671656256774,
-1.2091254273657336e-06, 2.3801755601775115e-08,
0.04209000001772499, 0.0002846563084101535]
star['Rigel'] = [1.3724303735043253, -0.14314563169358496,
9.066015898862096e-09, -2.7149565126160305e-09,
0.004220000000001239, 1.7827829792688708e-07]
star['Sabik'] = [4.495872625690414, -0.2744514560029489,
1.9954884543000435e-07, 4.734206505343233e-07,
0.038770000003338655, 5.7629956315342975e-05]
star['Sadira'] = [0.9290861576667251, -0.16507781574780753,
-4.733913496726316e-06, 8.715281870756593e-08,
0.3107500000516688, 0.0006008398051309498]
star['Sadr'] = [5.33297726230201, 0.7026115986306855,
1.1780971663460847e-08, -4.508767833519213e-09,
0.0021400000000014355, 4.0464265596141945e-07]
star['Saiph'] = [1.5173738959141352, -0.16876644074429167,
7.514612187441671e-09, -5.817764091322442e-09,
0.004519999999999985, 7.092704480158361e-06]
star['Scheat'] = [6.0378533161707075, 0.4901371355826427,
9.102918408944408e-07, 6.671490937534174e-07,
0.01637000001487872, 0.0005700087133755136]
star['Schedar'] = [0.1767448848488985, 0.9867625771254372,
2.4415116079834703e-07, -1.559648010724851e-07,
0.014269999999976789, 0.0003578593352524097]
star['Shaula'] = [4.597235159830863, -0.6475838446748894,
-4.3148500591832e-08, -1.45201689650351e-07,
0.0046400000003139425, 4.1079552278046575e-05]
star['Sirius'] = [1.7677953617808355, -0.2917512845638483,
-2.647213688408054e-06, -5.929642226411401e-06,
0.37920999939568256, 0.001399942073058308]
star['South Star'] = [5.536041071313252, -1.5525837984686774,
1.2585468727789067e-07, 2.4337649316578723e-08,
0.012070000000008256, 4.237909383943523e-07]
star['Spica'] = [3.5133172226917027, -0.19480181898330715,
-2.0604592396526213e-07, -1.5383131043286519e-07,
0.012440000000890464, 4.440134144092039e-05]
star['Suhail'] = [2.391083880584546, -0.758041686556806,
-1.1252512625451906e-07, 6.923144900242576e-08,
0.00569000000016125, 1.7255360405195454e-05]
star['Thuban'] = [3.684345910320117, 1.1235705505483826,
-2.7401752617480493e-07, 8.33392154724013e-08,
0.010560000000291144, 1.7013085343199824e-05]
star['Toliman'] = [3.838179148984009, -1.0617531618986407,
-1.7831061001741384e-05, 2.337210769544031e-06,
0.7421199976972916, 0.0011684490964319319]
star['Tsih'] = [0.2474379539766081, 1.0597070305476959,
1.2435463730083218e-07, -1.851994037328357e-08,
0.005320000000056891, 6.504699275465271e-06]
star['Turais'] = [2.4307649402371365, -1.0345479156330444,
-9.225987077009457e-08, 6.355910632051448e-08,
0.004710000000088263, 1.1379802060468165e-05]
star['Vega'] = [4.873563105816288, 0.6769031238891855,
9.745915701840644e-07, 1.3936413475012163e-06,
0.12893000002352079, 0.00016726661591985996]
star['Wei'] = [4.407675429173172, -0.5985298099221946,
-2.9662794787720593e-06, -1.2404569108020894e-06,
0.04985000009329441, 0.0012954586004889708]
star['Wezen'] = [1.869210136468276, -0.4606482342432647,
-1.3332374360332953e-08, 1.6144296200572525e-08,
0.0018200000000057287, 1.8966479050654466e-06]
return star
| def generate_align_stars():
"""
generateAlignStars is the function where the alignment stars which were
present in the mount computer from hipparcos catalogue are stored. for a
correct calculation we need beside the J2000 coordinated the proper motion in
ra and dec, the parallax and the radial velocity as the stars move over time.
the data is calculated from the hipparcos catalogue using skyfield library
the data is written in
[name, hip no, ra, dec, ra proper motion, dec proper motion, parallax,
radial velocity] based on J2000 epoch. the units are fitting erfa needs:
[str, int, radians, radians, radians / year, radians/year, arc sec, km /s]
"""
star = dict()
star['Achernar'] = [0.42635506995907607, -0.9989698721359219, 4.2673525759820365e-07, -1.943125977115248e-07, 0.02267999999992084, 0.0003167502564713614]
star['Acrux'] = [3.2576512864528886, -1.101286904826098, -1.7147902160979606e-07, -7.141295136130161e-08, 0.010170000000154411, 9.35888419199978e-06]
star['Adhara'] = [1.8265996517525316, -0.505658252449314, 1.2750598440896192e-08, 1.110223390053311e-08, 0.007570000000003465, 2.800807867466727e-07]
star['Albireo'] = [5.1082355548040095, 0.487988493164614, -3.4373281271162636e-08, -2.729501452991444e-08, 0.008460000000023256, 1.6864932050137538e-06]
star['Alcor'] = [3.513455837250785, 0.9597209098682812, 5.834720675264054e-07, -8.21288380803576e-08, 0.04019000000151324, 2.530550909884062e-05]
star['Aldebaran'] = [1.2039308165580604, 0.28814166253131995, 3.0436457894318447e-07, -9.180434074427846e-07, 0.05009000001146675, 0.0001585789211928221]
star['Alderamin'] = [5.57884816439538, 1.092324307334224, 7.267899307112835e-07, 2.3401767388248366e-07, 0.06684000000195339, 2.1353840766936493e-05]
star['Algenib'] = [0.8915260068606703, 0.8702417522558126, 1.168882724683577e-07, -1.2610009740186727e-07, 0.0055100000003035126, 3.352331537061314e-05]
star['Algieba'] = [2.705139847445134, 0.346299303753731, 1.506648421275404e-06, -7.411895001776125e-07, 0.025960000033972072, 0.0008434026928508933]
star['Algol'] = [0.8210415037834745, 0.7148108996219749, 1.158704574925575e-08, -6.981317589803856e-09, 0.035140000000001614, 3.05256816398171e-08]
star['Alhena'] = [1.7353445977036466, 0.28622094379493473, -9.890182560437117e-09, -3.244373156278081e-07, 0.03112000000137838, 2.8977450370070085e-05]
star['Alioth'] = [3.377335599016013, 0.976683127865405, 5.417301952979467e-07, -4.358594163516689e-08, 0.040300000001195005, 1.9935819844802488e-05]
star['Alkaid'] = [3.610829903320896, 0.8606788398861204, -5.877387226590185e-07, -7.543850370132115e-08, 0.032390000001987905, 4.030266398028019e-05]
star['Almach'] = [0.5406116794736521, 0.7387930668804668, 2.0885691266108436e-07, -2.465279469506438e-07, 0.009190000001178217, 7.881471025189807e-05]
star['Alnair'] = [5.795507653347898, -0.819623644322571, 6.186305746827898e-07, -7.170862444881037e-07, 0.032160000009032644, 0.00018431299531260673]
star['Alnilam'] = [1.4670083915012704, -0.02097745833746889, 7.2237238621687114e-09, -5.1390250101810046e-09, 0.002430000000001115, 2.767647528554548e-07]
star['Alnitak'] = [1.4868406913498162, -0.03390428143013612, 1.9344065734811443e-08, 1.2314267611160056e-08, 0.003990000000007422, 1.1271649225724928e-06]
star['Alphard'] = [2.4765671847023185, -0.15112112215068238, -7.024947219927349e-08, 1.6120055539839789e-07, 0.01840000000041811, 1.433254439299072e-05]
star['Alpheratz'] = [0.03659716798611327, 0.5077238156833932, 6.577901367872488e-07, -7.900054984440228e-07, 0.03359999999877105, 0.0015913509611004788]
star['Altair'] = [5.195772123915302, 0.15478142574597795, 2.6025900895845885e-06, 1.8691416330407734e-06, 0.19444000006898107, 0.00044490620582886075]
star['Aludra'] = [1.9377301930466717, -0.5114356387785041, -1.8228988625897067e-08, 3.228859240346924e-08, 0.0010200000000184408, 1.0869774259672181e-05]
star['Ankaa'] = [0.1146829107879592, -0.7383786779763821, 1.1284831383404688e-06, -1.7144895291169717e-06, 0.04213999999412877, 0.0040035348174432]
star['Antares'] = [4.317105473309646, -0.4613254718829243, -4.925711810625137e-08, -1.1252524661051282e-07, 0.0053999999999969775, 0.0008219386508180743]
star['Arcturus'] = [3.733529012714681, 0.3347961767029305, -5.300882113287412e-06, -9.693441003092346e-06, 0.0888500012940421, 0.011467277405555558]
star['Atria'] = [4.401129594008038, -1.2047609033269415, 8.653987296196387e-08, -1.5960064190983694e-07, 0.007850000000369397, 2.8821943319029024e-05]
star['Avior'] = [2.192631681379373, -1.0386364152210767, -1.2285138441820442e-07, 1.1014972611646225e-07, 0.00516000000022552, 2.657294475548769e-05]
star['Becrux'] = [3.34981703178929, -1.0417654518737323, -2.3387455510248137e-07, -6.21529052883799e-08, 0.009250000000247748, 1.646772425062188e-05]
star['Bellatrix'] = [1.4186518374129689, 0.11082321019807921, -4.2421191775724186e-08, -6.438325858295131e-08, 0.013420000000081509, 3.77778985795775e-06]
star['Betelgeuse'] = [1.5497291218333036, 0.12927763286721894, 1.324995949259527e-07, 5.2650746120233373e-08, 0.0076300000002801896, 2.2478299265541744e-05]
star['Birdun'] = [3.577435124514057, -0.9331646108382332, -7.078290116660212e-08, -6.200764883423321e-08, 0.00868000000007837, 5.542656158511533e-06]
star['Canopus'] = [1.6753053550581112, -0.9197127760270881, 9.691399928699686e-08, 1.1475543795563986e-07, 0.01043000000023061, 1.3638797482580787e-05]
star['Capella'] = [1.3818164179749326, 0.8028163852556699, 3.661175465513113e-07, -2.0707852618187437e-06, 0.07729000004925092, 0.0004820766940057257]
star['Caph'] = [0.040025864271171274, 1.0323584023330052, 2.537401264788819e-06, -8.747256573612981e-07, 0.05989000002945251, 0.0003513394160527818]
star['Castor'] = [1.9835582691444889, 0.55655541096058, -1.0003082378134486e-06, -7.18400840114895e-07, 0.06326999999699984, 0.0006603500780342239]
star['Deneb'] = [5.416768549639101, 0.7902909845019924, 7.563094426808563e-09, 7.514611803495459e-09, 0.0010099999999999966, 0.00013325736873785185]
star['Denebola'] = [3.0938569610040525, 0.2543304289930705, -2.419311156063305e-06, -5.516334832548955e-07, 0.09016000006262251, 0.0005494092119495847]
star['Diphda'] = [0.1901946478083879, -0.313925470771022, 1.1285967507789465e-06, 1.5858583005313695e-07, 0.03404000001527349, 0.0002960809516413248]
star['Dschubba'] = [4.1902451316147795, -0.39482332143123317, -4.2033400895683004e-08, -1.7889624233267226e-07, 0.008119999999989573, 0.0008457168978493212]
star['Dubhe'] = [2.8960653511533034, 1.0777588451611648, -6.615730649573739e-07, -1.7089842010161175e-07, 0.02638000000168808, 4.129163182305979e-05]
star['Durre Menthor'] = [0.45408540819664434, -0.2781614838923893, -8.347446041643784e-06, 4.140809252755996e-06, 0.2741700003075673, 0.0025467724108209243]
star['Elnath'] = [1.4237168137688543, 0.49929418963649913, 1.1286371385556528e-07, -8.446424361125599e-07, 0.02488999999931021, 0.0021102759572637353]
star['Enif'] = [5.690584783936927, 0.1723514602597197, 1.4554107003664866e-07, 6.690397468497408e-09, 0.004850000000290319, 3.6364339479757246e-05]
star['Etamin'] = [4.69758079842709, 0.8986507452358823, -4.13060240615731e-08, -1.1174956075521153e-07, 0.022099999999988868, 4.802365092647439e-05]
star['Fomalhaut'] = [6.011133398285404, -0.5170055560865453, 1.596116251175188e-06, -7.961514442642038e-07, 0.13008000002377812, 0.00016839652699463895]
star['Foramen'] = [4.975479708318686, -0.9602030279549373, 8.193332974001665e-09, 8.896331075961123e-08, 0.004790000000111848, 1.4182818294769256e-05]
star['Gacrux'] = [3.277578934434846, -0.9968135958390298, 1.3546164292018533e-07, -1.2815079298710082e-06, 0.03709000002118096, 0.00038026031212998385]
star['Gemma'] = [4.078344297757775, 0.4662593500177362, 5.836164784602716e-07, -4.3361855305783936e-07, 0.04364999999923094, 0.0004749733026092676]
star['Gienah'] = [5.437619832660372, 0.5928928235555605, 1.7267450215552336e-06, 1.6012305300227907e-06, 0.04526000005787727, 0.0008727564774680463]
star['Girtab'] = [4.613423671040447, -0.750453597552295, 2.9379711284354737e-08, -4.605726201560463e-09, 0.011990000000006672, 3.447754303400006e-07]
star['Gruid'] = [5.9457560075832445, -0.8182902354262535, 6.57795471464524e-07, -2.186320714946966e-08, 0.01917000000274361, 9.046731034516553e-05]
star['Hadar'] = [3.681875666769781, -1.0537083159099074, -1.6464334143778704e-07, -1.2149420614057753e-07, 0.006209999999994911, 0.0009137322626429944]
star['Hamal'] = [0.5548981381429913, 0.40949653104300493, 9.246801678210333e-07, -7.067156367318856e-07, 0.04948000001509084, 0.00021087217637601825]
star['Herschel Star'] = [5.6876250069680605, 1.0259053385102446, 2.5404226643504052e-08, -1.3962636520298012e-08, 0.0006200000000052498, 5.085416049876108e-06]
star['Izar'] = [3.8614843432159414, 0.4725343244285851, -2.4555834257143246e-07, 9.696252229133127e-08, 0.015550000000782651, 3.1492226299260285e-05]
star['Kaus Australis'] = [4.81785946005412, -0.6001247657331712, -1.920360828391738e-07, -6.014112209360647e-07, 0.02255000000518801, 0.00014683170217628355]
star['Kochab'] = [3.88643929589975, 1.2942577193687248, -1.5654689526730107e-07, 5.7741253070346283e-08, 0.02579000000006858, 1.7129342004436014e-06]
star['Koo She'] = [2.289451216840046, -0.9548490600305676, 1.3953112000316027e-07, -5.048848871271923e-07, 0.040900000003322244, 5.470925163339363e-05]
star['Marchab'] = [6.042159155901372, 0.265381926804241, 2.962208678925014e-07, -2.0633689681602876e-07, 0.023359999999888748, 0.0004087188162900425]
star['Marfikent'] = [3.8201207423147325, -0.7357928431030926, -1.7118813759578646e-07, -1.5727343050882903e-07, 0.01057000000056649, 3.307245114865675e-05]
star['Markab'] = [2.4526837794332965, -0.9601172799234833, -5.197195577037533e-08, 5.4493068865207765e-08, 0.0060500000000541804, 5.458012450383491e-06]
star['Megrez'] = [3.208897607188377, 0.9954069461371868, 5.020735613243368e-07, 3.786294101930466e-08, 0.040050000000969345, 1.6259857547990848e-05]
star['Men'] = [3.8481427681460767, -0.8270801195052182, -1.0253832271040569e-07, -1.1742182770277311e-07, 0.0059500000002614, 2.6768924741820013e-05]
star['Menkalinan'] = [1.5687409473992977, 0.7844806923295367, -2.734833771211616e-07, -4.2666877732678e-09, 0.03972000000047807, 8.077866841049545e-06]
star['Menkent'] = [3.694354541960444, -0.6347754647829705, -2.517670402545959e-06, -2.5106780511175216e-06, 0.05351999997864442, 0.007462351002327535]
star['Merak'] = [2.8878245742140867, 0.9840589883938196, 3.9590055731762915e-07, 1.6357550334360702e-07, 0.041069999999882284, 8.630312273508286e-05]
star['Miaplacidus'] = [2.413801174909946, -1.2167948180623211, -7.643381275655257e-07, 5.280122417775545e-07, 0.029339999999607635, 0.0007482912564705958]
star['Mintaka'] = [1.448652420586415, -0.00522014083349973, 8.09638847252015e-09, 2.7149566172089492e-09, 0.0035600000000010315, 1.7533466749502158e-07]
star['Mira'] = [0.6080140011354599, -0.05196967262254898, 5.008130002773315e-08, -1.1610316590840949e-06, 0.007789999999596873, 0.036970271155935756]
star['Mirach'] = [0.30426179810445714, 0.6216960108990267, 8.512785321533603e-07, -5.441093978100774e-07, 0.016360000010577143, 0.00040545055744113315]
star['Mirzam'] = [1.6698426991230342, -0.31338988448214705, -1.6726072214528015e-08, -2.2786235829647604e-09, 0.006530000000003624, 3.3867852993203564e-07]
star['Mizar'] = [3.5077838638014485, 0.958628404984348, 5.877380617263158e-07, -1.06708913392451e-07, 0.041730000001590425, 2.5733916214793855e-05]
star['Muhlifein'] = [3.3227502442743475, -0.8545112548127091, -9.079591681664306e-07, -5.814190122337764e-09, 0.025010000004733652, 0.00012164997237657486]
star['Naos'] = [2.1100341367394244, -0.6981866381710968, -1.4941939802191323e-07, 8.13033505639689e-08, 0.0023300000002796344, 7.2411876515134e-05]
star['Nunki'] = [4.953529835884698, -0.45896438681501256, 6.724380594918214e-08, -2.5525438690477914e-07, 0.014539999999961669, 0.0005593364499884]
star['Peacock'] = [5.347896386484919, -0.9902141254885577, 3.7379551496239335e-08, -4.1766698066042975e-07, 0.01780000000237717, 8.409157509678797e-05]
star['Phad'] = [3.114671253650366, 0.9371503547781461, 5.224358961370977e-07, 5.410406670048923e-08, 0.03898999999985267, 0.0001250822294595826]
star['Polaris'] = [0.6622870783855511, 1.5579526146588887, 2.143679770371289e-07, -5.6917131328885613e-08, 0.007560000000045417, 3.6765977876544674e-06]
star['Pollux'] = [2.0303268775181493, 0.4891494417418841, -3.0334244212418148e-06, -2.2280529815649845e-07, 0.09674000007630805, 0.0006388254687689694]
star['Procyon'] = [2.0040830303405817, 0.09119331089376545, -3.4740014789585755e-06, -5.015794951595126e-06, 0.28593000012325565, 0.0011114621313062132]
star['Rasalhague'] = [4.603020032838227, 0.21921395635258004, 5.336806521497666e-07, -1.0792442623224807e-06, 0.06983999999615671, 0.0006455022142178615]
star['Regor'] = [2.1359886171340388, -0.8261793119496096, -2.874942507470025e-08, 4.7996558035644583e-08, 0.003880000000037908, 5.919686689624988e-06]
star['Regulus'] = [2.654523170215836, 0.2088671656256774, -1.2091254273657336e-06, 2.3801755601775115e-08, 0.04209000001772499, 0.0002846563084101535]
star['Rigel'] = [1.3724303735043253, -0.14314563169358496, 9.066015898862096e-09, -2.7149565126160305e-09, 0.004220000000001239, 1.7827829792688708e-07]
star['Sabik'] = [4.495872625690414, -0.2744514560029489, 1.9954884543000435e-07, 4.734206505343233e-07, 0.038770000003338655, 5.7629956315342975e-05]
star['Sadira'] = [0.9290861576667251, -0.16507781574780753, -4.733913496726316e-06, 8.715281870756593e-08, 0.3107500000516688, 0.0006008398051309498]
star['Sadr'] = [5.33297726230201, 0.7026115986306855, 1.1780971663460847e-08, -4.508767833519213e-09, 0.0021400000000014355, 4.0464265596141945e-07]
star['Saiph'] = [1.5173738959141352, -0.16876644074429167, 7.514612187441671e-09, -5.817764091322442e-09, 0.004519999999999985, 7.092704480158361e-06]
star['Scheat'] = [6.0378533161707075, 0.4901371355826427, 9.102918408944408e-07, 6.671490937534174e-07, 0.01637000001487872, 0.0005700087133755136]
star['Schedar'] = [0.1767448848488985, 0.9867625771254372, 2.4415116079834703e-07, -1.559648010724851e-07, 0.014269999999976789, 0.0003578593352524097]
star['Shaula'] = [4.597235159830863, -0.6475838446748894, -4.3148500591832e-08, -1.45201689650351e-07, 0.0046400000003139425, 4.1079552278046575e-05]
star['Sirius'] = [1.7677953617808355, -0.2917512845638483, -2.647213688408054e-06, -5.929642226411401e-06, 0.37920999939568256, 0.001399942073058308]
star['South Star'] = [5.536041071313252, -1.5525837984686774, 1.2585468727789067e-07, 2.4337649316578723e-08, 0.012070000000008256, 4.237909383943523e-07]
star['Spica'] = [3.5133172226917027, -0.19480181898330715, -2.0604592396526213e-07, -1.5383131043286519e-07, 0.012440000000890464, 4.440134144092039e-05]
star['Suhail'] = [2.391083880584546, -0.758041686556806, -1.1252512625451906e-07, 6.923144900242576e-08, 0.00569000000016125, 1.7255360405195454e-05]
star['Thuban'] = [3.684345910320117, 1.1235705505483826, -2.7401752617480493e-07, 8.33392154724013e-08, 0.010560000000291144, 1.7013085343199824e-05]
star['Toliman'] = [3.838179148984009, -1.0617531618986407, -1.7831061001741384e-05, 2.337210769544031e-06, 0.7421199976972916, 0.0011684490964319319]
star['Tsih'] = [0.2474379539766081, 1.0597070305476959, 1.2435463730083218e-07, -1.851994037328357e-08, 0.005320000000056891, 6.504699275465271e-06]
star['Turais'] = [2.4307649402371365, -1.0345479156330444, -9.225987077009457e-08, 6.355910632051448e-08, 0.004710000000088263, 1.1379802060468165e-05]
star['Vega'] = [4.873563105816288, 0.6769031238891855, 9.745915701840644e-07, 1.3936413475012163e-06, 0.12893000002352079, 0.00016726661591985996]
star['Wei'] = [4.407675429173172, -0.5985298099221946, -2.9662794787720593e-06, -1.2404569108020894e-06, 0.04985000009329441, 0.0012954586004889708]
star['Wezen'] = [1.869210136468276, -0.4606482342432647, -1.3332374360332953e-08, 1.6144296200572525e-08, 0.0018200000000057287, 1.8966479050654466e-06]
return star |
def fun1(str1):
fun1(str1)
print("This is " + str1)
fun1("Issue")
| def fun1(str1):
fun1(str1)
print('This is ' + str1)
fun1('Issue') |
class DatabaseConnectionInterface(object):
"""Abstract class for DatabaseConnection."""
def GetPoints(self, visit_location):
"""For given visit_location return initial set of points."""
raise NotImplemented()
def GetPoint(self, visit_location, point_name):
"""For given visit_location and Point name return a point."""
raise NotImplemented()
| class Databaseconnectioninterface(object):
"""Abstract class for DatabaseConnection."""
def get_points(self, visit_location):
"""For given visit_location return initial set of points."""
raise not_implemented()
def get_point(self, visit_location, point_name):
"""For given visit_location and Point name return a point."""
raise not_implemented() |
# URI Online Judge 1149
Entrada = input()
Entrada = list(map(int, Entrada.split()))
A = Entrada[0]
A_copy = A
sum = 0
for i in Entrada[1:]:
if i > 0:
N = i
for j in range(0,N):
sum += A_copy + j
print(sum) | entrada = input()
entrada = list(map(int, Entrada.split()))
a = Entrada[0]
a_copy = A
sum = 0
for i in Entrada[1:]:
if i > 0:
n = i
for j in range(0, N):
sum += A_copy + j
print(sum) |
# Copyright 2021 Google LLC
#
# 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.
def correct_answers(answers):
answers['NY'] = 'Correct!' if answers['NY'].lower() == 'albany' else 'Incorrect.'
answers['CA'] = 'Correct!' if answers['CA'].lower() == 'sacramento' else 'Incorrect.'
answers['TX'] = 'Correct!' if answers['TX'].lower() == 'austin' else 'Incorrect.'
answers['FL'] = 'Correct!' if answers['FL'].lower() == 'tallahassee' else 'Incorrect.'
answers['CO'] = 'Correct!' if answers['CO'].lower() == 'denver' else 'Incorrect.'
return answers
def grade_answers(answers):
num_correct_ans = 0
if answers['NY'].lower() == 'albany': num_correct_ans += 1
if answers['CA'].lower() == 'sacramento': num_correct_ans += 1
if answers['TX'].lower() == 'austin': num_correct_ans += 1
if answers['FL'].lower() == 'tallahasee': num_correct_ans += 1
if answers['CO'].lower() == 'denver': num_correct_ans += 1
return (int)(num_correct_ans / 0.05) | def correct_answers(answers):
answers['NY'] = 'Correct!' if answers['NY'].lower() == 'albany' else 'Incorrect.'
answers['CA'] = 'Correct!' if answers['CA'].lower() == 'sacramento' else 'Incorrect.'
answers['TX'] = 'Correct!' if answers['TX'].lower() == 'austin' else 'Incorrect.'
answers['FL'] = 'Correct!' if answers['FL'].lower() == 'tallahassee' else 'Incorrect.'
answers['CO'] = 'Correct!' if answers['CO'].lower() == 'denver' else 'Incorrect.'
return answers
def grade_answers(answers):
num_correct_ans = 0
if answers['NY'].lower() == 'albany':
num_correct_ans += 1
if answers['CA'].lower() == 'sacramento':
num_correct_ans += 1
if answers['TX'].lower() == 'austin':
num_correct_ans += 1
if answers['FL'].lower() == 'tallahasee':
num_correct_ans += 1
if answers['CO'].lower() == 'denver':
num_correct_ans += 1
return int(num_correct_ans / 0.05) |
# http://python.coderz.ir/
list=[1,2,3,4,5]
list.append(6)
print(list)
tuple=(1,2,3)
dic={'key1':'A','key2':'B'}
print(dic['key1'])
class Human():
print("human class")
def walking(self):
print("human is walking")
class contact(Human):
print("contact is creating")
def __init__(self,name,family,address):
self.name=name
self.family=family
self.address=address
def __str__(self):
return self.name+" / "+self.family+" / "+self.address
contact1=contact(name="omid", family="hamidi", address="ahvaz")
contact1.walking()
print(contact1)
| list = [1, 2, 3, 4, 5]
list.append(6)
print(list)
tuple = (1, 2, 3)
dic = {'key1': 'A', 'key2': 'B'}
print(dic['key1'])
class Human:
print('human class')
def walking(self):
print('human is walking')
class Contact(Human):
print('contact is creating')
def __init__(self, name, family, address):
self.name = name
self.family = family
self.address = address
def __str__(self):
return self.name + ' / ' + self.family + ' / ' + self.address
contact1 = contact(name='omid', family='hamidi', address='ahvaz')
contact1.walking()
print(contact1) |
DEFAULT_METADATA_TABLE = 'data'
DEFAULT_USER_TABLE = 'user'
DEFAULT_NAME_COLUMN = 'dataset'
DEFAULT_UPDATE_COLUMN = 'updated_at'
DEFAULT_RESTRICTED_TABLES = [DEFAULT_METADATA_TABLE, DEFAULT_USER_TABLE]
DEFAULT_METADATA_COLUMNS = [
dict(name='id', type_='Integer', primary_key=True),
dict(name='dataset', type_='String', unique=True),
('title', 'String'),
('description', 'String'),
('tags', 'String'),
('source', 'String'),
('created_by', 'String'),
('created_at', 'DateTime'),
('updated_at', 'DateTime')
]
DEFAULT_DATA_ROUTE_SETTINGS = dict(
columns=dict(
path='/{dataset}/columns',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
create=dict(
path='/',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={'superuser': True}
),
delete=dict(
path='/{dataset}',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={'superuser': True}
),
id=dict(
path='/{dataset}/id/{id}',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
insert=dict(
path='/{dataset}/insert',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={'superuser': True}
),
metadata=dict(
path='/{dataset}/metadata',
tags=['metadata'],
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
metadata_update=dict(
path='/{dataset}/metadata',
tags=['metadata'],
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={'superuser': True}
),
query=dict(
path='/{dataset}',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
rows=dict(
path='/{dataset}/rows',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
search=dict(
path='/',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={}
),
update=dict(
path='/{dataset}',
_restricted_tables=DEFAULT_RESTRICTED_TABLES,
_enable=True,
_get_user={'superuser': True}
)
) | default_metadata_table = 'data'
default_user_table = 'user'
default_name_column = 'dataset'
default_update_column = 'updated_at'
default_restricted_tables = [DEFAULT_METADATA_TABLE, DEFAULT_USER_TABLE]
default_metadata_columns = [dict(name='id', type_='Integer', primary_key=True), dict(name='dataset', type_='String', unique=True), ('title', 'String'), ('description', 'String'), ('tags', 'String'), ('source', 'String'), ('created_by', 'String'), ('created_at', 'DateTime'), ('updated_at', 'DateTime')]
default_data_route_settings = dict(columns=dict(path='/{dataset}/columns', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), create=dict(path='/', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={'superuser': True}), delete=dict(path='/{dataset}', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={'superuser': True}), id=dict(path='/{dataset}/id/{id}', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), insert=dict(path='/{dataset}/insert', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={'superuser': True}), metadata=dict(path='/{dataset}/metadata', tags=['metadata'], _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), metadata_update=dict(path='/{dataset}/metadata', tags=['metadata'], _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={'superuser': True}), query=dict(path='/{dataset}', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), rows=dict(path='/{dataset}/rows', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), search=dict(path='/', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={}), update=dict(path='/{dataset}', _restricted_tables=DEFAULT_RESTRICTED_TABLES, _enable=True, _get_user={'superuser': True})) |
#!/usr/bin/env python
# coding: utf-8
# This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# # Solution Notebook
# ## Problem: Implement common bit manipulation operations: get_bit, set_bit, clear_bit, clear_bits_msb_to_index, clear_bits_msb_to_lsb, update_bit.
#
# * [Constraints](#Constraints)
# * [Test Cases](#Test-Cases)
# * [Algorithm](#Algorithm)
# * [Code](#Code)
# * [Unit Test](#Unit-Test)
# ## Constraints
#
# * Can we assume the inputs are valid?
# * No
# * Can we assume this fits memory?
# * Yes
# ## Test Cases
#
# * None as a number input -> Exception
# * Negative index -> Exception
#
# ### get_bit
# number = 0b10001110, index = 3
# expected = True
# ### set_bit
# number = 0b10001110, index = 4
# expected = 0b10011110
# ### clear_bit
# number = 0b10001110, index = 3
# expected = 0b10000110
# ### clear_bits_msb_to_index
# number = 0b10001110, index = 3
# expected = 0b00000110
# ### clear_bits_index_to_lsb
# number = 0b10001110, index = 3
# expected = 0b10000000
# ### update_bit
# number = 0b10001110, index = 3, value = 1
# expected = 0b10001110
# number = 0b10001110, index = 3, value = 0
# expected = 0b10000110
# number = 0b10001110, index = 0, value = 1
# expected = 0b10001111
# ## Algorithm
#
# ### get_bit
#
# <pre>
# indices 7 6 5 4 3 2 1 0 index = 3
# --------------------------------------------------
# input 1 0 0 0 1 1 1 0 0b10001110
# mask 0 0 0 0 1 0 0 0 1 << index
# --------------------------------------------------
# result 0 0 0 0 1 0 0 0 number & mask != 0
# </pre>
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
# ### set_bit
#
# <pre>
# indices 7 6 5 4 3 2 1 0 index = 4
# --------------------------------------------------
# input 1 0 0 0 1 1 1 0 0b10001110
# mask 0 0 0 1 0 0 0 0 1 << index
# --------------------------------------------------
# result 1 0 0 1 1 1 1 0 number | mask
# </pre>
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
# ### clear_bit
#
# <pre>
# indices 7 6 5 4 3 2 1 0 index = 3
# --------------------------------------------------
# input 1 0 0 0 1 1 1 0 0b10001110
# mask 0 0 0 0 1 0 0 0 1 << index
# mask 1 1 1 1 0 1 1 1 ~(1 << index)
# --------------------------------------------------
# result 1 0 0 0 0 1 1 0 number & mask
# </pre>
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
# ### clear_bits_msb_to_index
#
# <pre>
# indices 7 6 5 4 3 2 1 0 index = 3
# --------------------------------------------------
# input 1 0 0 0 1 1 1 0 0b10001110
# mask 0 0 0 0 1 0 0 0 1 << index
# mask 0 0 0 0 0 1 1 1 (1 << index) - 1
# --------------------------------------------------
# result 0 0 0 0 0 1 1 1 number & mask
# </pre>
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
# ### clear_bits_index_to_lsb
#
# <pre>
# indices 7 6 5 4 3 2 1 0 index = 3
# --------------------------------------------------
# input 1 0 0 0 1 1 1 0 0b10001110
# mask 0 0 0 1 0 0 0 0 1 << index + 1
# mask 0 0 0 0 1 1 1 1 (1 << index + 1) - 1
# mask 1 1 1 1 0 0 0 0 ~((1 << index + 1) - 1)
# --------------------------------------------------
# result 1 0 0 0 0 0 0 0 number & mask
# </pre>
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
# ### update_bit
#
# * Use `get_bit` to see if the value is already set or cleared
# * If not, use `set_bit` if setting the value or `clear_bit` if clearing the value
#
# Complexity:
# * Time: O(n)
# * Space: O(n)
#
#
#
# ## Code
# In[1]:
def validate_index(func):
def validate_index_wrapper(self, *args, **kwargs):
for arg in args:
if arg < 0:
raise IndexError('Invalid index')
return func(self, *args, **kwargs)
return validate_index_wrapper
# In[2]:
class Bit(object):
def __init__(self, number):
if number is None:
raise TypeError('number cannot be None')
self.number = number
@validate_index
def get_bit(self, index):
mask = 1 << index
return self.number & mask != 0
@validate_index
def set_bit(self, index):
mask = 1 << index
self.number |= mask
return self.number
@validate_index
def clear_bit(self, index):
mask = ~(1 << index)
self.number &= mask
return self.number
@validate_index
def clear_bits_msb_to_index(self, index):
mask = (1 << index) - 1
self.number &= mask
return self.number
@validate_index
def clear_bits_index_to_lsb(self, index):
mask = ~((1 << index + 1) - 1)
self.number &= mask
return self.number
@validate_index
def update_bit(self, index, value):
if value is None or value not in (0, 1):
raise Exception('Invalid value')
if self.get_bit(index) == value:
return self.number
if value:
self.set_bit(index)
else:
self.clear_bit(index)
return self.number
# ## Unit Test
# In[3]:
get_ipython().run_cell_magic('writefile', 'test_bit.py', "import unittest\n\n\nclass TestBit(unittest.TestCase):\n\n def test_bit(self):\n number = int('10001110', base=2)\n bit = Bit(number)\n self.assertEqual(bit.get_bit(index=3), True)\n expected = int('10011110', base=2)\n self.assertEqual(bit.set_bit(index=4), expected)\n bit = Bit(number)\n expected = int('10000110', base=2)\n self.assertEqual(bit.clear_bit(index=3), expected)\n bit = Bit(number)\n expected = int('00000110', base=2)\n self.assertEqual(bit.clear_bits_msb_to_index(index=3), expected)\n bit = Bit(number)\n expected = int('10000000', base=2)\n self.assertEqual(bit.clear_bits_index_to_lsb(index=3), expected)\n bit = Bit(number)\n self.assertEqual(bit.update_bit(index=3, value=1), number)\n bit = Bit(number)\n expected = int('10000110', base=2)\n self.assertEqual(bit.update_bit(index=3, value=0), expected)\n bit = Bit(number)\n expected = int('10001111', base=2)\n self.assertEqual(bit.update_bit(index=0, value=1), expected)\n print('Success: test_bit')\n\n\ndef main():\n test = TestBit()\n test.test_bit()\n\n\nif __name__ == '__main__':\n main()")
# In[4]:
get_ipython().run_line_magic('run', '-i test_bit.py')
| def validate_index(func):
def validate_index_wrapper(self, *args, **kwargs):
for arg in args:
if arg < 0:
raise index_error('Invalid index')
return func(self, *args, **kwargs)
return validate_index_wrapper
class Bit(object):
def __init__(self, number):
if number is None:
raise type_error('number cannot be None')
self.number = number
@validate_index
def get_bit(self, index):
mask = 1 << index
return self.number & mask != 0
@validate_index
def set_bit(self, index):
mask = 1 << index
self.number |= mask
return self.number
@validate_index
def clear_bit(self, index):
mask = ~(1 << index)
self.number &= mask
return self.number
@validate_index
def clear_bits_msb_to_index(self, index):
mask = (1 << index) - 1
self.number &= mask
return self.number
@validate_index
def clear_bits_index_to_lsb(self, index):
mask = ~((1 << index + 1) - 1)
self.number &= mask
return self.number
@validate_index
def update_bit(self, index, value):
if value is None or value not in (0, 1):
raise exception('Invalid value')
if self.get_bit(index) == value:
return self.number
if value:
self.set_bit(index)
else:
self.clear_bit(index)
return self.number
get_ipython().run_cell_magic('writefile', 'test_bit.py', "import unittest\n\n\nclass TestBit(unittest.TestCase):\n\n def test_bit(self):\n number = int('10001110', base=2)\n bit = Bit(number)\n self.assertEqual(bit.get_bit(index=3), True)\n expected = int('10011110', base=2)\n self.assertEqual(bit.set_bit(index=4), expected)\n bit = Bit(number)\n expected = int('10000110', base=2)\n self.assertEqual(bit.clear_bit(index=3), expected)\n bit = Bit(number)\n expected = int('00000110', base=2)\n self.assertEqual(bit.clear_bits_msb_to_index(index=3), expected)\n bit = Bit(number)\n expected = int('10000000', base=2)\n self.assertEqual(bit.clear_bits_index_to_lsb(index=3), expected)\n bit = Bit(number)\n self.assertEqual(bit.update_bit(index=3, value=1), number)\n bit = Bit(number)\n expected = int('10000110', base=2)\n self.assertEqual(bit.update_bit(index=3, value=0), expected)\n bit = Bit(number)\n expected = int('10001111', base=2)\n self.assertEqual(bit.update_bit(index=0, value=1), expected)\n print('Success: test_bit')\n\n\ndef main():\n test = TestBit()\n test.test_bit()\n\n\nif __name__ == '__main__':\n main()")
get_ipython().run_line_magic('run', '-i test_bit.py') |
def lz78(charstream, verbose=False):
dict = {}
p = ""
code = []
i = 0
while True:
c = charstream[i]
try:
dict[p + c]
p = p + c
except (KeyError):
if p == "":
o = 0
else:
o = dict[p]
code.append((o, c))
dict[p + c] = len(dict) + 1
p = ""
i += 1
if i < len(charstream):
continue
else:
if p != "":
code.append((dict[p], "EOF"))
break
output = ""
for block in code:
for part in block:
output += str(part)
print(output)
print(code)
lz78('Lorem ipsum dolor sit amet consectetur adipiscing elit proin ac lectus laoreet bibendum diam sit amet ullamcorper purus fusce sodales') | def lz78(charstream, verbose=False):
dict = {}
p = ''
code = []
i = 0
while True:
c = charstream[i]
try:
dict[p + c]
p = p + c
except KeyError:
if p == '':
o = 0
else:
o = dict[p]
code.append((o, c))
dict[p + c] = len(dict) + 1
p = ''
i += 1
if i < len(charstream):
continue
else:
if p != '':
code.append((dict[p], 'EOF'))
break
output = ''
for block in code:
for part in block:
output += str(part)
print(output)
print(code)
lz78('Lorem ipsum dolor sit amet consectetur adipiscing elit proin ac lectus laoreet bibendum diam sit amet ullamcorper purus fusce sodales') |
for number in range(1001):
string=list(str(number))
sum_of_each_digit=0
for j in range(len(string)):
int_number=int(string[j])
power_of_digit = int_number ** len(string)
sum_of_each_digit += power_of_digit
if number == sum_of_each_digit:
print (number, "Is amstrong Number")
| for number in range(1001):
string = list(str(number))
sum_of_each_digit = 0
for j in range(len(string)):
int_number = int(string[j])
power_of_digit = int_number ** len(string)
sum_of_each_digit += power_of_digit
if number == sum_of_each_digit:
print(number, 'Is amstrong Number') |
spells = {
'levitate': 'Levioso',
'make fire': 'Incendio',
'open locked door': 'Alohomora'
}
# dictionary operators
print(spells['open locked door'])
print(spells['levitate'])
print(spells.keys())
print(dir(spells))
| spells = {'levitate': 'Levioso', 'make fire': 'Incendio', 'open locked door': 'Alohomora'}
print(spells['open locked door'])
print(spells['levitate'])
print(spells.keys())
print(dir(spells)) |
class Cleaning():
def __init__(self, df):
self.df = df
pass
def drop_null_cols(self, percent):
"""
A funciton to drop a column if a certain percent of its values
are null
"""
if percent > 1:
percent = percent/100
a = self.df
for col in a.columns:
total_nans = a[col].isna().sum()
size = a.shape[1]
if (total_nans/size) >= percent:
a.drop(col)
print(f"column {col} will be dropped")
else:
print(f"column {col} will not be dropped")
def to_null(self, column, value=[0]):
"""
Replace all values in a column with np.nan. Useful when values like 0
might actually be nan values.
The parameter column would have to be a string.
"""
if type(value) != list:
value = [value]
a = self.df
a[column] = a[column].replace(value, np.nan)
return a
| class Cleaning:
def __init__(self, df):
self.df = df
pass
def drop_null_cols(self, percent):
"""
A funciton to drop a column if a certain percent of its values
are null
"""
if percent > 1:
percent = percent / 100
a = self.df
for col in a.columns:
total_nans = a[col].isna().sum()
size = a.shape[1]
if total_nans / size >= percent:
a.drop(col)
print(f'column {col} will be dropped')
else:
print(f'column {col} will not be dropped')
def to_null(self, column, value=[0]):
"""
Replace all values in a column with np.nan. Useful when values like 0
might actually be nan values.
The parameter column would have to be a string.
"""
if type(value) != list:
value = [value]
a = self.df
a[column] = a[column].replace(value, np.nan)
return a |
def insertion_sort(array):
for i in range(1, len(array)):
currentValue = array[i]
currentPosition = i
while currentPosition > 0 and array[currentPosition - 1] > currentValue:
array[currentPosition] = array[currentPosition -1]
currentPosition -= 1
array[currentPosition] = currentValue
return array
# Recursive | def insertion_sort(array):
for i in range(1, len(array)):
current_value = array[i]
current_position = i
while currentPosition > 0 and array[currentPosition - 1] > currentValue:
array[currentPosition] = array[currentPosition - 1]
current_position -= 1
array[currentPosition] = currentValue
return array |
class EbWrapper:
def set_eb_raw_json_data(self, eb_raw_json_data: dict):
if not type(eb_raw_json_data).__name__ == 'dict':
raise TypeError('The entered data must be of type dict')
self.eb_raw_json_data = eb_raw_json_data
return self
def get_environment_name(self):
return self.eb_raw_json_data['EnvironmentName']
def get_application_name(self):
return self.eb_raw_json_data['ApplicationName']
def get_environment_url(self):
return self.eb_raw_json_data['CNAME']
def get_environment_id(self):
return self.eb_raw_json_data['EnvironmentId']
def get_status(self):
return self.eb_raw_json_data['Status']
| class Ebwrapper:
def set_eb_raw_json_data(self, eb_raw_json_data: dict):
if not type(eb_raw_json_data).__name__ == 'dict':
raise type_error('The entered data must be of type dict')
self.eb_raw_json_data = eb_raw_json_data
return self
def get_environment_name(self):
return self.eb_raw_json_data['EnvironmentName']
def get_application_name(self):
return self.eb_raw_json_data['ApplicationName']
def get_environment_url(self):
return self.eb_raw_json_data['CNAME']
def get_environment_id(self):
return self.eb_raw_json_data['EnvironmentId']
def get_status(self):
return self.eb_raw_json_data['Status'] |
name = data.get('name', 'world')
logger.info("Hello Robin {}".format(name))
hass.bus.fire(name, { "wow": "from a Python script!" })
state = hass.states.get('sensor.next_train_status')
train_status = state.state
if train_status == 'ON TIME':
hass.services.call('light', 'turn_on', { "entity_id" : 'light.lamp', 'color_name': 'green' })
else:
hass.services.call('light', 'turn_on', { "entity_id" : 'light.lamp', 'color_name': 'red' })
| name = data.get('name', 'world')
logger.info('Hello Robin {}'.format(name))
hass.bus.fire(name, {'wow': 'from a Python script!'})
state = hass.states.get('sensor.next_train_status')
train_status = state.state
if train_status == 'ON TIME':
hass.services.call('light', 'turn_on', {'entity_id': 'light.lamp', 'color_name': 'green'})
else:
hass.services.call('light', 'turn_on', {'entity_id': 'light.lamp', 'color_name': 'red'}) |
inputString = str(input())
tool = len(inputString)
count_3 = inputString.count('3')
count_2 = inputString.count('2')
count_1 = inputString.count('1')
regularWordage = '1' * count_1 + '2' * count_2 + '3' * count_3
for i in range(0,tool-1) :
if i%2 == 0:
pass
else:
regularWordage = regularWordage[: i] + '+' + regularWordage[i :]
print(regularWordage) | input_string = str(input())
tool = len(inputString)
count_3 = inputString.count('3')
count_2 = inputString.count('2')
count_1 = inputString.count('1')
regular_wordage = '1' * count_1 + '2' * count_2 + '3' * count_3
for i in range(0, tool - 1):
if i % 2 == 0:
pass
else:
regular_wordage = regularWordage[:i] + '+' + regularWordage[i:]
print(regularWordage) |
oddcompnumlist = []
for i in range(2,10000):
if i%2!=0:
if 2**(i-1)%i!=1:
oddcompnumlist.append(i)
primlist = []
randlist = []
complist = []
for j in range(2,142):
boolist = []
for k in range(2,j):
if j%k != 0:
boolist.append('false')
elif j%k == 0:
boolist.append('true')
break
if 'true' in boolist:
randlist.append(j)
else:
primlist.append(j)
randlist.append(j)
for m in primlist:
complist.extend(range(2*m,10000,m))
complist.append(m**2)
complist = list(set(complist))
complist.sort()
primrange = range(2,10000)
for s in complist:
try:
primrange.remove(s)
except:
pass
squareslist = []
for i in range(1,600):
squareslist.append(2*(i**2))
goldbacknl = []
for w in primrange:
for a in squareslist:
goldbacknl.append(a+w)
goldbacknl = list(set(goldbacknl))
ansnum = None
for q in oddcompnumlist:
if q not in goldbacknl:
ansnum = q
break
print(ansnum)
| oddcompnumlist = []
for i in range(2, 10000):
if i % 2 != 0:
if 2 ** (i - 1) % i != 1:
oddcompnumlist.append(i)
primlist = []
randlist = []
complist = []
for j in range(2, 142):
boolist = []
for k in range(2, j):
if j % k != 0:
boolist.append('false')
elif j % k == 0:
boolist.append('true')
break
if 'true' in boolist:
randlist.append(j)
else:
primlist.append(j)
randlist.append(j)
for m in primlist:
complist.extend(range(2 * m, 10000, m))
complist.append(m ** 2)
complist = list(set(complist))
complist.sort()
primrange = range(2, 10000)
for s in complist:
try:
primrange.remove(s)
except:
pass
squareslist = []
for i in range(1, 600):
squareslist.append(2 * i ** 2)
goldbacknl = []
for w in primrange:
for a in squareslist:
goldbacknl.append(a + w)
goldbacknl = list(set(goldbacknl))
ansnum = None
for q in oddcompnumlist:
if q not in goldbacknl:
ansnum = q
break
print(ansnum) |
#
# PySNMP MIB module VERILINK-ENTERPRISE-NCMJAPISDN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VERILINK-ENTERPRISE-NCMJAPISDN-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:26:55 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, TimeTicks, NotificationType, Gauge32, ModuleIdentity, IpAddress, Counter64, MibIdentifier, Counter32, ObjectIdentity, Integer32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "TimeTicks", "NotificationType", "Gauge32", "ModuleIdentity", "IpAddress", "Counter64", "MibIdentifier", "Counter32", "ObjectIdentity", "Integer32", "Bits")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
ncm_japisdn, = mibBuilder.importSymbols("VERILINK-ENTERPRISE-NCMALARM-MIB", "ncm-japisdn")
ncmJapPRIPortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000), )
if mibBuilder.loadTexts: ncmJapPRIPortConfigTable.setStatus('mandatory')
ncmJapPRIPortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIPortNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIPortLineIndex"))
if mibBuilder.loadTexts: ncmJapPRIPortConfigEntry.setStatus('mandatory')
ncmJapPRIPortNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIPortNIDIndex.setStatus('mandatory')
ncmJapPRIPortLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIPortLineIndex.setStatus('mandatory')
ncmJapPRIPortInService = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortInService.setStatus('mandatory')
ncmJapPRIPortNFASMode = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("no-Nfas", 1), ("nfas-No-Backup", 2), ("nfas-Backup", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortNFASMode.setStatus('mandatory')
ncmJapPRIPortDChanMode = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("inverted", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortDChanMode.setStatus('mandatory')
ncmJapPRIPortDChanBits = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("chan-8-Bit", 1), ("chan-7-Bit", 2), ("chan-6-Bit", 3), ("undefined", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortDChanBits.setStatus('mandatory')
ncmJapPRIPortTimeslotMap = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortTimeslotMap.setStatus('mandatory')
ncmJapPRIPortSwitchType = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(15))).clone(namedValues=NamedValues(("sw-NTT", 15)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortSwitchType.setStatus('mandatory')
ncmJapPRIPortOwnNumPlan = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("unkn-NumPlan", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortOwnNumPlan.setStatus('mandatory')
ncmJapPRIPortOwnNumType = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("unkn-NumType", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortOwnNumType.setStatus('mandatory')
ncmJapPRIPortSecurityLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("no-Checks", 1), ("own-Numbers", 2), ("ext-Numbers", 3), ("both-Numbers", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortSecurityLevel.setStatus('mandatory')
ncmJapPRIPortConfigStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configuration-OK", 1), ("configuration-Error", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIPortConfigStatus.setStatus('mandatory')
ncmJapPRIPortSetConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("set-Config", 1), ("not-in-use", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIPortSetConfig.setStatus('mandatory')
ncmJapPRICallProfCallRefCount = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICallProfCallRefCount.setStatus('mandatory')
ncmJapPRIL2AutoEstablish = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRIL2AutoEstablish.setStatus('mandatory')
ncmJapPRICallProfileTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001), )
if mibBuilder.loadTexts: ncmJapPRICallProfileTable.setStatus('mandatory')
ncmJapPRICallProfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICallProfNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICallProfLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICPCallProfileRef"))
if mibBuilder.loadTexts: ncmJapPRICallProfEntry.setStatus('mandatory')
ncmJapPRICallProfNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICallProfNIDIndex.setStatus('mandatory')
ncmJapPRICallProfLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICallProfLineIndex.setStatus('mandatory')
ncmJapPRICPCallProfileRef = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICPCallProfileRef.setStatus('mandatory')
ncmJapPRICallProfCallDir = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("no-Direction", 1), ("incoming", 2), ("outgoing", 3), ("both-Directions", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfCallDir.setStatus('mandatory')
ncmJapPRICallProfNumOwnDigit = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfNumOwnDigit.setStatus('mandatory')
ncmJapPRICallProfOwnCallNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 6), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfOwnCallNum.setStatus('mandatory')
ncmJapPRICallProfExtNumPlan = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("unkn-NumPlan", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfExtNumPlan.setStatus('mandatory')
ncmJapPRICallProfExtNumType = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("unkn-NumType", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfExtNumType.setStatus('mandatory')
ncmJapPRICallProfExtNumDigit = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 9), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfExtNumDigit.setStatus('mandatory')
ncmJapPRICallProfExtCallNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 10), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfExtCallNum.setStatus('mandatory')
ncmJapPRICallProfTransferMode = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(8))).clone(namedValues=NamedValues(("unrestricted-digital", 8)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfTransferMode.setStatus('mandatory')
ncmJapPRICallProfCallBandWth = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(16, 19, 21))).clone(namedValues=NamedValues(("b1-64K", 16), ("h0-6X64K", 19), ("h11-24X64K", 21)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfCallBandWth.setStatus('mandatory')
ncmJapPRICallProfMultiRateCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 4, 6, 8, 12, 23, 24, 30, 31))).clone(namedValues=NamedValues(("mR-2", 2), ("mR-4", 4), ("mR-6", 6), ("mR-8", 8), ("mR-12", 12), ("mR-23", 23), ("mR-24", 24), ("mR-30", 30), ("mR-31", 31)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfMultiRateCnt.setStatus('mandatory')
ncmJapPRICallProfRateAdaptn = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-Adapt", 1), ("adapt-56K", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfRateAdaptn.setStatus('mandatory')
ncmJapPRICallProfTestCallIntvl = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 15), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfTestCallIntvl.setStatus('mandatory')
ncmJapPRICallProfCallStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("fail-Takedown-Idle", 1), ("successful-Setup", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICallProfCallStatus.setStatus('mandatory')
ncmJapPRICallProfCallAction = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("setup-Call", 1), ("takedown-Call", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICallProfCallAction.setStatus('mandatory')
ncmJapPRICPSetCallProf = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("set-CallProf", 1), ("not-in-use", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICPSetCallProf.setStatus('mandatory')
ncmJapPRICPSetCallProfResp = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configuration-OK", 1), ("configuration-Error", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPSetCallProfResp.setStatus('mandatory')
ncmJapPRICPCallActionResp = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configuration-OK", 1), ("configuration-Error", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPCallActionResp.setStatus('mandatory')
ncmJapPRICallProfListTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002), )
if mibBuilder.loadTexts: ncmJapPRICallProfListTable.setStatus('mandatory')
ncmJapPRICallProfListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICPListNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICPListLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICPListIndex"))
if mibBuilder.loadTexts: ncmJapPRICallProfListEntry.setStatus('mandatory')
ncmJapPRICPListNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPListNIDIndex.setStatus('mandatory')
ncmJapPRICPListLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPListLineIndex.setStatus('mandatory')
ncmJapPRICPListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPListIndex.setStatus('mandatory')
ncmJapPRICPListValidCPRefNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICPListValidCPRefNum.setStatus('mandatory')
ncmJapPRICurrentTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003), )
if mibBuilder.loadTexts: ncmJapPRICurrentTable.setStatus('mandatory')
ncmJapPRICurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICurrNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICurrLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICurrEndType"))
if mibBuilder.loadTexts: ncmJapPRICurrentEntry.setStatus('mandatory')
ncmJapPRICurrNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrNIDIndex.setStatus('mandatory')
ncmJapPRICurrLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrLineIndex.setStatus('mandatory')
ncmJapPRICurrEndType = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("near-End", 1), ("far-End", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrEndType.setStatus('mandatory')
ncmJapPRICurrTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrTimestamp.setStatus('mandatory')
ncmJapPRICurrSecsInCurrIntvl = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrSecsInCurrIntvl.setStatus('mandatory')
ncmJapPRICurrInfoRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrInfoRx.setStatus('mandatory')
ncmJapPRICurrInfoTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrInfoTx.setStatus('mandatory')
ncmJapPRICurrCRCErrRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrCRCErrRx.setStatus('mandatory')
ncmJapPRICurrInvalidFrameRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrInvalidFrameRx.setStatus('mandatory')
ncmJapPRICurrFrameAbortRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrFrameAbortRx.setStatus('mandatory')
ncmJapPRICurrDISCSRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrDISCSRx.setStatus('mandatory')
ncmJapPRICurrDISCSTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrDISCSTx.setStatus('mandatory')
ncmJapPRICurrFramerRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrFramerRx.setStatus('mandatory')
ncmJapPRICurrFramerTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrFramerTx.setStatus('mandatory')
ncmJapPRICurrLyr3ProtErr = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrLyr3ProtErr.setStatus('mandatory')
ncmJapPRICurrCallSetupSent = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrCallSetupSent.setStatus('mandatory')
ncmJapPRICurrCallSetupSentnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrCallSetupSentnFail.setStatus('mandatory')
ncmJapPRICurrCallSetupRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrCallSetupRx.setStatus('mandatory')
ncmJapPRICurrCallSetupRxnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrCallSetupRxnFail.setStatus('mandatory')
ncmJapPRICurrUnSupportMsgRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrUnSupportMsgRx.setStatus('mandatory')
ncmJapPRICurrTstCalSetupSentnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrTstCalSetupSentnFail.setStatus('mandatory')
ncmJapPRICurrValidIntvls = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICurrValidIntvls.setStatus('mandatory')
ncmJapPRICurrStatisticReset = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("statistic-Reset", 1), ("not-in-use", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRICurrStatisticReset.setStatus('mandatory')
ncmJapPRIIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004), )
if mibBuilder.loadTexts: ncmJapPRIIntervalTable.setStatus('mandatory')
ncmJapPRIIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIntvlNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIntvlLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIntvlEndType"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRIntvlIndex"))
if mibBuilder.loadTexts: ncmJapPRIIntervalEntry.setStatus('mandatory')
ncmJapPRIntvlNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlNIDIndex.setStatus('mandatory')
ncmJapPRIntvlLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlLineIndex.setStatus('mandatory')
ncmJapPRIntvlEndType = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("near-End", 1), ("far-End", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlEndType.setStatus('mandatory')
ncmJapPRIntvlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlIndex.setStatus('mandatory')
ncmJapPRIntvlTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlTimestamp.setStatus('mandatory')
ncmJapPRIntvlSecsInCurrIntvl = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlSecsInCurrIntvl.setStatus('mandatory')
ncmJapPRIntvlInfoRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlInfoRx.setStatus('mandatory')
ncmJapPRIntvlInfoTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlInfoTx.setStatus('mandatory')
ncmJapPRIntvlCRCErrRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlCRCErrRx.setStatus('mandatory')
ncmJapPRIntvlInvalidFrameRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlInvalidFrameRx.setStatus('mandatory')
ncmJapPRIntvlFrameAbortRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlFrameAbortRx.setStatus('mandatory')
ncmJapPRIntvlDISCSRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlDISCSRx.setStatus('mandatory')
ncmJapPRIntvlDISCSTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlDISCSTx.setStatus('mandatory')
ncmJapPRIntvlFramerRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlFramerRx.setStatus('mandatory')
ncmJapPRIntvlFramerTx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlFramerTx.setStatus('mandatory')
ncmJapPRIntvlLyr3ProtErr = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlLyr3ProtErr.setStatus('mandatory')
ncmJapPRIntvlCallSetupSent = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlCallSetupSent.setStatus('mandatory')
ncmJapPRIntvlCallSetupSentnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlCallSetupSentnFail.setStatus('mandatory')
ncmJapPRIntvlCallSetupRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlCallSetupRx.setStatus('mandatory')
ncmJapPRIntvlCallSetupRxnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlCallSetupRxnFail.setStatus('mandatory')
ncmJapPRIntvlUnSupportMsgRx = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlUnSupportMsgRx.setStatus('mandatory')
ncmJapPRIntvlTstCalSetupSentnFail = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRIntvlTstCalSetupSentnFail.setStatus('mandatory')
ncmJapPRISecurOperTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005), )
if mibBuilder.loadTexts: ncmJapPRISecurOperTable.setStatus('mandatory')
ncmJapPRISecurOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRISecOpNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRISecOpLineIndex"))
if mibBuilder.loadTexts: ncmJapPRISecurOperEntry.setStatus('mandatory')
ncmJapPRISecOpNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecOpNIDIndex.setStatus('mandatory')
ncmJapPRISecOpLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecOpLineIndex.setStatus('mandatory')
ncmJapPRISecOpFirstNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 13, 25, 37, 49))).clone(namedValues=NamedValues(("zeroth", 1), ("twelfth", 13), ("twenty-Fourth", 25), ("thirty-Sixth", 37), ("fourty-Eighth", 49)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecOpFirstNum.setStatus('mandatory')
ncmJapPRISecOpListype = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("own-number", 1), ("remote-number", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecOpListype.setStatus('mandatory')
ncmJapPRISecOpCountNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecOpCountNum.setStatus('mandatory')
ncmJapPRISecOpClearElement = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecOpClearElement.setStatus('mandatory')
ncmJapPRISecOpStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configuration-OK", 1), ("configuration-Error", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecOpStatus.setStatus('mandatory')
ncmJapPRISecOpAction = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("clear-Security-List", 1), ("set-Security-List", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecOpAction.setStatus('mandatory')
ncmJapPRISecurNumbTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006), )
if mibBuilder.loadTexts: ncmJapPRISecurNumbTable.setStatus('mandatory')
ncmJapPRISecurNumbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRISecNumNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRISecNumLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRISecNumIndex"))
if mibBuilder.loadTexts: ncmJapPRISecurNumbEntry.setStatus('mandatory')
ncmJapPRISecNumNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecNumNIDIndex.setStatus('mandatory')
ncmJapPRISecNumLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecNumLineIndex.setStatus('mandatory')
ncmJapPRISecNumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRISecNumIndex.setStatus('mandatory')
ncmJapPRISecNumCount = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecNumCount.setStatus('mandatory')
ncmJapPRISecNumNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 5), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ncmJapPRISecNumNumber.setStatus('mandatory')
ncmJapPRICallLogLineTable = MibTable((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007), )
if mibBuilder.loadTexts: ncmJapPRICallLogLineTable.setStatus('mandatory')
ncmJapPRICallLogLineEntry = MibTableRow((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1), ).setIndexNames((0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICaloglinNIDIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICaloglinLineIndex"), (0, "VERILINK-ENTERPRISE-NCMJAPISDN-MIB", "ncmJapPRICaloglinLineNum"))
if mibBuilder.loadTexts: ncmJapPRICallLogLineEntry.setStatus('mandatory')
ncmJapPRICaloglinNIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICaloglinNIDIndex.setStatus('mandatory')
ncmJapPRICaloglinLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICaloglinLineIndex.setStatus('mandatory')
ncmJapPRICaloglinLineNum = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICaloglinLineNum.setStatus('mandatory')
ncmJapPRICaloglinLogLine = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICaloglinLogLine.setStatus('mandatory')
ncmJapPRICaloglinStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid-CallLogLine", 1), ("invalid-CallLogLine", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ncmJapPRICaloglinStatus.setStatus('mandatory')
mibBuilder.exportSymbols("VERILINK-ENTERPRISE-NCMJAPISDN-MIB", ncmJapPRISecOpStatus=ncmJapPRISecOpStatus, ncmJapPRIIntervalTable=ncmJapPRIIntervalTable, ncmJapPRIntvlUnSupportMsgRx=ncmJapPRIntvlUnSupportMsgRx, ncmJapPRIntvlLyr3ProtErr=ncmJapPRIntvlLyr3ProtErr, ncmJapPRIntvlFramerRx=ncmJapPRIntvlFramerRx, ncmJapPRIPortNIDIndex=ncmJapPRIPortNIDIndex, ncmJapPRICallProfLineIndex=ncmJapPRICallProfLineIndex, ncmJapPRISecOpAction=ncmJapPRISecOpAction, ncmJapPRICallProfExtCallNum=ncmJapPRICallProfExtCallNum, ncmJapPRICurrCallSetupSentnFail=ncmJapPRICurrCallSetupSentnFail, ncmJapPRIntvlSecsInCurrIntvl=ncmJapPRIntvlSecsInCurrIntvl, ncmJapPRISecOpLineIndex=ncmJapPRISecOpLineIndex, ncmJapPRIPortOwnNumPlan=ncmJapPRIPortOwnNumPlan, ncmJapPRICPCallProfileRef=ncmJapPRICPCallProfileRef, ncmJapPRICurrDISCSTx=ncmJapPRICurrDISCSTx, ncmJapPRICurrValidIntvls=ncmJapPRICurrValidIntvls, ncmJapPRICaloglinNIDIndex=ncmJapPRICaloglinNIDIndex, ncmJapPRIntvlDISCSRx=ncmJapPRIntvlDISCSRx, ncmJapPRICurrUnSupportMsgRx=ncmJapPRICurrUnSupportMsgRx, ncmJapPRIntvlCRCErrRx=ncmJapPRIntvlCRCErrRx, ncmJapPRIIntervalEntry=ncmJapPRIIntervalEntry, ncmJapPRICurrFramerRx=ncmJapPRICurrFramerRx, ncmJapPRIPortDChanBits=ncmJapPRIPortDChanBits, ncmJapPRICurrNIDIndex=ncmJapPRICurrNIDIndex, ncmJapPRISecurOperTable=ncmJapPRISecurOperTable, ncmJapPRIntvlLineIndex=ncmJapPRIntvlLineIndex, ncmJapPRIPortConfigTable=ncmJapPRIPortConfigTable, ncmJapPRIPortInService=ncmJapPRIPortInService, ncmJapPRIPortSetConfig=ncmJapPRIPortSetConfig, ncmJapPRIntvlCallSetupRxnFail=ncmJapPRIntvlCallSetupRxnFail, ncmJapPRIntvlInfoRx=ncmJapPRIntvlInfoRx, ncmJapPRISecNumCount=ncmJapPRISecNumCount, ncmJapPRISecOpFirstNum=ncmJapPRISecOpFirstNum, ncmJapPRISecNumNIDIndex=ncmJapPRISecNumNIDIndex, ncmJapPRISecOpClearElement=ncmJapPRISecOpClearElement, ncmJapPRIPortOwnNumType=ncmJapPRIPortOwnNumType, ncmJapPRICallProfNIDIndex=ncmJapPRICallProfNIDIndex, ncmJapPRIntvlInvalidFrameRx=ncmJapPRIntvlInvalidFrameRx, ncmJapPRIPortSecurityLevel=ncmJapPRIPortSecurityLevel, ncmJapPRICallProfCallBandWth=ncmJapPRICallProfCallBandWth, ncmJapPRICallProfCallAction=ncmJapPRICallProfCallAction, ncmJapPRICaloglinLineIndex=ncmJapPRICaloglinLineIndex, ncmJapPRICallProfTestCallIntvl=ncmJapPRICallProfTestCallIntvl, ncmJapPRICPSetCallProf=ncmJapPRICPSetCallProf, ncmJapPRISecurNumbEntry=ncmJapPRISecurNumbEntry, ncmJapPRICallLogLineEntry=ncmJapPRICallLogLineEntry, ncmJapPRIntvlTstCalSetupSentnFail=ncmJapPRIntvlTstCalSetupSentnFail, ncmJapPRISecOpListype=ncmJapPRISecOpListype, ncmJapPRICPListIndex=ncmJapPRICPListIndex, ncmJapPRISecOpNIDIndex=ncmJapPRISecOpNIDIndex, ncmJapPRICurrTstCalSetupSentnFail=ncmJapPRICurrTstCalSetupSentnFail, ncmJapPRICurrLyr3ProtErr=ncmJapPRICurrLyr3ProtErr, ncmJapPRISecOpCountNum=ncmJapPRISecOpCountNum, ncmJapPRIPortLineIndex=ncmJapPRIPortLineIndex, ncmJapPRISecNumIndex=ncmJapPRISecNumIndex, ncmJapPRICallProfRateAdaptn=ncmJapPRICallProfRateAdaptn, ncmJapPRICurrCallSetupRxnFail=ncmJapPRICurrCallSetupRxnFail, ncmJapPRICallProfExtNumPlan=ncmJapPRICallProfExtNumPlan, ncmJapPRICPSetCallProfResp=ncmJapPRICPSetCallProfResp, ncmJapPRICurrTimestamp=ncmJapPRICurrTimestamp, ncmJapPRIntvlCallSetupRx=ncmJapPRIntvlCallSetupRx, ncmJapPRICurrCRCErrRx=ncmJapPRICurrCRCErrRx, ncmJapPRIntvlCallSetupSentnFail=ncmJapPRIntvlCallSetupSentnFail, ncmJapPRICurrFramerTx=ncmJapPRICurrFramerTx, ncmJapPRICurrSecsInCurrIntvl=ncmJapPRICurrSecsInCurrIntvl, ncmJapPRIPortConfigEntry=ncmJapPRIPortConfigEntry, ncmJapPRICaloglinStatus=ncmJapPRICaloglinStatus, ncmJapPRICallProfExtNumDigit=ncmJapPRICallProfExtNumDigit, ncmJapPRIL2AutoEstablish=ncmJapPRIL2AutoEstablish, ncmJapPRIPortNFASMode=ncmJapPRIPortNFASMode, ncmJapPRICallProfCallRefCount=ncmJapPRICallProfCallRefCount, ncmJapPRICurrDISCSRx=ncmJapPRICurrDISCSRx, ncmJapPRICPListValidCPRefNum=ncmJapPRICPListValidCPRefNum, ncmJapPRICurrentTable=ncmJapPRICurrentTable, ncmJapPRICallProfListTable=ncmJapPRICallProfListTable, ncmJapPRICaloglinLineNum=ncmJapPRICaloglinLineNum, ncmJapPRICallProfListEntry=ncmJapPRICallProfListEntry, ncmJapPRISecNumNumber=ncmJapPRISecNumNumber, ncmJapPRICurrInfoTx=ncmJapPRICurrInfoTx, ncmJapPRICallProfTransferMode=ncmJapPRICallProfTransferMode, ncmJapPRICallProfileTable=ncmJapPRICallProfileTable, ncmJapPRICurrInvalidFrameRx=ncmJapPRICurrInvalidFrameRx, ncmJapPRICallProfNumOwnDigit=ncmJapPRICallProfNumOwnDigit, ncmJapPRIntvlFramerTx=ncmJapPRIntvlFramerTx, ncmJapPRIPortConfigStatus=ncmJapPRIPortConfigStatus, ncmJapPRIntvlIndex=ncmJapPRIntvlIndex, ncmJapPRICPCallActionResp=ncmJapPRICPCallActionResp, ncmJapPRIPortDChanMode=ncmJapPRIPortDChanMode, ncmJapPRICPListNIDIndex=ncmJapPRICPListNIDIndex, ncmJapPRICurrLineIndex=ncmJapPRICurrLineIndex, ncmJapPRIntvlTimestamp=ncmJapPRIntvlTimestamp, ncmJapPRIntvlNIDIndex=ncmJapPRIntvlNIDIndex, ncmJapPRIntvlDISCSTx=ncmJapPRIntvlDISCSTx, ncmJapPRIntvlInfoTx=ncmJapPRIntvlInfoTx, ncmJapPRISecurNumbTable=ncmJapPRISecurNumbTable, ncmJapPRICallProfOwnCallNum=ncmJapPRICallProfOwnCallNum, ncmJapPRICallProfEntry=ncmJapPRICallProfEntry, ncmJapPRICallProfExtNumType=ncmJapPRICallProfExtNumType, ncmJapPRISecurOperEntry=ncmJapPRISecurOperEntry, ncmJapPRIPortSwitchType=ncmJapPRIPortSwitchType, ncmJapPRICaloglinLogLine=ncmJapPRICaloglinLogLine, ncmJapPRICallLogLineTable=ncmJapPRICallLogLineTable, ncmJapPRICurrStatisticReset=ncmJapPRICurrStatisticReset, ncmJapPRICallProfCallStatus=ncmJapPRICallProfCallStatus, ncmJapPRIntvlEndType=ncmJapPRIntvlEndType, ncmJapPRICallProfCallDir=ncmJapPRICallProfCallDir, ncmJapPRICurrentEntry=ncmJapPRICurrentEntry, ncmJapPRICurrCallSetupSent=ncmJapPRICurrCallSetupSent, ncmJapPRISecNumLineIndex=ncmJapPRISecNumLineIndex, ncmJapPRICurrEndType=ncmJapPRICurrEndType, ncmJapPRIPortTimeslotMap=ncmJapPRIPortTimeslotMap, ncmJapPRIntvlFrameAbortRx=ncmJapPRIntvlFrameAbortRx, ncmJapPRICurrInfoRx=ncmJapPRICurrInfoRx, ncmJapPRICurrFrameAbortRx=ncmJapPRICurrFrameAbortRx, ncmJapPRICurrCallSetupRx=ncmJapPRICurrCallSetupRx, ncmJapPRICPListLineIndex=ncmJapPRICPListLineIndex, ncmJapPRIntvlCallSetupSent=ncmJapPRIntvlCallSetupSent, ncmJapPRICallProfMultiRateCnt=ncmJapPRICallProfMultiRateCnt)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, time_ticks, notification_type, gauge32, module_identity, ip_address, counter64, mib_identifier, counter32, object_identity, integer32, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'TimeTicks', 'NotificationType', 'Gauge32', 'ModuleIdentity', 'IpAddress', 'Counter64', 'MibIdentifier', 'Counter32', 'ObjectIdentity', 'Integer32', 'Bits')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
(ncm_japisdn,) = mibBuilder.importSymbols('VERILINK-ENTERPRISE-NCMALARM-MIB', 'ncm-japisdn')
ncm_jap_pri_port_config_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000))
if mibBuilder.loadTexts:
ncmJapPRIPortConfigTable.setStatus('mandatory')
ncm_jap_pri_port_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIPortNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIPortLineIndex'))
if mibBuilder.loadTexts:
ncmJapPRIPortConfigEntry.setStatus('mandatory')
ncm_jap_pri_port_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIPortNIDIndex.setStatus('mandatory')
ncm_jap_pri_port_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIPortLineIndex.setStatus('mandatory')
ncm_jap_pri_port_in_service = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortInService.setStatus('mandatory')
ncm_jap_pri_port_nfas_mode = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('no-Nfas', 1), ('nfas-No-Backup', 2), ('nfas-Backup', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortNFASMode.setStatus('mandatory')
ncm_jap_pri_port_d_chan_mode = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('normal', 1), ('inverted', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortDChanMode.setStatus('mandatory')
ncm_jap_pri_port_d_chan_bits = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('chan-8-Bit', 1), ('chan-7-Bit', 2), ('chan-6-Bit', 3), ('undefined', 4)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortDChanBits.setStatus('mandatory')
ncm_jap_pri_port_timeslot_map = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 7), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortTimeslotMap.setStatus('mandatory')
ncm_jap_pri_port_switch_type = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(15))).clone(namedValues=named_values(('sw-NTT', 15)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortSwitchType.setStatus('mandatory')
ncm_jap_pri_port_own_num_plan = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('unkn-NumPlan', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortOwnNumPlan.setStatus('mandatory')
ncm_jap_pri_port_own_num_type = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('unkn-NumType', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortOwnNumType.setStatus('mandatory')
ncm_jap_pri_port_security_level = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('no-Checks', 1), ('own-Numbers', 2), ('ext-Numbers', 3), ('both-Numbers', 4)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortSecurityLevel.setStatus('mandatory')
ncm_jap_pri_port_config_status = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configuration-OK', 1), ('configuration-Error', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIPortConfigStatus.setStatus('mandatory')
ncm_jap_pri_port_set_config = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('set-Config', 1), ('not-in-use', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIPortSetConfig.setStatus('mandatory')
ncm_jap_pri_call_prof_call_ref_count = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICallProfCallRefCount.setStatus('mandatory')
ncm_jap_pril2_auto_establish = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8000, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRIL2AutoEstablish.setStatus('mandatory')
ncm_jap_pri_call_profile_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001))
if mibBuilder.loadTexts:
ncmJapPRICallProfileTable.setStatus('mandatory')
ncm_jap_pri_call_prof_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICallProfNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICallProfLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICPCallProfileRef'))
if mibBuilder.loadTexts:
ncmJapPRICallProfEntry.setStatus('mandatory')
ncm_jap_pri_call_prof_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICallProfNIDIndex.setStatus('mandatory')
ncm_jap_pri_call_prof_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICallProfLineIndex.setStatus('mandatory')
ncm_jap_pricp_call_profile_ref = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 3), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICPCallProfileRef.setStatus('mandatory')
ncm_jap_pri_call_prof_call_dir = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('no-Direction', 1), ('incoming', 2), ('outgoing', 3), ('both-Directions', 4)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfCallDir.setStatus('mandatory')
ncm_jap_pri_call_prof_num_own_digit = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 5), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfNumOwnDigit.setStatus('mandatory')
ncm_jap_pri_call_prof_own_call_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 6), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfOwnCallNum.setStatus('mandatory')
ncm_jap_pri_call_prof_ext_num_plan = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('unkn-NumPlan', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfExtNumPlan.setStatus('mandatory')
ncm_jap_pri_call_prof_ext_num_type = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('unkn-NumType', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfExtNumType.setStatus('mandatory')
ncm_jap_pri_call_prof_ext_num_digit = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 9), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfExtNumDigit.setStatus('mandatory')
ncm_jap_pri_call_prof_ext_call_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 10), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfExtCallNum.setStatus('mandatory')
ncm_jap_pri_call_prof_transfer_mode = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(8))).clone(namedValues=named_values(('unrestricted-digital', 8)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfTransferMode.setStatus('mandatory')
ncm_jap_pri_call_prof_call_band_wth = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(16, 19, 21))).clone(namedValues=named_values(('b1-64K', 16), ('h0-6X64K', 19), ('h11-24X64K', 21)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfCallBandWth.setStatus('mandatory')
ncm_jap_pri_call_prof_multi_rate_cnt = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 4, 6, 8, 12, 23, 24, 30, 31))).clone(namedValues=named_values(('mR-2', 2), ('mR-4', 4), ('mR-6', 6), ('mR-8', 8), ('mR-12', 12), ('mR-23', 23), ('mR-24', 24), ('mR-30', 30), ('mR-31', 31)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfMultiRateCnt.setStatus('mandatory')
ncm_jap_pri_call_prof_rate_adaptn = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-Adapt', 1), ('adapt-56K', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfRateAdaptn.setStatus('mandatory')
ncm_jap_pri_call_prof_test_call_intvl = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 15), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfTestCallIntvl.setStatus('mandatory')
ncm_jap_pri_call_prof_call_status = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('fail-Takedown-Idle', 1), ('successful-Setup', 2), ('unknown', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICallProfCallStatus.setStatus('mandatory')
ncm_jap_pri_call_prof_call_action = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('setup-Call', 1), ('takedown-Call', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICallProfCallAction.setStatus('mandatory')
ncm_jap_pricp_set_call_prof = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('set-CallProf', 1), ('not-in-use', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICPSetCallProf.setStatus('mandatory')
ncm_jap_pricp_set_call_prof_resp = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configuration-OK', 1), ('configuration-Error', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPSetCallProfResp.setStatus('mandatory')
ncm_jap_pricp_call_action_resp = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8001, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configuration-OK', 1), ('configuration-Error', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPCallActionResp.setStatus('mandatory')
ncm_jap_pri_call_prof_list_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002))
if mibBuilder.loadTexts:
ncmJapPRICallProfListTable.setStatus('mandatory')
ncm_jap_pri_call_prof_list_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICPListNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICPListLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICPListIndex'))
if mibBuilder.loadTexts:
ncmJapPRICallProfListEntry.setStatus('mandatory')
ncm_jap_pricp_list_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPListNIDIndex.setStatus('mandatory')
ncm_jap_pricp_list_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPListLineIndex.setStatus('mandatory')
ncm_jap_pricp_list_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPListIndex.setStatus('mandatory')
ncm_jap_pricp_list_valid_cp_ref_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8002, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICPListValidCPRefNum.setStatus('mandatory')
ncm_jap_pri_current_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003))
if mibBuilder.loadTexts:
ncmJapPRICurrentTable.setStatus('mandatory')
ncm_jap_pri_current_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICurrNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICurrLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICurrEndType'))
if mibBuilder.loadTexts:
ncmJapPRICurrentEntry.setStatus('mandatory')
ncm_jap_pri_curr_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrNIDIndex.setStatus('mandatory')
ncm_jap_pri_curr_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrLineIndex.setStatus('mandatory')
ncm_jap_pri_curr_end_type = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('near-End', 1), ('far-End', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrEndType.setStatus('mandatory')
ncm_jap_pri_curr_timestamp = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrTimestamp.setStatus('mandatory')
ncm_jap_pri_curr_secs_in_curr_intvl = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrSecsInCurrIntvl.setStatus('mandatory')
ncm_jap_pri_curr_info_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrInfoRx.setStatus('mandatory')
ncm_jap_pri_curr_info_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrInfoTx.setStatus('mandatory')
ncm_jap_pri_curr_crc_err_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrCRCErrRx.setStatus('mandatory')
ncm_jap_pri_curr_invalid_frame_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrInvalidFrameRx.setStatus('mandatory')
ncm_jap_pri_curr_frame_abort_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrFrameAbortRx.setStatus('mandatory')
ncm_jap_pri_curr_discs_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrDISCSRx.setStatus('mandatory')
ncm_jap_pri_curr_discs_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrDISCSTx.setStatus('mandatory')
ncm_jap_pri_curr_framer_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrFramerRx.setStatus('mandatory')
ncm_jap_pri_curr_framer_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrFramerTx.setStatus('mandatory')
ncm_jap_pri_curr_lyr3_prot_err = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrLyr3ProtErr.setStatus('mandatory')
ncm_jap_pri_curr_call_setup_sent = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrCallSetupSent.setStatus('mandatory')
ncm_jap_pri_curr_call_setup_sentn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrCallSetupSentnFail.setStatus('mandatory')
ncm_jap_pri_curr_call_setup_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrCallSetupRx.setStatus('mandatory')
ncm_jap_pri_curr_call_setup_rxn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrCallSetupRxnFail.setStatus('mandatory')
ncm_jap_pri_curr_un_support_msg_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 20), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrUnSupportMsgRx.setStatus('mandatory')
ncm_jap_pri_curr_tst_cal_setup_sentn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 21), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrTstCalSetupSentnFail.setStatus('mandatory')
ncm_jap_pri_curr_valid_intvls = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 22), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICurrValidIntvls.setStatus('mandatory')
ncm_jap_pri_curr_statistic_reset = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8003, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('statistic-Reset', 1), ('not-in-use', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRICurrStatisticReset.setStatus('mandatory')
ncm_jap_pri_interval_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004))
if mibBuilder.loadTexts:
ncmJapPRIIntervalTable.setStatus('mandatory')
ncm_jap_pri_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIntvlNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIntvlLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIntvlEndType'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRIntvlIndex'))
if mibBuilder.loadTexts:
ncmJapPRIIntervalEntry.setStatus('mandatory')
ncm_jap_pr_intvl_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlNIDIndex.setStatus('mandatory')
ncm_jap_pr_intvl_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlLineIndex.setStatus('mandatory')
ncm_jap_pr_intvl_end_type = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('near-End', 1), ('far-End', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlEndType.setStatus('mandatory')
ncm_jap_pr_intvl_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlIndex.setStatus('mandatory')
ncm_jap_pr_intvl_timestamp = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlTimestamp.setStatus('mandatory')
ncm_jap_pr_intvl_secs_in_curr_intvl = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlSecsInCurrIntvl.setStatus('mandatory')
ncm_jap_pr_intvl_info_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlInfoRx.setStatus('mandatory')
ncm_jap_pr_intvl_info_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlInfoTx.setStatus('mandatory')
ncm_jap_pr_intvl_crc_err_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlCRCErrRx.setStatus('mandatory')
ncm_jap_pr_intvl_invalid_frame_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlInvalidFrameRx.setStatus('mandatory')
ncm_jap_pr_intvl_frame_abort_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlFrameAbortRx.setStatus('mandatory')
ncm_jap_pr_intvl_discs_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlDISCSRx.setStatus('mandatory')
ncm_jap_pr_intvl_discs_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlDISCSTx.setStatus('mandatory')
ncm_jap_pr_intvl_framer_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlFramerRx.setStatus('mandatory')
ncm_jap_pr_intvl_framer_tx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlFramerTx.setStatus('mandatory')
ncm_jap_pr_intvl_lyr3_prot_err = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlLyr3ProtErr.setStatus('mandatory')
ncm_jap_pr_intvl_call_setup_sent = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlCallSetupSent.setStatus('mandatory')
ncm_jap_pr_intvl_call_setup_sentn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlCallSetupSentnFail.setStatus('mandatory')
ncm_jap_pr_intvl_call_setup_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlCallSetupRx.setStatus('mandatory')
ncm_jap_pr_intvl_call_setup_rxn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 20), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlCallSetupRxnFail.setStatus('mandatory')
ncm_jap_pr_intvl_un_support_msg_rx = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 21), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlUnSupportMsgRx.setStatus('mandatory')
ncm_jap_pr_intvl_tst_cal_setup_sentn_fail = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8004, 1, 22), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRIntvlTstCalSetupSentnFail.setStatus('mandatory')
ncm_jap_pri_secur_oper_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005))
if mibBuilder.loadTexts:
ncmJapPRISecurOperTable.setStatus('mandatory')
ncm_jap_pri_secur_oper_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRISecOpNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRISecOpLineIndex'))
if mibBuilder.loadTexts:
ncmJapPRISecurOperEntry.setStatus('mandatory')
ncm_jap_pri_sec_op_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecOpNIDIndex.setStatus('mandatory')
ncm_jap_pri_sec_op_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecOpLineIndex.setStatus('mandatory')
ncm_jap_pri_sec_op_first_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 13, 25, 37, 49))).clone(namedValues=named_values(('zeroth', 1), ('twelfth', 13), ('twenty-Fourth', 25), ('thirty-Sixth', 37), ('fourty-Eighth', 49)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecOpFirstNum.setStatus('mandatory')
ncm_jap_pri_sec_op_listype = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('own-number', 1), ('remote-number', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecOpListype.setStatus('mandatory')
ncm_jap_pri_sec_op_count_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecOpCountNum.setStatus('mandatory')
ncm_jap_pri_sec_op_clear_element = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 6), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecOpClearElement.setStatus('mandatory')
ncm_jap_pri_sec_op_status = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configuration-OK', 1), ('configuration-Error', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecOpStatus.setStatus('mandatory')
ncm_jap_pri_sec_op_action = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8005, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('clear-Security-List', 1), ('set-Security-List', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecOpAction.setStatus('mandatory')
ncm_jap_pri_secur_numb_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006))
if mibBuilder.loadTexts:
ncmJapPRISecurNumbTable.setStatus('mandatory')
ncm_jap_pri_secur_numb_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRISecNumNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRISecNumLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRISecNumIndex'))
if mibBuilder.loadTexts:
ncmJapPRISecurNumbEntry.setStatus('mandatory')
ncm_jap_pri_sec_num_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecNumNIDIndex.setStatus('mandatory')
ncm_jap_pri_sec_num_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecNumLineIndex.setStatus('mandatory')
ncm_jap_pri_sec_num_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRISecNumIndex.setStatus('mandatory')
ncm_jap_pri_sec_num_count = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 4), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecNumCount.setStatus('mandatory')
ncm_jap_pri_sec_num_number = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8006, 1, 5), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ncmJapPRISecNumNumber.setStatus('mandatory')
ncm_jap_pri_call_log_line_table = mib_table((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007))
if mibBuilder.loadTexts:
ncmJapPRICallLogLineTable.setStatus('mandatory')
ncm_jap_pri_call_log_line_entry = mib_table_row((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1)).setIndexNames((0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICaloglinNIDIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICaloglinLineIndex'), (0, 'VERILINK-ENTERPRISE-NCMJAPISDN-MIB', 'ncmJapPRICaloglinLineNum'))
if mibBuilder.loadTexts:
ncmJapPRICallLogLineEntry.setStatus('mandatory')
ncm_jap_pri_caloglin_nid_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICaloglinNIDIndex.setStatus('mandatory')
ncm_jap_pri_caloglin_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICaloglinLineIndex.setStatus('mandatory')
ncm_jap_pri_caloglin_line_num = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICaloglinLineNum.setStatus('mandatory')
ncm_jap_pri_caloglin_log_line = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICaloglinLogLine.setStatus('mandatory')
ncm_jap_pri_caloglin_status = mib_table_column((1, 3, 6, 1, 4, 1, 321, 1, 3038, 8007, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('valid-CallLogLine', 1), ('invalid-CallLogLine', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ncmJapPRICaloglinStatus.setStatus('mandatory')
mibBuilder.exportSymbols('VERILINK-ENTERPRISE-NCMJAPISDN-MIB', ncmJapPRISecOpStatus=ncmJapPRISecOpStatus, ncmJapPRIIntervalTable=ncmJapPRIIntervalTable, ncmJapPRIntvlUnSupportMsgRx=ncmJapPRIntvlUnSupportMsgRx, ncmJapPRIntvlLyr3ProtErr=ncmJapPRIntvlLyr3ProtErr, ncmJapPRIntvlFramerRx=ncmJapPRIntvlFramerRx, ncmJapPRIPortNIDIndex=ncmJapPRIPortNIDIndex, ncmJapPRICallProfLineIndex=ncmJapPRICallProfLineIndex, ncmJapPRISecOpAction=ncmJapPRISecOpAction, ncmJapPRICallProfExtCallNum=ncmJapPRICallProfExtCallNum, ncmJapPRICurrCallSetupSentnFail=ncmJapPRICurrCallSetupSentnFail, ncmJapPRIntvlSecsInCurrIntvl=ncmJapPRIntvlSecsInCurrIntvl, ncmJapPRISecOpLineIndex=ncmJapPRISecOpLineIndex, ncmJapPRIPortOwnNumPlan=ncmJapPRIPortOwnNumPlan, ncmJapPRICPCallProfileRef=ncmJapPRICPCallProfileRef, ncmJapPRICurrDISCSTx=ncmJapPRICurrDISCSTx, ncmJapPRICurrValidIntvls=ncmJapPRICurrValidIntvls, ncmJapPRICaloglinNIDIndex=ncmJapPRICaloglinNIDIndex, ncmJapPRIntvlDISCSRx=ncmJapPRIntvlDISCSRx, ncmJapPRICurrUnSupportMsgRx=ncmJapPRICurrUnSupportMsgRx, ncmJapPRIntvlCRCErrRx=ncmJapPRIntvlCRCErrRx, ncmJapPRIIntervalEntry=ncmJapPRIIntervalEntry, ncmJapPRICurrFramerRx=ncmJapPRICurrFramerRx, ncmJapPRIPortDChanBits=ncmJapPRIPortDChanBits, ncmJapPRICurrNIDIndex=ncmJapPRICurrNIDIndex, ncmJapPRISecurOperTable=ncmJapPRISecurOperTable, ncmJapPRIntvlLineIndex=ncmJapPRIntvlLineIndex, ncmJapPRIPortConfigTable=ncmJapPRIPortConfigTable, ncmJapPRIPortInService=ncmJapPRIPortInService, ncmJapPRIPortSetConfig=ncmJapPRIPortSetConfig, ncmJapPRIntvlCallSetupRxnFail=ncmJapPRIntvlCallSetupRxnFail, ncmJapPRIntvlInfoRx=ncmJapPRIntvlInfoRx, ncmJapPRISecNumCount=ncmJapPRISecNumCount, ncmJapPRISecOpFirstNum=ncmJapPRISecOpFirstNum, ncmJapPRISecNumNIDIndex=ncmJapPRISecNumNIDIndex, ncmJapPRISecOpClearElement=ncmJapPRISecOpClearElement, ncmJapPRIPortOwnNumType=ncmJapPRIPortOwnNumType, ncmJapPRICallProfNIDIndex=ncmJapPRICallProfNIDIndex, ncmJapPRIntvlInvalidFrameRx=ncmJapPRIntvlInvalidFrameRx, ncmJapPRIPortSecurityLevel=ncmJapPRIPortSecurityLevel, ncmJapPRICallProfCallBandWth=ncmJapPRICallProfCallBandWth, ncmJapPRICallProfCallAction=ncmJapPRICallProfCallAction, ncmJapPRICaloglinLineIndex=ncmJapPRICaloglinLineIndex, ncmJapPRICallProfTestCallIntvl=ncmJapPRICallProfTestCallIntvl, ncmJapPRICPSetCallProf=ncmJapPRICPSetCallProf, ncmJapPRISecurNumbEntry=ncmJapPRISecurNumbEntry, ncmJapPRICallLogLineEntry=ncmJapPRICallLogLineEntry, ncmJapPRIntvlTstCalSetupSentnFail=ncmJapPRIntvlTstCalSetupSentnFail, ncmJapPRISecOpListype=ncmJapPRISecOpListype, ncmJapPRICPListIndex=ncmJapPRICPListIndex, ncmJapPRISecOpNIDIndex=ncmJapPRISecOpNIDIndex, ncmJapPRICurrTstCalSetupSentnFail=ncmJapPRICurrTstCalSetupSentnFail, ncmJapPRICurrLyr3ProtErr=ncmJapPRICurrLyr3ProtErr, ncmJapPRISecOpCountNum=ncmJapPRISecOpCountNum, ncmJapPRIPortLineIndex=ncmJapPRIPortLineIndex, ncmJapPRISecNumIndex=ncmJapPRISecNumIndex, ncmJapPRICallProfRateAdaptn=ncmJapPRICallProfRateAdaptn, ncmJapPRICurrCallSetupRxnFail=ncmJapPRICurrCallSetupRxnFail, ncmJapPRICallProfExtNumPlan=ncmJapPRICallProfExtNumPlan, ncmJapPRICPSetCallProfResp=ncmJapPRICPSetCallProfResp, ncmJapPRICurrTimestamp=ncmJapPRICurrTimestamp, ncmJapPRIntvlCallSetupRx=ncmJapPRIntvlCallSetupRx, ncmJapPRICurrCRCErrRx=ncmJapPRICurrCRCErrRx, ncmJapPRIntvlCallSetupSentnFail=ncmJapPRIntvlCallSetupSentnFail, ncmJapPRICurrFramerTx=ncmJapPRICurrFramerTx, ncmJapPRICurrSecsInCurrIntvl=ncmJapPRICurrSecsInCurrIntvl, ncmJapPRIPortConfigEntry=ncmJapPRIPortConfigEntry, ncmJapPRICaloglinStatus=ncmJapPRICaloglinStatus, ncmJapPRICallProfExtNumDigit=ncmJapPRICallProfExtNumDigit, ncmJapPRIL2AutoEstablish=ncmJapPRIL2AutoEstablish, ncmJapPRIPortNFASMode=ncmJapPRIPortNFASMode, ncmJapPRICallProfCallRefCount=ncmJapPRICallProfCallRefCount, ncmJapPRICurrDISCSRx=ncmJapPRICurrDISCSRx, ncmJapPRICPListValidCPRefNum=ncmJapPRICPListValidCPRefNum, ncmJapPRICurrentTable=ncmJapPRICurrentTable, ncmJapPRICallProfListTable=ncmJapPRICallProfListTable, ncmJapPRICaloglinLineNum=ncmJapPRICaloglinLineNum, ncmJapPRICallProfListEntry=ncmJapPRICallProfListEntry, ncmJapPRISecNumNumber=ncmJapPRISecNumNumber, ncmJapPRICurrInfoTx=ncmJapPRICurrInfoTx, ncmJapPRICallProfTransferMode=ncmJapPRICallProfTransferMode, ncmJapPRICallProfileTable=ncmJapPRICallProfileTable, ncmJapPRICurrInvalidFrameRx=ncmJapPRICurrInvalidFrameRx, ncmJapPRICallProfNumOwnDigit=ncmJapPRICallProfNumOwnDigit, ncmJapPRIntvlFramerTx=ncmJapPRIntvlFramerTx, ncmJapPRIPortConfigStatus=ncmJapPRIPortConfigStatus, ncmJapPRIntvlIndex=ncmJapPRIntvlIndex, ncmJapPRICPCallActionResp=ncmJapPRICPCallActionResp, ncmJapPRIPortDChanMode=ncmJapPRIPortDChanMode, ncmJapPRICPListNIDIndex=ncmJapPRICPListNIDIndex, ncmJapPRICurrLineIndex=ncmJapPRICurrLineIndex, ncmJapPRIntvlTimestamp=ncmJapPRIntvlTimestamp, ncmJapPRIntvlNIDIndex=ncmJapPRIntvlNIDIndex, ncmJapPRIntvlDISCSTx=ncmJapPRIntvlDISCSTx, ncmJapPRIntvlInfoTx=ncmJapPRIntvlInfoTx, ncmJapPRISecurNumbTable=ncmJapPRISecurNumbTable, ncmJapPRICallProfOwnCallNum=ncmJapPRICallProfOwnCallNum, ncmJapPRICallProfEntry=ncmJapPRICallProfEntry, ncmJapPRICallProfExtNumType=ncmJapPRICallProfExtNumType, ncmJapPRISecurOperEntry=ncmJapPRISecurOperEntry, ncmJapPRIPortSwitchType=ncmJapPRIPortSwitchType, ncmJapPRICaloglinLogLine=ncmJapPRICaloglinLogLine, ncmJapPRICallLogLineTable=ncmJapPRICallLogLineTable, ncmJapPRICurrStatisticReset=ncmJapPRICurrStatisticReset, ncmJapPRICallProfCallStatus=ncmJapPRICallProfCallStatus, ncmJapPRIntvlEndType=ncmJapPRIntvlEndType, ncmJapPRICallProfCallDir=ncmJapPRICallProfCallDir, ncmJapPRICurrentEntry=ncmJapPRICurrentEntry, ncmJapPRICurrCallSetupSent=ncmJapPRICurrCallSetupSent, ncmJapPRISecNumLineIndex=ncmJapPRISecNumLineIndex, ncmJapPRICurrEndType=ncmJapPRICurrEndType, ncmJapPRIPortTimeslotMap=ncmJapPRIPortTimeslotMap, ncmJapPRIntvlFrameAbortRx=ncmJapPRIntvlFrameAbortRx, ncmJapPRICurrInfoRx=ncmJapPRICurrInfoRx, ncmJapPRICurrFrameAbortRx=ncmJapPRICurrFrameAbortRx, ncmJapPRICurrCallSetupRx=ncmJapPRICurrCallSetupRx, ncmJapPRICPListLineIndex=ncmJapPRICPListLineIndex, ncmJapPRIntvlCallSetupSent=ncmJapPRIntvlCallSetupSent, ncmJapPRICallProfMultiRateCnt=ncmJapPRICallProfMultiRateCnt) |
__all__ = ["WindowOperator"]
class WindowOperator(Operator):
pass
| __all__ = ['WindowOperator']
class Windowoperator(Operator):
pass |
def allinstance(collection, legal_type):
"""
Checks the type of all items in a collection match a specified type
Parameters
----------
collection: list, tuple, or set
legal_type: type
Returns
-------
bool
"""
if not isinstance(collection, (list, tuple, set)):
illegal = type(collection).__name__
raise(TypeError(f'allinstance expects either list, tuple, or set, not "{illegal}" in first parameter'))
if not isinstance(legal_type, type):
raise(TypeError(f'allinstance expects type, not "{legal_type}" in second parameter'))
return all(isinstance(item, legal_type) for item in collection)
def findillegals(collection, legal_type):
"""
Lists the types of items in a collection that do not match the specified type
Parameters
----------
collection: list, tuple, or set
legal_type: type
Returns
-------
list: str
returned list is unique i.e., no duplicates
"""
if not isinstance(collection, (list, tuple, set)):
illegal = type(collection).__name__
raise(TypeError(f'illegaltype expects either list, tuple, or set, not "{illegal}" in first parameter'))
if not isinstance(legal_type, type):
illegal = type(legal_type).__name__
raise(TypeError(f'illegaltype expects type, not instance of "{illegal}" in second parameter'))
types = [type(item).__name__ for item in collection if type(item) != legal_type]
return list(set(types)) | def allinstance(collection, legal_type):
"""
Checks the type of all items in a collection match a specified type
Parameters
----------
collection: list, tuple, or set
legal_type: type
Returns
-------
bool
"""
if not isinstance(collection, (list, tuple, set)):
illegal = type(collection).__name__
raise type_error(f'allinstance expects either list, tuple, or set, not "{illegal}" in first parameter')
if not isinstance(legal_type, type):
raise type_error(f'allinstance expects type, not "{legal_type}" in second parameter')
return all((isinstance(item, legal_type) for item in collection))
def findillegals(collection, legal_type):
"""
Lists the types of items in a collection that do not match the specified type
Parameters
----------
collection: list, tuple, or set
legal_type: type
Returns
-------
list: str
returned list is unique i.e., no duplicates
"""
if not isinstance(collection, (list, tuple, set)):
illegal = type(collection).__name__
raise type_error(f'illegaltype expects either list, tuple, or set, not "{illegal}" in first parameter')
if not isinstance(legal_type, type):
illegal = type(legal_type).__name__
raise type_error(f'illegaltype expects type, not instance of "{illegal}" in second parameter')
types = [type(item).__name__ for item in collection if type(item) != legal_type]
return list(set(types)) |
# Read from the file words.txt and output the word frequency list to stdout.
with open('words.txt', 'r') as f:
line = f.readline()
word_occ_dict = {}
while line:
tokens = list( line.split() )
for t in tokens:
word_occ_dict[t] = word_occ_dict.get(t, 0) + 1
line = f.readline()
for word in sorted(word_occ_dict, key=word_occ_dict.get, reverse = True ):
print(f'{word} {word_occ_dict[word]}') | with open('words.txt', 'r') as f:
line = f.readline()
word_occ_dict = {}
while line:
tokens = list(line.split())
for t in tokens:
word_occ_dict[t] = word_occ_dict.get(t, 0) + 1
line = f.readline()
for word in sorted(word_occ_dict, key=word_occ_dict.get, reverse=True):
print(f'{word} {word_occ_dict[word]}') |
# imports
def fifty_ml_heights(init_vol, steps, vol_dec):
vols = []
heights = []
# these values originate from Excel spreadsheet "Exp803..."
print (init_vol)
b = 0
m = 0.0024
if init_vol > 51000:
offset = 14 # model out of range; see sheet
else:
offset = 7 # mm Need to add offset to ensure tip reaches below liquid level
print (offset)
for i in range(steps):
x = init_vol-vol_dec*i
vols.append(x)
h = m*x+b
h = h-offset
# print (h)
if h < 12: # If less than 5mL remain in 50mL tube, go to bottom for asp
h = 2
heights.append(h)
else:
heights.append(round(h, 1))
return heights
##########################
# ##### COMMANDS #####
fifty_h=fifty_ml_heights(32400, 100, 200)
print(fifty_h)
| def fifty_ml_heights(init_vol, steps, vol_dec):
vols = []
heights = []
print(init_vol)
b = 0
m = 0.0024
if init_vol > 51000:
offset = 14
else:
offset = 7
print(offset)
for i in range(steps):
x = init_vol - vol_dec * i
vols.append(x)
h = m * x + b
h = h - offset
if h < 12:
h = 2
heights.append(h)
else:
heights.append(round(h, 1))
return heights
fifty_h = fifty_ml_heights(32400, 100, 200)
print(fifty_h) |
class Config:
# AWS Information
ec2_region = "eu-west-2" # London # Same as environment variable EC2_REGION
ec2_amis = ['ami-09c4a4b013e66b291']
ec2_keypair = 'OnDemandMinecraft'
ec2_secgroups = ['sg-0441198b7b0617d3a']
ec2_instancetype = 't3.small'
| class Config:
ec2_region = 'eu-west-2'
ec2_amis = ['ami-09c4a4b013e66b291']
ec2_keypair = 'OnDemandMinecraft'
ec2_secgroups = ['sg-0441198b7b0617d3a']
ec2_instancetype = 't3.small' |
with open('payload.bin', 'rb') as stringFile:
with open('payload.s', 'w') as f:
for byte in stringFile.read():
print('byte %s' % hex(byte), file=f)
| with open('payload.bin', 'rb') as string_file:
with open('payload.s', 'w') as f:
for byte in stringFile.read():
print('byte %s' % hex(byte), file=f) |
def fast_scan_ms(name = 'test', tilt_stage=True):
print("in bens routine")
yield from expert_reflection_scan_full(md={'sample_name': name}, detector=lambda_det, tilt_stage=tilt_stage)
def ms_align():
yield from bps.mv(geo.det_mode,1)
yield from bps.mv(abs2,3)
yield from nab(-0.1,-0.1)
yield from bp.scan([lambda_det],sh,-0.3,0.3,31)
yield from bps.sleep(1)
tmp = peaks.cen['lambda_det_stats2_total']
yield from bps.mv(sh,tmp)
yield from set_sh(0)
yield from bp.rel_scan([lambda_det],tilt.y,-0.1,0.1,21)
tmp = peaks.cen['lambda_det_stats2_total']
yield from bps.mv(tilt.y,tmp)
yield from set_tilty(-0.1)
| def fast_scan_ms(name='test', tilt_stage=True):
print('in bens routine')
yield from expert_reflection_scan_full(md={'sample_name': name}, detector=lambda_det, tilt_stage=tilt_stage)
def ms_align():
yield from bps.mv(geo.det_mode, 1)
yield from bps.mv(abs2, 3)
yield from nab(-0.1, -0.1)
yield from bp.scan([lambda_det], sh, -0.3, 0.3, 31)
yield from bps.sleep(1)
tmp = peaks.cen['lambda_det_stats2_total']
yield from bps.mv(sh, tmp)
yield from set_sh(0)
yield from bp.rel_scan([lambda_det], tilt.y, -0.1, 0.1, 21)
tmp = peaks.cen['lambda_det_stats2_total']
yield from bps.mv(tilt.y, tmp)
yield from set_tilty(-0.1) |
#Restaurant:
class Restaurant():
"""A simple attempt to make class restaurant. """
def __init__(self, restaurant_name, cuisine_type):
""" This is to initialize name and type of restaurant"""
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
""" This method describes the Restaurant"""
print("Restaurant name :",self.restaurant_name.title())
print("Its Cuisine Type:",self.cuisine_type.title())
def open_restaurant(self):
print("The restaurant is open.")
restaurant = Restaurant('startbucks','coffee')
print(restaurant.cuisine_type,restaurant.restaurant_name)
restaurant.describe_restaurant()
restaurant.open_restaurant()
| class Restaurant:
"""A simple attempt to make class restaurant. """
def __init__(self, restaurant_name, cuisine_type):
""" This is to initialize name and type of restaurant"""
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
""" This method describes the Restaurant"""
print('Restaurant name :', self.restaurant_name.title())
print('Its Cuisine Type:', self.cuisine_type.title())
def open_restaurant(self):
print('The restaurant is open.')
restaurant = restaurant('startbucks', 'coffee')
print(restaurant.cuisine_type, restaurant.restaurant_name)
restaurant.describe_restaurant()
restaurant.open_restaurant() |
# Insert a Node at the Tail of a Linked List
# Developer: Murillo Grubler
# https://www.hackerrank.com/challenges/insert-a-node-at-the-tail-of-a-linked-list/problem
class SinglyLinkedListNode:
def __init__(self, data):
self.data = data
self.next = None
class SinglyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def print_singly_linked_list(head):
while head:
print (head.data)
head = head.next
def insertNodeAtTail(head, data):
if head is None:
return SinglyLinkedListNode(data)
elif head.next is None:
head.next = SinglyLinkedListNode(data)
else:
temp = head
while temp.next:
temp = temp.next
temp.next = SinglyLinkedListNode(data)
return head
def insertNodeAtTailRecursive(head, data):
if head is None:
return SinglyLinkedListNode(data)
elif head.next is None:
head.next = SinglyLinkedListNode(data)
else:
insertNodeAtTail(head.next, data)
return head
if __name__ == '__main__':
llist_count = int(input())
llist = SinglyLinkedList()
for i in range(llist_count):
llist_item = int(input())
llist_head = insertNodeAtTail(llist.head, llist_item)
llist.head = llist_head
print_singly_linked_list(llist.head) | class Singlylinkedlistnode:
def __init__(self, data):
self.data = data
self.next = None
class Singlylinkedlist:
def __init__(self):
self.head = None
self.tail = None
def print_singly_linked_list(head):
while head:
print(head.data)
head = head.next
def insert_node_at_tail(head, data):
if head is None:
return singly_linked_list_node(data)
elif head.next is None:
head.next = singly_linked_list_node(data)
else:
temp = head
while temp.next:
temp = temp.next
temp.next = singly_linked_list_node(data)
return head
def insert_node_at_tail_recursive(head, data):
if head is None:
return singly_linked_list_node(data)
elif head.next is None:
head.next = singly_linked_list_node(data)
else:
insert_node_at_tail(head.next, data)
return head
if __name__ == '__main__':
llist_count = int(input())
llist = singly_linked_list()
for i in range(llist_count):
llist_item = int(input())
llist_head = insert_node_at_tail(llist.head, llist_item)
llist.head = llist_head
print_singly_linked_list(llist.head) |
tempClasses = []
tempStudents = []
def student(_, info, id):
for s in tempStudents:
if s['id'] == id:
return s
return None
def students(_, info):
return {
'success': True,
'errors': [],
'students': tempStudents}
def classes(_, info, id):
for c in tempClasses:
if c['id'] == id:
return c
return None
def all_classes(_, info):
return {
'success': True,
'errors': ['All Classes found.'],
'classes': tempClasses}
def create_student(_, info, name, email):
if len(tempStudents) == 0:
id = 1
else:
id = tempStudents[-1]['id'] + 1
s = {
'id': id,
'name': name,
'email': email
}
tempStudents.append(s)
return {
'success': True,
'errors': [],
'students': [s]}
def get_student_ids():
ids = []
for s in tempStudents:
ids.append(s['id'])
return ids
def create_class(_, info, name, student_ids):
ids = get_student_ids()
for id in student_ids:
if id not in ids:
return {
'success': False,
'errors': ['Student of given id not found.'],
'classes': None}
if len(tempClasses) == 0:
id = 1
else:
id = tempClasses[-1]['id'] + 1
c = {
'id': id,
'name': name,
'students': [tempStudents[i - 1] for i in student_ids]
}
tempClasses.append(c)
return {
'success': True,
'errors': ['Class created.'],
'classes': [c]}
def add_student_to_class(_, info, id, student_id):
ids = get_student_ids()
if student_id not in ids:
return {
'success': False,
'errors': ['Student not found.'],
'class': None}
temp = None
for s in tempStudents:
if s['id'] == student_id:
temp = s
break
if temp is not None:
for c in tempClasses:
if c['id'] == id:
c['students'].append(temp)
return {
'success': True,
'errors': [],
'class': c}
return {'success': False,
'errors': ['Class not found.'],
'class': None}
else:
return {
'success': False,
'errors': ['Student not found.'],
'class': None
}
| temp_classes = []
temp_students = []
def student(_, info, id):
for s in tempStudents:
if s['id'] == id:
return s
return None
def students(_, info):
return {'success': True, 'errors': [], 'students': tempStudents}
def classes(_, info, id):
for c in tempClasses:
if c['id'] == id:
return c
return None
def all_classes(_, info):
return {'success': True, 'errors': ['All Classes found.'], 'classes': tempClasses}
def create_student(_, info, name, email):
if len(tempStudents) == 0:
id = 1
else:
id = tempStudents[-1]['id'] + 1
s = {'id': id, 'name': name, 'email': email}
tempStudents.append(s)
return {'success': True, 'errors': [], 'students': [s]}
def get_student_ids():
ids = []
for s in tempStudents:
ids.append(s['id'])
return ids
def create_class(_, info, name, student_ids):
ids = get_student_ids()
for id in student_ids:
if id not in ids:
return {'success': False, 'errors': ['Student of given id not found.'], 'classes': None}
if len(tempClasses) == 0:
id = 1
else:
id = tempClasses[-1]['id'] + 1
c = {'id': id, 'name': name, 'students': [tempStudents[i - 1] for i in student_ids]}
tempClasses.append(c)
return {'success': True, 'errors': ['Class created.'], 'classes': [c]}
def add_student_to_class(_, info, id, student_id):
ids = get_student_ids()
if student_id not in ids:
return {'success': False, 'errors': ['Student not found.'], 'class': None}
temp = None
for s in tempStudents:
if s['id'] == student_id:
temp = s
break
if temp is not None:
for c in tempClasses:
if c['id'] == id:
c['students'].append(temp)
return {'success': True, 'errors': [], 'class': c}
return {'success': False, 'errors': ['Class not found.'], 'class': None}
else:
return {'success': False, 'errors': ['Student not found.'], 'class': None} |
class WechatPayError(Exception):
pass
class APIError(WechatPayError):
pass
class ValidationError(APIError):
pass
class AuthenticationError(APIError):
pass
class RequestFailed(APIError):
pass
| class Wechatpayerror(Exception):
pass
class Apierror(WechatPayError):
pass
class Validationerror(APIError):
pass
class Authenticationerror(APIError):
pass
class Requestfailed(APIError):
pass |
# #1
# def count_red_beads(n):
# return 0 if n < 2 else (n - 1) * 2
def count_red_beads(n): # 2
return max(0, 2 * (n-1))
| def count_red_beads(n):
return max(0, 2 * (n - 1)) |
class SystemFonts(object):
""" Contains properties that expose the system resources that concern fonts. """
CaptionFontFamily=None
CaptionFontFamilyKey=None
CaptionFontSize=12.0
CaptionFontSizeKey=None
CaptionFontStyle=None
CaptionFontStyleKey=None
CaptionFontTextDecorations=None
CaptionFontTextDecorationsKey=None
CaptionFontWeight=None
CaptionFontWeightKey=None
IconFontFamily=None
IconFontFamilyKey=None
IconFontSize=12.0
IconFontSizeKey=None
IconFontStyle=None
IconFontStyleKey=None
IconFontTextDecorations=None
IconFontTextDecorationsKey=None
IconFontWeight=None
IconFontWeightKey=None
MenuFontFamily=None
MenuFontFamilyKey=None
MenuFontSize=12.0
MenuFontSizeKey=None
MenuFontStyle=None
MenuFontStyleKey=None
MenuFontTextDecorations=None
MenuFontTextDecorationsKey=None
MenuFontWeight=None
MenuFontWeightKey=None
MessageFontFamily=None
MessageFontFamilyKey=None
MessageFontSize=12.0
MessageFontSizeKey=None
MessageFontStyle=None
MessageFontStyleKey=None
MessageFontTextDecorations=None
MessageFontTextDecorationsKey=None
MessageFontWeight=None
MessageFontWeightKey=None
SmallCaptionFontFamily=None
SmallCaptionFontFamilyKey=None
SmallCaptionFontSize=12.0
SmallCaptionFontSizeKey=None
SmallCaptionFontStyle=None
SmallCaptionFontStyleKey=None
SmallCaptionFontTextDecorations=None
SmallCaptionFontTextDecorationsKey=None
SmallCaptionFontWeight=None
SmallCaptionFontWeightKey=None
StatusFontFamily=None
StatusFontFamilyKey=None
StatusFontSize=12.0
StatusFontSizeKey=None
StatusFontStyle=None
StatusFontStyleKey=None
StatusFontTextDecorations=None
StatusFontTextDecorationsKey=None
StatusFontWeight=None
StatusFontWeightKey=None
__all__=[]
| class Systemfonts(object):
""" Contains properties that expose the system resources that concern fonts. """
caption_font_family = None
caption_font_family_key = None
caption_font_size = 12.0
caption_font_size_key = None
caption_font_style = None
caption_font_style_key = None
caption_font_text_decorations = None
caption_font_text_decorations_key = None
caption_font_weight = None
caption_font_weight_key = None
icon_font_family = None
icon_font_family_key = None
icon_font_size = 12.0
icon_font_size_key = None
icon_font_style = None
icon_font_style_key = None
icon_font_text_decorations = None
icon_font_text_decorations_key = None
icon_font_weight = None
icon_font_weight_key = None
menu_font_family = None
menu_font_family_key = None
menu_font_size = 12.0
menu_font_size_key = None
menu_font_style = None
menu_font_style_key = None
menu_font_text_decorations = None
menu_font_text_decorations_key = None
menu_font_weight = None
menu_font_weight_key = None
message_font_family = None
message_font_family_key = None
message_font_size = 12.0
message_font_size_key = None
message_font_style = None
message_font_style_key = None
message_font_text_decorations = None
message_font_text_decorations_key = None
message_font_weight = None
message_font_weight_key = None
small_caption_font_family = None
small_caption_font_family_key = None
small_caption_font_size = 12.0
small_caption_font_size_key = None
small_caption_font_style = None
small_caption_font_style_key = None
small_caption_font_text_decorations = None
small_caption_font_text_decorations_key = None
small_caption_font_weight = None
small_caption_font_weight_key = None
status_font_family = None
status_font_family_key = None
status_font_size = 12.0
status_font_size_key = None
status_font_style = None
status_font_style_key = None
status_font_text_decorations = None
status_font_text_decorations_key = None
status_font_weight = None
status_font_weight_key = None
__all__ = [] |
class StringViewIter:
__slots__ = ("inp", "position")
def __init__(self, inp: str):
self.inp = inp
self.position = 0
def __iter__(self):
return self
def __next__(self):
if self.position >= len(self.inp):
raise StopIteration
self.position += 1
return self.inp[self.position - 1]
def peek(self):
return self.inp[self.position + 1]
def prev(self):
self.position -= 1
def format_lines(inp: str):
def indent_loop():
indent = 0
view = StringViewIter(inp)
for c in inp:
if c == "<":
yield "\n"
yield indent * " "
yield "<"
indent += 1
elif c == ">":
indent -= 1
for i in view:
if i != ">":
break
indent -= 1
yield ">"
view.prev()
yield ">"
else:
yield c
return "".join(indent_loop())
| class Stringviewiter:
__slots__ = ('inp', 'position')
def __init__(self, inp: str):
self.inp = inp
self.position = 0
def __iter__(self):
return self
def __next__(self):
if self.position >= len(self.inp):
raise StopIteration
self.position += 1
return self.inp[self.position - 1]
def peek(self):
return self.inp[self.position + 1]
def prev(self):
self.position -= 1
def format_lines(inp: str):
def indent_loop():
indent = 0
view = string_view_iter(inp)
for c in inp:
if c == '<':
yield '\n'
yield (indent * ' ')
yield '<'
indent += 1
elif c == '>':
indent -= 1
for i in view:
if i != '>':
break
indent -= 1
yield '>'
view.prev()
yield '>'
else:
yield c
return ''.join(indent_loop()) |
#paste your date in collections
collections = """28/03/2020
28/04/2020
28/05/2020
28/06/2020
28/07/2020
28/08/2020
28/10/2019
28/11/2019
28/12/2019
28/01/2020
28/02/2020
28/03/2020
28/04/2020
28/05/2020
28/06/2020
28/07/2020
28/08/2020
28/12/2019
28/01/2020
28/02/2020
28/03/2020
28/04/2020
28/05/2020
28/06/2020
28/07/2020
28/08/2020""".split("\n")
for item in collections:
new_item = item[6:]+item[2:5]+"/"+item[0:2]
print(f"CAST(N'{new_item}' as date)")
| collections = '28/03/2020\n28/04/2020\n28/05/2020\n28/06/2020\n28/07/2020\n28/08/2020\n28/10/2019\n28/11/2019\n28/12/2019\n28/01/2020\n28/02/2020\n28/03/2020\n28/04/2020\n28/05/2020\n28/06/2020\n28/07/2020\n28/08/2020\n28/12/2019\n28/01/2020\n28/02/2020\n28/03/2020\n28/04/2020\n28/05/2020\n28/06/2020\n28/07/2020\n28/08/2020'.split('\n')
for item in collections:
new_item = item[6:] + item[2:5] + '/' + item[0:2]
print(f"CAST(N'{new_item}' as date)") |
def check_fabs(matrix):
print(matrix)
s = set()
i = 0
while i < len(matrix):
if matrix[i][1] in s:
matrix[i][1] += 1
if matrix[i][1] == len(matrix):
matrix[i][1] = 0
else:
s.add(matrix[i][1])
i += 1
print(matrix)
print('\n')
def main():
check_fabs([[0, 0], [1, 0]])
check_fabs([[0, 1], [1, 1]])
check_fabs([[0, 1], [1, 0], [2, 0]])
check_fabs([[0, 1], [1, 0], [2, 0], [3, 0]])
check_fabs([[0, 1], [1, 2], [2, 2], [3, 1]])
if __name__ == "__main__":
main()
| def check_fabs(matrix):
print(matrix)
s = set()
i = 0
while i < len(matrix):
if matrix[i][1] in s:
matrix[i][1] += 1
if matrix[i][1] == len(matrix):
matrix[i][1] = 0
else:
s.add(matrix[i][1])
i += 1
print(matrix)
print('\n')
def main():
check_fabs([[0, 0], [1, 0]])
check_fabs([[0, 1], [1, 1]])
check_fabs([[0, 1], [1, 0], [2, 0]])
check_fabs([[0, 1], [1, 0], [2, 0], [3, 0]])
check_fabs([[0, 1], [1, 2], [2, 2], [3, 1]])
if __name__ == '__main__':
main() |
# Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai).
# n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0).
# Find two lines, which together with x-axis forms a container, such that the container contains the most water.
# Note: You may not slant the container and n is at least 2.
# Example:
# Input: [1,8,6,2,5,4,8,3,7]
# Output: 49
class Solution(object):
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
if len(height) == 2:
return min(height[0], height[1])
# Using double pointer
left_p, right_p = 0, len(height) - 1
max_volumn = 0
while left_p < right_p:
max_volumn = max(max_volumn, min(height[left_p], height[right_p]) * (right_p - left_p))
if height[left_p] <= height[right_p]:
left_p += 1
else:
right_p -= 1
return max_volumn | class Solution(object):
def max_area(self, height):
"""
:type height: List[int]
:rtype: int
"""
if len(height) == 2:
return min(height[0], height[1])
(left_p, right_p) = (0, len(height) - 1)
max_volumn = 0
while left_p < right_p:
max_volumn = max(max_volumn, min(height[left_p], height[right_p]) * (right_p - left_p))
if height[left_p] <= height[right_p]:
left_p += 1
else:
right_p -= 1
return max_volumn |
#Entering Input
n = int(input("Enter the no of elements in List: "))
print(f"Enter the List of {n} numbers: ")
myList = []
for num in range (n):
myList.append(int(input()))
print (myList)
#Finding the largest Number
larNo = myList[0]
for num in range(0,n-1):
if larNo < myList[num+1]:
larNo = myList[num+1]
print ("The Largest Number: ", larNo)
#Finding the Second largest Number
myNList = myList.copy()
myNList.pop(myNList.index(larNo))
n = len(myNList)
slarNo = myNList[0]
for num in range(0,n -1):
if slarNo < myNList[num+1]:
slarNo = myNList[num+1]
print ("The Second-Largest Number: ",slarNo)
#Sorting
n = len(myList)
for i in range(n):
for j in range (0, n-i-1):
if myList[j] > myList[j + 1]:
myList[j], myList[j+1] = myList[j+1], myList[j]
print ("Sorted List: ", myList)
print ("Largest Number : ",myList[-1],", Second-Largest Number: ",myList[-2])
| n = int(input('Enter the no of elements in List: '))
print(f'Enter the List of {n} numbers: ')
my_list = []
for num in range(n):
myList.append(int(input()))
print(myList)
lar_no = myList[0]
for num in range(0, n - 1):
if larNo < myList[num + 1]:
lar_no = myList[num + 1]
print('The Largest Number: ', larNo)
my_n_list = myList.copy()
myNList.pop(myNList.index(larNo))
n = len(myNList)
slar_no = myNList[0]
for num in range(0, n - 1):
if slarNo < myNList[num + 1]:
slar_no = myNList[num + 1]
print('The Second-Largest Number: ', slarNo)
n = len(myList)
for i in range(n):
for j in range(0, n - i - 1):
if myList[j] > myList[j + 1]:
(myList[j], myList[j + 1]) = (myList[j + 1], myList[j])
print('Sorted List: ', myList)
print('Largest Number : ', myList[-1], ', Second-Largest Number: ', myList[-2]) |
resultado=""
K=int(input())
if K>0 and K<=1000:
while K!=0:
N,M=list(map(int, input().split()))
if N>-10000 or M<10000:
for x in range(K):
X,Y=list(map(int, input().split()))
if X>=-10000 or Y<=10000:
if X<N and Y>M:
resultado += "NO\n"
elif X>N and Y>M:
resultado += "NE\n"
elif X>N and Y<M:
resultado += "SE\n"
elif X<N and Y<M:
resultado += "SO\n"
elif X==N or Y==M:
resultado += "divisa\n"
K=int(input())
print(resultado) | resultado = ''
k = int(input())
if K > 0 and K <= 1000:
while K != 0:
(n, m) = list(map(int, input().split()))
if N > -10000 or M < 10000:
for x in range(K):
(x, y) = list(map(int, input().split()))
if X >= -10000 or Y <= 10000:
if X < N and Y > M:
resultado += 'NO\n'
elif X > N and Y > M:
resultado += 'NE\n'
elif X > N and Y < M:
resultado += 'SE\n'
elif X < N and Y < M:
resultado += 'SO\n'
elif X == N or Y == M:
resultado += 'divisa\n'
k = int(input())
print(resultado) |
"""Provides the repository macro to import LLVM."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def repo():
"""Imports LLVM."""
XED_COMMIT = "5976632eeaaaad7890c2109d0cfaf4012eaca3b8"
XED_SHA256 = "8cc7c3ee378a8827e760e71ecf6642a814f0a991d768a120df5f177323b692e6"
MBUILD_COMMIT = "3e8eb33aada4153c21c4261b35e5f51f6e2019e8"
MBUILD_SHA256 = "bbbff8cccbb56d9614f6fa163f1546a1619fe331030c4f92db6387e63a88ba41"
http_archive(
name = "com_github_intelxed_mbuild",
sha256 = MBUILD_SHA256,
strip_prefix = "mbuild-{commit}".format(commit = MBUILD_COMMIT),
urls = [
"https://github.com/intelxed/mbuild/archive/{commit}.tar.gz".format(commit = MBUILD_COMMIT),
],
build_file = "//third_party/xed:mbuild.BUILD",
patches = [
"//third_party/xed:mbuild_abs_compiler_path.patch"
]
)
http_archive(
name = "com_github_intelxed_xed",
sha256 = XED_SHA256,
strip_prefix = "xed-{commit}".format(commit = XED_COMMIT),
urls = [
"https://github.com/intelxed/xed/archive/{commit}.tar.gz".format(commit = XED_COMMIT),
],
build_file = "//third_party/xed:xed.BUILD",
)
| """Provides the repository macro to import LLVM."""
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')
def repo():
"""Imports LLVM."""
xed_commit = '5976632eeaaaad7890c2109d0cfaf4012eaca3b8'
xed_sha256 = '8cc7c3ee378a8827e760e71ecf6642a814f0a991d768a120df5f177323b692e6'
mbuild_commit = '3e8eb33aada4153c21c4261b35e5f51f6e2019e8'
mbuild_sha256 = 'bbbff8cccbb56d9614f6fa163f1546a1619fe331030c4f92db6387e63a88ba41'
http_archive(name='com_github_intelxed_mbuild', sha256=MBUILD_SHA256, strip_prefix='mbuild-{commit}'.format(commit=MBUILD_COMMIT), urls=['https://github.com/intelxed/mbuild/archive/{commit}.tar.gz'.format(commit=MBUILD_COMMIT)], build_file='//third_party/xed:mbuild.BUILD', patches=['//third_party/xed:mbuild_abs_compiler_path.patch'])
http_archive(name='com_github_intelxed_xed', sha256=XED_SHA256, strip_prefix='xed-{commit}'.format(commit=XED_COMMIT), urls=['https://github.com/intelxed/xed/archive/{commit}.tar.gz'.format(commit=XED_COMMIT)], build_file='//third_party/xed:xed.BUILD') |
print("Welcome to the tip calculator.")
bill = float(input("What was your total? $"))
tip = int(input("What percentage tip would you like to give? 10, 12 or 15? "))
people = int(input("How many people to split the bill? "))
bill_with_tip = ((tip /100 ) * bill + bill) / people
final_bill = round(bill_with_tip,2)
# print(type(final_bill))
print(f"Each person should pay: ${final_bill}")
| print('Welcome to the tip calculator.')
bill = float(input('What was your total? $'))
tip = int(input('What percentage tip would you like to give? 10, 12 or 15? '))
people = int(input('How many people to split the bill? '))
bill_with_tip = (tip / 100 * bill + bill) / people
final_bill = round(bill_with_tip, 2)
print(f'Each person should pay: ${final_bill}') |
def distance(strand_a, strand_b):
try:
if strand_a == strand_b:
return 0
else:
count = 0
total = 0
while count < len(strand_a):
if strand_a[count] != strand_b[count]:
total = total + 1
count += 1
return total
except:
print("Invalid Input!")
"""
def distance(strand_a, strand_b):
if len(strand_a) != len(strand_b):
raise ValueErroe("Lengths of strands must be the same.")
return sum(1 for x, y in zip(strand_a, strand_b) if x != y)
""" | def distance(strand_a, strand_b):
try:
if strand_a == strand_b:
return 0
else:
count = 0
total = 0
while count < len(strand_a):
if strand_a[count] != strand_b[count]:
total = total + 1
count += 1
return total
except:
print('Invalid Input!')
'\ndef distance(strand_a, strand_b):\n if len(strand_a) != len(strand_b):\n raise ValueErroe("Lengths of strands must be the same.")\n return sum(1 for x, y in zip(strand_a, strand_b) if x != y)\n' |
# Initial state.
a = 1
b = c = d = e = f = g = h = 0
b = 67
c = b
# if a != 0 goto ANZ # jnz a 2
# When a was 0, this would skip the next 4 lines
# jnz 1 5
# ANZ
b = b * 100 # (6700) # mul b 100 #1
b -= -100000 # sub b -100000 # 2
c = b # set c b # 3
c -= -17000 # sub c -17000 # 4
# b = 106700
# c = 123700
# -23
while True:
f = 1
d = 2
while True:
e = 2
# if (somehow) (d * e == b, then we'll set f=0 and increment h.
# no need to inc e to figure out.
if b % d == 0:
f = 0
e = b
# while True:
# # this loops until e == b.
# # g = d
# # g *= e
# # g -= b
# if d * e == b:
# # jnz g 2
# # set f 0 (skipped when g not zero)
# f = 0
# e += 1 # sub e -1
# if e == b:
# break
# jnz g -8
d += 1 # sub d -1
g = d # set g d
g -= b # sub g b
if d == b:
break
# jnz g -13
if f == 0:
# jnz f 2
h -= -1 #sub h -1
# When b == c this ends
# g = b # set g b
# g -= c # sub g c
if b == c:
# jnz g 2
# jnz 1 3 # FINISHES
print(h) # 905
assert False
b -= -17 # sub b -17 --- after 1000 iterations, b == c
# Always jumps - jnz 1 -23
# 1000 too high | a = 1
b = c = d = e = f = g = h = 0
b = 67
c = b
b = b * 100
b -= -100000
c = b
c -= -17000
while True:
f = 1
d = 2
while True:
e = 2
if b % d == 0:
f = 0
e = b
d += 1
g = d
g -= b
if d == b:
break
if f == 0:
h -= -1
if b == c:
print(h)
assert False
b -= -17 |
#Embedded file name: ACEStream\__init__.pyo
LIBRARYNAME = 'ACEStream'
DEFAULT_I2I_LISTENPORT = 0
DEFAULT_SESSION_LISTENPORT = 8621
DEFAULT_HTTP_LISTENPORT = 6878
| libraryname = 'ACEStream'
default_i2_i_listenport = 0
default_session_listenport = 8621
default_http_listenport = 6878 |
list1 = list()
list2 = ['a', 25, 'string', 14.03]
list3 = list((1,2,3,4)) # list(tuple)
print (list1)
print (list2)
print (list3)
# List Comprehension
list4 = [x for x in range(10)]
print (list4)
list5 = [x**2 for x in range(10) if x > 4]
print (list5)
# del(): delete list item or list itself
list6 = ['sugar', 'rice', 'tea', 'cup']
del (list6[1])
print (list6)
# below line will delete the list
del (list6)
list7 = ['sugar', 'tea', 'cup']
list7.append('ginger')
print (list7)
# extend(): add 2 list together
list8 = ['coffee', 'crush']
list7.extend(list8)
# list7 += list8
print (list7)
print (list8)
# insert(): inster item at given index and push rest forward
list9 = [5, 3, 7, 4, 9]
list9.insert(0, 100)
list9.insert(len(list9), 999)
print (list9)
list9.insert(1, ['One', 'Two'])
print (list9)
# pop(): pop the top item from list
list10 = [5, 3, 7, 4, 9]
list10.pop()
list10.pop()
print (list10)
# remove(): only remove 1st occurance of item
list11 = [5, 3, 7, 4, 9, 3, 7]
list11.remove(3)
print (list11)
# reverse(): reverse the list item
list12 = [5, 3, 7, 4, 9, ]
list12.reverse()
print (list12)
# sort(): sort the list item, unlike sorted() this will sort the existing list.
list13 = [5, 3, 7, 4, 9, ]
list13.sort()
print (list13)
| list1 = list()
list2 = ['a', 25, 'string', 14.03]
list3 = list((1, 2, 3, 4))
print(list1)
print(list2)
print(list3)
list4 = [x for x in range(10)]
print(list4)
list5 = [x ** 2 for x in range(10) if x > 4]
print(list5)
list6 = ['sugar', 'rice', 'tea', 'cup']
del list6[1]
print(list6)
del list6
list7 = ['sugar', 'tea', 'cup']
list7.append('ginger')
print(list7)
list8 = ['coffee', 'crush']
list7.extend(list8)
print(list7)
print(list8)
list9 = [5, 3, 7, 4, 9]
list9.insert(0, 100)
list9.insert(len(list9), 999)
print(list9)
list9.insert(1, ['One', 'Two'])
print(list9)
list10 = [5, 3, 7, 4, 9]
list10.pop()
list10.pop()
print(list10)
list11 = [5, 3, 7, 4, 9, 3, 7]
list11.remove(3)
print(list11)
list12 = [5, 3, 7, 4, 9]
list12.reverse()
print(list12)
list13 = [5, 3, 7, 4, 9]
list13.sort()
print(list13) |
project='pbdcex'
version='0.1.1'
debug = 1 #0/1
defs = []
verbose = 'on' #on/off
extra_c_flags = '-wno-unused-parameter'
extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl'
env = {
'protoi':'/usr/local/include',
'protoc':'protoc',
'protoi':'/usr/local/include',
}
units = [
{
'name':'pbdcexer',
'type':'exe',
'subdir':'src',
'incs':['{{root}}/..'],
'lincs':['{{root}}/../dcpots/lib','{{root}}/../cxxtemplates/lib'],
'libs':['dcutil-drs','dcutil-mysql','dcbase','mysqlclient','protobuf','xctmp','pbjson'],
'objs':[
{
'name':'pbdcex',
'srcs':['pbdcex.cpp','mysql_gen.cpp','cpp_gen.cpp'],
},
],
},
{
'name':'htest',
'subdir':'test',
'type':'exe',
'dsrcs': ['proto'],
'srcs':['proto/test.pb.cc','proto/test.cex.hpp'],
'incs':['{{cdir}}/proto','../dcpots/utility/drs','{{root}}/src','{{root}}/../'],
'lincs':['{{root}}/lib','{{root}}/../dcpots/lib'],
'libs' : [
'pbdcex',
'dcutil-drs',
'dcbase',
'mysqlclient',
'pbjson',
'protobuf',
],
'objs': [{
'out':'{{cdir}}/proto/test.pb.cc',
'dep':'{{cdir}}/proto/test.proto',
'cmd':'{{protoc}} {{cdir}}/proto/test.proto -I{{root}}/../dcpots/utility/drs -I{{cdir}}/proto -I{{protoi}} --cpp_out={{cdir}}/proto/'
},
{
'out':'{{cdir}}/proto/test.cex.hpp',
'dep':'{{cdir}}/proto/test.proto',
'cmd':'{{root}}/bin/pbdcexer -mHello -ptest.proto -I{{root}}/../dcpots/utility/drs -I{{cdir}}/proto -I{{protoi}} --cpp_out={{cdir}}/proto/'
},
{
'name':'sql',
'out':'{{cdir}}/proto/DBPlayer.sql',
'dep':'{{cdir}}/proto/test.proto',
'cmd':'{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;'\
'{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;'\
'{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;'
},
]
}
]
| project = 'pbdcex'
version = '0.1.1'
debug = 1
defs = []
verbose = 'on'
extra_c_flags = '-wno-unused-parameter'
extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl'
env = {'protoi': '/usr/local/include', 'protoc': 'protoc', 'protoi': '/usr/local/include'}
units = [{'name': 'pbdcexer', 'type': 'exe', 'subdir': 'src', 'incs': ['{{root}}/..'], 'lincs': ['{{root}}/../dcpots/lib', '{{root}}/../cxxtemplates/lib'], 'libs': ['dcutil-drs', 'dcutil-mysql', 'dcbase', 'mysqlclient', 'protobuf', 'xctmp', 'pbjson'], 'objs': [{'name': 'pbdcex', 'srcs': ['pbdcex.cpp', 'mysql_gen.cpp', 'cpp_gen.cpp']}]}, {'name': 'htest', 'subdir': 'test', 'type': 'exe', 'dsrcs': ['proto'], 'srcs': ['proto/test.pb.cc', 'proto/test.cex.hpp'], 'incs': ['{{cdir}}/proto', '../dcpots/utility/drs', '{{root}}/src', '{{root}}/../'], 'lincs': ['{{root}}/lib', '{{root}}/../dcpots/lib'], 'libs': ['pbdcex', 'dcutil-drs', 'dcbase', 'mysqlclient', 'pbjson', 'protobuf'], 'objs': [{'out': '{{cdir}}/proto/test.pb.cc', 'dep': '{{cdir}}/proto/test.proto', 'cmd': '{{protoc}} {{cdir}}/proto/test.proto -I{{root}}/../dcpots/utility/drs -I{{cdir}}/proto -I{{protoi}} --cpp_out={{cdir}}/proto/'}, {'out': '{{cdir}}/proto/test.cex.hpp', 'dep': '{{cdir}}/proto/test.proto', 'cmd': '{{root}}/bin/pbdcexer -mHello -ptest.proto -I{{root}}/../dcpots/utility/drs -I{{cdir}}/proto -I{{protoi}} --cpp_out={{cdir}}/proto/'}, {'name': 'sql', 'out': '{{cdir}}/proto/DBPlayer.sql', 'dep': '{{cdir}}/proto/test.proto', 'cmd': '{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;{{protoc}} -p{{cdir}}/proto/test.proto -mDBPlayer -mDBHello --sql_out={{cdir}}/proto -I{{cdir}}/proto -I{{protoi}} -I{{dcpotsi}}/dcpots/utility/drs;'}]}] |
#
# PySNMP MIB module NRC-HUB1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NRC-HUB1-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:24:24 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, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, IpAddress, Integer32, NotificationType, Counter32, iso, Counter64, ModuleIdentity, Gauge32, MibIdentifier, ObjectIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "IpAddress", "Integer32", "NotificationType", "Counter32", "iso", "Counter64", "ModuleIdentity", "Gauge32", "MibIdentifier", "ObjectIdentity", "Unsigned32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
enterprises = MibIdentifier((1, 3, 6, 1, 4, 1))
nrc = MibIdentifier((1, 3, 6, 1, 4, 1, 315))
hub1 = MibIdentifier((1, 3, 6, 1, 4, 1, 315, 1))
hub1AutoPartition = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1AutoPartition.setStatus('mandatory')
if mibBuilder.loadTexts: hub1AutoPartition.setDescription("The value 'enabled' indicates that the HUB should auto partition ports. The value 'disabled' will disable this feature.")
hub1ReconnectOnTransmission = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1ReconnectOnTransmission.setStatus('mandatory')
if mibBuilder.loadTexts: hub1ReconnectOnTransmission.setDescription("The value 'enabled' indicates that the HUB will reconnect an auto partitioned port if the HUB receives a packet from a partitioned port. The value 'disabled' indicates that the HUB will reconnect a partitioned port if there is any traffic to or from the port.")
hub1IncludeOutOfWinColl = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1IncludeOutOfWinColl.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IncludeOutOfWinColl.setDescription("A value of 'enabled' will cause Out Of Window Collisions to be counted along with In Window Collisions (as defined by IEEE 802.3) when determining if the collision count has exceeded hub1CollisionLimit and a port should be auto partitioned. A value of 'disabled' indicates that Out Of Window Collisions should NOT be counted when determining if the collision count has exceeded hub1CollisionLimit and a and a port should be auto partitioned.")
hub1LoopbackPartition = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1LoopbackPartition.setStatus('mandatory')
if mibBuilder.loadTexts: hub1LoopbackPartition.setDescription("A value of 'enabled' will cause the HUB to automatically partition a port where a lack of loopback from the transeiver is detected. A value of 'disabled' will disable this feature. Note: Setting this variable will only effect HUB operation when hub1PortType value equals 'thinNet-10Base2'. For all other hub1PortType values, a value of 'enabled' will have no effect.")
hub1CollisionLimit = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(31, 63))).clone(namedValues=NamedValues(("low", 31), ("high", 63)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1CollisionLimit.setStatus('mandatory')
if mibBuilder.loadTexts: hub1CollisionLimit.setDescription('If consecutive collisions exceeding the value of this variable are detected on a port, the port will be auto partitioned 31 is the IEEE 802.3 consecutive collision limit.')
hub1CarrierRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 5))).clone(namedValues=NamedValues(("short", 3), ("long", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1CarrierRecoverTime.setStatus('mandatory')
if mibBuilder.loadTexts: hub1CarrierRecoverTime.setDescription("Time to recover carrier. A value of 'short' will use 3 bit times (IEEE 802.3 specification). A value of 'long' will use 5 bit times.")
hub1EventCounterFlags = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1EventCounterFlags.setStatus('mandatory')
if mibBuilder.loadTexts: hub1EventCounterFlags.setDescription("A bit mask indicating which error types will cause an increment in the hub1PortEventCount Counter. Each bit has the following significance where each bit is listed from most significant bit of the first octet, to least significant bit of the second octet. High (first) Octet bit 8 - not used - 7 - not used - 6 Out Of Window Collision Count Enable 5 Receive Collision Count Enable 4 Transmit Collision Count Enable 3 - not used - 2 - not used - 1 - not used - Low (second) Octet bit 8 Bad Link Count Enable 7 Partition Count Enable 6 Receive Count Enable 5 Pygmy Packet Enable 4 Non SFD Enable 3 Phase Lock Error Enable 2 Elasticity Buffer Error Enable 1 Jabber Enable When setting the value of this variable, the entire bit mask must be specified and the '-not used-' bits must not be set.")
hub1EventRecordFlags = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1EventRecordFlags.setStatus('mandatory')
if mibBuilder.loadTexts: hub1EventRecordFlags.setDescription("A bit mask indicating which error types will cause corresponding bits in hub1PortEventRecordValue to be set when an error is detected. Each bit has the following significance where bits are listed from most significant bit to least significant bit. bit 8 Bad Link Enable 7 Partition Enable 6 Out Of Window Collision Enable 5 Pygmy Packet Enable 4 Non SFD Enable 3 Phase Lock Error Enable 2 Elasticity Buffer Error Enable 1 Jabber Enable When a particular bit is set, all ports will start to log the specified error in the hub1PortEventRecordValue column of the port's row of the hub1PortTable. For example, if bit 1 (Jabber Enable) is set, then for every port, a detected Jabber Error would cause bit 1 of hub1PortEventRecordValue to be set. When setting the value of this variable, the entire bit mask must be specified. When this mask is set, hub1PortRecordValue for all ports is cleared.")
hub1BridgingMode = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("bridging", 1), ("bypass", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1BridgingMode.setStatus('mandatory')
if mibBuilder.loadTexts: hub1BridgingMode.setDescription("Operational mode of the bridge: bridging Packets are being selectively forwarded according to the internal dynamically built tables. bypass All packets are being repeated between the backbone and the repeater ports. The bridge logic is disabled. After setting this variable the HUB must be reset for the new value to take effect. NOTE: FOIRL Hubs can only have the value 'bypass' for this variable. Attempts to set this variable to 'bridging' on FOIRL hubs will be rejected.")
hub1ProtocolFilterMode = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("filter", 2), ("pass", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1ProtocolFilterMode.setStatus('mandatory')
if mibBuilder.loadTexts: hub1ProtocolFilterMode.setDescription('Filtering Mode of the Hub: off The protocol filtering logic is disabled. filter The protocol filtering logic is enabled and packets with the protocol types indicated in hubFilterProtocols will not be forwarded by the bridge. pass The packet filtering logic is enabled and packets with the protocol types indicated in hubFilterProtocols will be the ONLY packets that the bridge will forward.')
hub1FilterProtocols = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1FilterProtocols.setStatus('mandatory')
if mibBuilder.loadTexts: hub1FilterProtocols.setDescription('Protocol types to be filtered or passed by the bridging logic. This is a variable length array of between 0 and 16 2-byte entries, each entry containing the 2-byte protocol identifier as seen in the Ethernet header. Attempts to configure this variable with an OCTET STRING of odd length will be rejected.')
hub1ConsoleBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 12), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1ConsoleBaudRate.setStatus('mandatory')
if mibBuilder.loadTexts: hub1ConsoleBaudRate.setDescription('The baud rate of the console port. Legal values are 9600, 4800, 2400, and 1200.')
hub1Reset = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-reset", 1), ("reset", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1Reset.setStatus('mandatory')
if mibBuilder.loadTexts: hub1Reset.setDescription("Setting this object to 'reset' will cause the Hub1 to perform a hardware reset within approximately 5 seconds. Setting this object to 'no-reset will have no effect. The value 'no-reset will be returned whenever this object is retrieved. The primary purpose for including this variable in the Hub1 MIB is to allow SNMP managers to modify the operational mode of the Hub1. Changing the variable hub1BridgingMode has no effect on the Hub until the Hub is reset.")
hub1SoftwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1SoftwareVersion.setStatus('mandatory')
if mibBuilder.loadTexts: hub1SoftwareVersion.setDescription("The version of software running on the Hub. On versions of the Hub that support dynamic download, this variable may be set to cause a new version of the software to be loaded the next time the Hub is reset (as in setting the variable hub1Reset or power cycling the unit). The version should be specified in the following format: 'MM.mm.rr' Where MM is the major number, mm is the minor number, and rr is the revision level (for example 2.0.16). On versions of the Hub that do not support dynamic download, setting this variable will result in an error.")
hub1PortTable = MibTable((1, 3, 6, 1, 4, 1, 315, 1, 15), )
if mibBuilder.loadTexts: hub1PortTable.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortTable.setDescription('A table of port specific information for the NRC HUB 1 product. This table supplements the Repeater MIB Ports Table.')
hub1PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 315, 1, 15, 1), ).setIndexNames((0, "NRC-HUB1-MIB", "hub1PortIndex"))
if mibBuilder.loadTexts: hub1PortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortEntry.setDescription('A list of information for every port.')
hub1PortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 24))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortIndex.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortIndex.setDescription('Port number that corresponds to the index value in the Repeater MIB variable rptrPortIndex.')
hub1PortForceReconnect = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("idle", 1), ("force-reconnect", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1PortForceReconnect.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortForceReconnect.setDescription("Setting this variable to the value 'force- reconnect' will cause the port to be reconnected assuming that it is currently in the 'Partition' state. If the port is not in a 'Partition' state, setting variable to the value 'force-reconnect' will not have any effect. Setting this variable to anything other than 'force- reconnect will and an undefined effect. When retrieving this variable, the value 'idle' will always be returned.")
hub1PortPartitionReason = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("not-partitioned", 1), ("other", 2), ("consecutive-collision-limit", 3), ("excessive-len-of-collision-limit", 4), ("data-loopback-failure", 5), ("process-forced-reconnection", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortPartitionReason.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortPartitionReason.setDescription("Reason for port being in the partitioned state. If the port is currently not partitioned, this variable will have the value 'not-partitioned'.")
hub1PortLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("up", 2), ("down", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortLinkState.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortLinkState.setDescription("This variable's meaning varies depending on the type of HUB: 10Base2 Not Applicable. A value of 'unknown' will always be returned. 10BaseT Link Test is being received ('up') or not being received ('down'). Fiber Light Monitoring (LMON) is being detected ('up') or not being detected ('down').")
hub1PortLinkEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1PortLinkEnable.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortLinkEnable.setDescription('Enabling this variable has the following effect depending on the type of HUB: 10Base2 No Effect 10BaseT Link Test Enabled Fiber LMON Test Enabled')
hub1PortPolarityStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("reversed", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortPolarityStatus.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortPolarityStatus.setDescription("Current port Polarity status. NOTE: a value of 'ok' will always be returned for 10Base2 and FOIRL HUBs")
hub1PortName = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hub1PortName.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortName.setDescription('Administrator assigned ASCII port name.')
hub1PortEventCount = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortEventCount.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortEventCount.setDescription('Counter of all error events that were detected on this port and at the same time were marked for collection in the hub1EventCounterFlags variable. This is a 16 bit wrapping counter.')
hub1PortRecordValue = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortRecordValue.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortRecordValue.setDescription('Bit Mask that has bits set for each error event that was detected on this port and at the same time was marked for collection in the hub1EventRecordFlags variable. Each bit has the following meaning, where the bits are listed from most significant to least significant: bit 8 Bad Link Count Error 7 Partition Count Error 6 Receive Count Error 5 Pygmy Packet Error 4 Non SFD Error 3 Phase Lock Error 2 Elasticity Buffer Error 1 Jabber Error Each read of this variable causes the variable to be cleared.')
hub1PortType = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("twistedPair-10BaseT", 2), ("thinNet-10Base2", 3), ("fiber-FOIRL", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1PortType.setStatus('mandatory')
if mibBuilder.loadTexts: hub1PortType.setDescription('The type of port')
hub1IFTable = MibTable((1, 3, 6, 1, 4, 1, 315, 1, 16), )
if mibBuilder.loadTexts: hub1IFTable.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFTable.setDescription('A table that contains HUB 1 specific supplements to the MIB-II interfaces table.')
hub1IFEntry = MibTableRow((1, 3, 6, 1, 4, 1, 315, 1, 16, 1), ).setIndexNames((0, "NRC-HUB1-MIB", "hub1IFIndex"))
if mibBuilder.loadTexts: hub1IFEntry.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFEntry.setDescription('Entries in the HUB 1 supplement table.')
hub1IFIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFIndex.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFIndex.setDescription('Interface index that corresponds to ifIndex in the interfaces table from MIB II.')
hub1IFInAlignmentErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInAlignmentErrors.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInAlignmentErrors.setDescription('The number of alignment errors detected by this interface.')
hub1IFInCrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInCrcErrors.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInCrcErrors.setDescription('The number of CRC errors detected by this interface.')
hub1IFInCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInCollisions.setDescription('The number of collisions detected by this interface.')
hub1IFInMtuExceededDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInMtuExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInMtuExceededDiscards.setDescription('The number of frames discarded by this interface on receive due to an excessive size.')
hub1IFInShortErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInShortErrors.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInShortErrors.setDescription('The number of frames discarded by this interface because they were less than the Ethernet minumum frame size of 64 bytes.')
hub1IFInOverrunDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFInOverrunDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFInOverrunDiscards.setDescription('The number of frames discarded by this interface due to a LAN Controller FIFO overflow on receive.')
hub1IFOutUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFOutUnderruns.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFOutUnderruns.setDescription('The number of frames which had to be retransmitted by this interface due to a LAN Controller FIFO underrun error on transmit.')
hub1IFOutLostCts = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFOutLostCts.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFOutLostCts.setDescription('The number of times Carrier Transmit Sense (CTS) was lost on this interface during frame transmission. The hub will attempt to retransmit frames when transmission fails due to lost CTS.')
hub1IFOutLostCrs = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFOutLostCrs.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFOutLostCrs.setDescription('The number of times Carrier Receive Sense (CRS) was lost on this interface during frame transmission. The hub will attempt to retransmit frames when transmission fails due to lost CRS.')
hub1IFOutMtuExceededDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFOutMtuExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFOutMtuExceededDiscards.setDescription('The number of frames discarded by this interface on transmit due to an excessive size.')
hub1IFOutCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFOutCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFOutCollisions.setDescription('The number of collisions detected by this interface while attempting to transmit a packet.')
hub1IFChannelUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(90, 90)).setFixedLength(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1IFChannelUtilization.setStatus('mandatory')
if mibBuilder.loadTexts: hub1IFChannelUtilization.setDescription('Utilization statistics for the last 60 seconds of operation of the bridging logic associated with this interface. The OCTET STRING is a series of 45 16-bit words, each word representing the percentage utilization for a 1.33 second sample period. The first 16 bit word in this series represents the oldest sample. Percentages are calculated by passing each 16 bit sample through the following equation: ((Sample) * 100) / 0xffff to yield the percent channel utilization (a number ranging from 0 to 100).')
hub1LastFailureReason = MibScalar((1, 3, 6, 1, 4, 1, 315, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hub1LastFailureReason.setStatus('mandatory')
if mibBuilder.loadTexts: hub1LastFailureReason.setDescription('The last error that caused a Hub failure. A value of zero (0) indicates that there has not been a Hub failure since the novram was last erased. A non-zero value indicates the reason for the last Hub failure. A normal Hub reset or power cycle will not change the value of this variable (it will still indicate the reason for the last known failure.')
mibBuilder.exportSymbols("NRC-HUB1-MIB", hub1PortForceReconnect=hub1PortForceReconnect, hub1LastFailureReason=hub1LastFailureReason, hub1PortType=hub1PortType, hub1PortRecordValue=hub1PortRecordValue, hub1IFOutUnderruns=hub1IFOutUnderruns, hub1IFInOverrunDiscards=hub1IFInOverrunDiscards, hub1PortPolarityStatus=hub1PortPolarityStatus, hub1IFOutLostCrs=hub1IFOutLostCrs, hub1IFTable=hub1IFTable, hub1=hub1, hub1PortLinkState=hub1PortLinkState, hub1FilterProtocols=hub1FilterProtocols, hub1PortEventCount=hub1PortEventCount, enterprises=enterprises, hub1IFEntry=hub1IFEntry, hub1PortLinkEnable=hub1PortLinkEnable, hub1IFChannelUtilization=hub1IFChannelUtilization, hub1ConsoleBaudRate=hub1ConsoleBaudRate, hub1EventRecordFlags=hub1EventRecordFlags, hub1PortName=hub1PortName, hub1SoftwareVersion=hub1SoftwareVersion, hub1CollisionLimit=hub1CollisionLimit, hub1IFOutLostCts=hub1IFOutLostCts, hub1IFInCollisions=hub1IFInCollisions, hub1IFInMtuExceededDiscards=hub1IFInMtuExceededDiscards, hub1EventCounterFlags=hub1EventCounterFlags, hub1Reset=hub1Reset, hub1AutoPartition=hub1AutoPartition, hub1CarrierRecoverTime=hub1CarrierRecoverTime, hub1IFOutCollisions=hub1IFOutCollisions, hub1LoopbackPartition=hub1LoopbackPartition, hub1IFInShortErrors=hub1IFInShortErrors, hub1ProtocolFilterMode=hub1ProtocolFilterMode, hub1IFInCrcErrors=hub1IFInCrcErrors, nrc=nrc, hub1PortIndex=hub1PortIndex, hub1ReconnectOnTransmission=hub1ReconnectOnTransmission, hub1PortEntry=hub1PortEntry, hub1BridgingMode=hub1BridgingMode, hub1IFOutMtuExceededDiscards=hub1IFOutMtuExceededDiscards, hub1PortPartitionReason=hub1PortPartitionReason, hub1IFIndex=hub1IFIndex, hub1IFInAlignmentErrors=hub1IFInAlignmentErrors, hub1IncludeOutOfWinColl=hub1IncludeOutOfWinColl, hub1PortTable=hub1PortTable)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_intersection, value_size_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, ip_address, integer32, notification_type, counter32, iso, counter64, module_identity, gauge32, mib_identifier, object_identity, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'IpAddress', 'Integer32', 'NotificationType', 'Counter32', 'iso', 'Counter64', 'ModuleIdentity', 'Gauge32', 'MibIdentifier', 'ObjectIdentity', 'Unsigned32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
enterprises = mib_identifier((1, 3, 6, 1, 4, 1))
nrc = mib_identifier((1, 3, 6, 1, 4, 1, 315))
hub1 = mib_identifier((1, 3, 6, 1, 4, 1, 315, 1))
hub1_auto_partition = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1AutoPartition.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1AutoPartition.setDescription("The value 'enabled' indicates that the HUB should auto partition ports. The value 'disabled' will disable this feature.")
hub1_reconnect_on_transmission = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1ReconnectOnTransmission.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1ReconnectOnTransmission.setDescription("The value 'enabled' indicates that the HUB will reconnect an auto partitioned port if the HUB receives a packet from a partitioned port. The value 'disabled' indicates that the HUB will reconnect a partitioned port if there is any traffic to or from the port.")
hub1_include_out_of_win_coll = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1IncludeOutOfWinColl.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IncludeOutOfWinColl.setDescription("A value of 'enabled' will cause Out Of Window Collisions to be counted along with In Window Collisions (as defined by IEEE 802.3) when determining if the collision count has exceeded hub1CollisionLimit and a port should be auto partitioned. A value of 'disabled' indicates that Out Of Window Collisions should NOT be counted when determining if the collision count has exceeded hub1CollisionLimit and a and a port should be auto partitioned.")
hub1_loopback_partition = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1LoopbackPartition.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1LoopbackPartition.setDescription("A value of 'enabled' will cause the HUB to automatically partition a port where a lack of loopback from the transeiver is detected. A value of 'disabled' will disable this feature. Note: Setting this variable will only effect HUB operation when hub1PortType value equals 'thinNet-10Base2'. For all other hub1PortType values, a value of 'enabled' will have no effect.")
hub1_collision_limit = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(31, 63))).clone(namedValues=named_values(('low', 31), ('high', 63)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1CollisionLimit.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1CollisionLimit.setDescription('If consecutive collisions exceeding the value of this variable are detected on a port, the port will be auto partitioned 31 is the IEEE 802.3 consecutive collision limit.')
hub1_carrier_recover_time = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(3, 5))).clone(namedValues=named_values(('short', 3), ('long', 5)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1CarrierRecoverTime.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1CarrierRecoverTime.setDescription("Time to recover carrier. A value of 'short' will use 3 bit times (IEEE 802.3 specification). A value of 'long' will use 5 bit times.")
hub1_event_counter_flags = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1EventCounterFlags.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1EventCounterFlags.setDescription("A bit mask indicating which error types will cause an increment in the hub1PortEventCount Counter. Each bit has the following significance where each bit is listed from most significant bit of the first octet, to least significant bit of the second octet. High (first) Octet bit 8 - not used - 7 - not used - 6 Out Of Window Collision Count Enable 5 Receive Collision Count Enable 4 Transmit Collision Count Enable 3 - not used - 2 - not used - 1 - not used - Low (second) Octet bit 8 Bad Link Count Enable 7 Partition Count Enable 6 Receive Count Enable 5 Pygmy Packet Enable 4 Non SFD Enable 3 Phase Lock Error Enable 2 Elasticity Buffer Error Enable 1 Jabber Enable When setting the value of this variable, the entire bit mask must be specified and the '-not used-' bits must not be set.")
hub1_event_record_flags = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1EventRecordFlags.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1EventRecordFlags.setDescription("A bit mask indicating which error types will cause corresponding bits in hub1PortEventRecordValue to be set when an error is detected. Each bit has the following significance where bits are listed from most significant bit to least significant bit. bit 8 Bad Link Enable 7 Partition Enable 6 Out Of Window Collision Enable 5 Pygmy Packet Enable 4 Non SFD Enable 3 Phase Lock Error Enable 2 Elasticity Buffer Error Enable 1 Jabber Enable When a particular bit is set, all ports will start to log the specified error in the hub1PortEventRecordValue column of the port's row of the hub1PortTable. For example, if bit 1 (Jabber Enable) is set, then for every port, a detected Jabber Error would cause bit 1 of hub1PortEventRecordValue to be set. When setting the value of this variable, the entire bit mask must be specified. When this mask is set, hub1PortRecordValue for all ports is cleared.")
hub1_bridging_mode = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('bridging', 1), ('bypass', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1BridgingMode.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1BridgingMode.setDescription("Operational mode of the bridge: bridging Packets are being selectively forwarded according to the internal dynamically built tables. bypass All packets are being repeated between the backbone and the repeater ports. The bridge logic is disabled. After setting this variable the HUB must be reset for the new value to take effect. NOTE: FOIRL Hubs can only have the value 'bypass' for this variable. Attempts to set this variable to 'bridging' on FOIRL hubs will be rejected.")
hub1_protocol_filter_mode = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('filter', 2), ('pass', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1ProtocolFilterMode.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1ProtocolFilterMode.setDescription('Filtering Mode of the Hub: off The protocol filtering logic is disabled. filter The protocol filtering logic is enabled and packets with the protocol types indicated in hubFilterProtocols will not be forwarded by the bridge. pass The packet filtering logic is enabled and packets with the protocol types indicated in hubFilterProtocols will be the ONLY packets that the bridge will forward.')
hub1_filter_protocols = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1FilterProtocols.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1FilterProtocols.setDescription('Protocol types to be filtered or passed by the bridging logic. This is a variable length array of between 0 and 16 2-byte entries, each entry containing the 2-byte protocol identifier as seen in the Ethernet header. Attempts to configure this variable with an OCTET STRING of odd length will be rejected.')
hub1_console_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 12), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1ConsoleBaudRate.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1ConsoleBaudRate.setDescription('The baud rate of the console port. Legal values are 9600, 4800, 2400, and 1200.')
hub1_reset = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-reset', 1), ('reset', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1Reset.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1Reset.setDescription("Setting this object to 'reset' will cause the Hub1 to perform a hardware reset within approximately 5 seconds. Setting this object to 'no-reset will have no effect. The value 'no-reset will be returned whenever this object is retrieved. The primary purpose for including this variable in the Hub1 MIB is to allow SNMP managers to modify the operational mode of the Hub1. Changing the variable hub1BridgingMode has no effect on the Hub until the Hub is reset.")
hub1_software_version = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 14), display_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1SoftwareVersion.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1SoftwareVersion.setDescription("The version of software running on the Hub. On versions of the Hub that support dynamic download, this variable may be set to cause a new version of the software to be loaded the next time the Hub is reset (as in setting the variable hub1Reset or power cycling the unit). The version should be specified in the following format: 'MM.mm.rr' Where MM is the major number, mm is the minor number, and rr is the revision level (for example 2.0.16). On versions of the Hub that do not support dynamic download, setting this variable will result in an error.")
hub1_port_table = mib_table((1, 3, 6, 1, 4, 1, 315, 1, 15))
if mibBuilder.loadTexts:
hub1PortTable.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortTable.setDescription('A table of port specific information for the NRC HUB 1 product. This table supplements the Repeater MIB Ports Table.')
hub1_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 315, 1, 15, 1)).setIndexNames((0, 'NRC-HUB1-MIB', 'hub1PortIndex'))
if mibBuilder.loadTexts:
hub1PortEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortEntry.setDescription('A list of information for every port.')
hub1_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 24))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortIndex.setDescription('Port number that corresponds to the index value in the Repeater MIB variable rptrPortIndex.')
hub1_port_force_reconnect = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('idle', 1), ('force-reconnect', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1PortForceReconnect.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortForceReconnect.setDescription("Setting this variable to the value 'force- reconnect' will cause the port to be reconnected assuming that it is currently in the 'Partition' state. If the port is not in a 'Partition' state, setting variable to the value 'force-reconnect' will not have any effect. Setting this variable to anything other than 'force- reconnect will and an undefined effect. When retrieving this variable, the value 'idle' will always be returned.")
hub1_port_partition_reason = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('not-partitioned', 1), ('other', 2), ('consecutive-collision-limit', 3), ('excessive-len-of-collision-limit', 4), ('data-loopback-failure', 5), ('process-forced-reconnection', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortPartitionReason.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortPartitionReason.setDescription("Reason for port being in the partitioned state. If the port is currently not partitioned, this variable will have the value 'not-partitioned'.")
hub1_port_link_state = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('unknown', 1), ('up', 2), ('down', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortLinkState.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortLinkState.setDescription("This variable's meaning varies depending on the type of HUB: 10Base2 Not Applicable. A value of 'unknown' will always be returned. 10BaseT Link Test is being received ('up') or not being received ('down'). Fiber Light Monitoring (LMON) is being detected ('up') or not being detected ('down').")
hub1_port_link_enable = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1PortLinkEnable.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortLinkEnable.setDescription('Enabling this variable has the following effect depending on the type of HUB: 10Base2 No Effect 10BaseT Link Test Enabled Fiber LMON Test Enabled')
hub1_port_polarity_status = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('reversed', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortPolarityStatus.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortPolarityStatus.setDescription("Current port Polarity status. NOTE: a value of 'ok' will always be returned for 10Base2 and FOIRL HUBs")
hub1_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hub1PortName.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortName.setDescription('Administrator assigned ASCII port name.')
hub1_port_event_count = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortEventCount.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortEventCount.setDescription('Counter of all error events that were detected on this port and at the same time were marked for collection in the hub1EventCounterFlags variable. This is a 16 bit wrapping counter.')
hub1_port_record_value = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortRecordValue.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortRecordValue.setDescription('Bit Mask that has bits set for each error event that was detected on this port and at the same time was marked for collection in the hub1EventRecordFlags variable. Each bit has the following meaning, where the bits are listed from most significant to least significant: bit 8 Bad Link Count Error 7 Partition Count Error 6 Receive Count Error 5 Pygmy Packet Error 4 Non SFD Error 3 Phase Lock Error 2 Elasticity Buffer Error 1 Jabber Error Each read of this variable causes the variable to be cleared.')
hub1_port_type = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 15, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('twistedPair-10BaseT', 2), ('thinNet-10Base2', 3), ('fiber-FOIRL', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1PortType.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1PortType.setDescription('The type of port')
hub1_if_table = mib_table((1, 3, 6, 1, 4, 1, 315, 1, 16))
if mibBuilder.loadTexts:
hub1IFTable.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFTable.setDescription('A table that contains HUB 1 specific supplements to the MIB-II interfaces table.')
hub1_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 315, 1, 16, 1)).setIndexNames((0, 'NRC-HUB1-MIB', 'hub1IFIndex'))
if mibBuilder.loadTexts:
hub1IFEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFEntry.setDescription('Entries in the HUB 1 supplement table.')
hub1_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFIndex.setDescription('Interface index that corresponds to ifIndex in the interfaces table from MIB II.')
hub1_if_in_alignment_errors = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInAlignmentErrors.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInAlignmentErrors.setDescription('The number of alignment errors detected by this interface.')
hub1_if_in_crc_errors = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInCrcErrors.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInCrcErrors.setDescription('The number of CRC errors detected by this interface.')
hub1_if_in_collisions = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInCollisions.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInCollisions.setDescription('The number of collisions detected by this interface.')
hub1_if_in_mtu_exceeded_discards = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInMtuExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInMtuExceededDiscards.setDescription('The number of frames discarded by this interface on receive due to an excessive size.')
hub1_if_in_short_errors = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInShortErrors.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInShortErrors.setDescription('The number of frames discarded by this interface because they were less than the Ethernet minumum frame size of 64 bytes.')
hub1_if_in_overrun_discards = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFInOverrunDiscards.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFInOverrunDiscards.setDescription('The number of frames discarded by this interface due to a LAN Controller FIFO overflow on receive.')
hub1_if_out_underruns = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFOutUnderruns.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFOutUnderruns.setDescription('The number of frames which had to be retransmitted by this interface due to a LAN Controller FIFO underrun error on transmit.')
hub1_if_out_lost_cts = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFOutLostCts.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFOutLostCts.setDescription('The number of times Carrier Transmit Sense (CTS) was lost on this interface during frame transmission. The hub will attempt to retransmit frames when transmission fails due to lost CTS.')
hub1_if_out_lost_crs = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFOutLostCrs.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFOutLostCrs.setDescription('The number of times Carrier Receive Sense (CRS) was lost on this interface during frame transmission. The hub will attempt to retransmit frames when transmission fails due to lost CRS.')
hub1_if_out_mtu_exceeded_discards = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFOutMtuExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFOutMtuExceededDiscards.setDescription('The number of frames discarded by this interface on transmit due to an excessive size.')
hub1_if_out_collisions = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFOutCollisions.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFOutCollisions.setDescription('The number of collisions detected by this interface while attempting to transmit a packet.')
hub1_if_channel_utilization = mib_table_column((1, 3, 6, 1, 4, 1, 315, 1, 16, 1, 13), octet_string().subtype(subtypeSpec=value_size_constraint(90, 90)).setFixedLength(90)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1IFChannelUtilization.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1IFChannelUtilization.setDescription('Utilization statistics for the last 60 seconds of operation of the bridging logic associated with this interface. The OCTET STRING is a series of 45 16-bit words, each word representing the percentage utilization for a 1.33 second sample period. The first 16 bit word in this series represents the oldest sample. Percentages are calculated by passing each 16 bit sample through the following equation: ((Sample) * 100) / 0xffff to yield the percent channel utilization (a number ranging from 0 to 100).')
hub1_last_failure_reason = mib_scalar((1, 3, 6, 1, 4, 1, 315, 1, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hub1LastFailureReason.setStatus('mandatory')
if mibBuilder.loadTexts:
hub1LastFailureReason.setDescription('The last error that caused a Hub failure. A value of zero (0) indicates that there has not been a Hub failure since the novram was last erased. A non-zero value indicates the reason for the last Hub failure. A normal Hub reset or power cycle will not change the value of this variable (it will still indicate the reason for the last known failure.')
mibBuilder.exportSymbols('NRC-HUB1-MIB', hub1PortForceReconnect=hub1PortForceReconnect, hub1LastFailureReason=hub1LastFailureReason, hub1PortType=hub1PortType, hub1PortRecordValue=hub1PortRecordValue, hub1IFOutUnderruns=hub1IFOutUnderruns, hub1IFInOverrunDiscards=hub1IFInOverrunDiscards, hub1PortPolarityStatus=hub1PortPolarityStatus, hub1IFOutLostCrs=hub1IFOutLostCrs, hub1IFTable=hub1IFTable, hub1=hub1, hub1PortLinkState=hub1PortLinkState, hub1FilterProtocols=hub1FilterProtocols, hub1PortEventCount=hub1PortEventCount, enterprises=enterprises, hub1IFEntry=hub1IFEntry, hub1PortLinkEnable=hub1PortLinkEnable, hub1IFChannelUtilization=hub1IFChannelUtilization, hub1ConsoleBaudRate=hub1ConsoleBaudRate, hub1EventRecordFlags=hub1EventRecordFlags, hub1PortName=hub1PortName, hub1SoftwareVersion=hub1SoftwareVersion, hub1CollisionLimit=hub1CollisionLimit, hub1IFOutLostCts=hub1IFOutLostCts, hub1IFInCollisions=hub1IFInCollisions, hub1IFInMtuExceededDiscards=hub1IFInMtuExceededDiscards, hub1EventCounterFlags=hub1EventCounterFlags, hub1Reset=hub1Reset, hub1AutoPartition=hub1AutoPartition, hub1CarrierRecoverTime=hub1CarrierRecoverTime, hub1IFOutCollisions=hub1IFOutCollisions, hub1LoopbackPartition=hub1LoopbackPartition, hub1IFInShortErrors=hub1IFInShortErrors, hub1ProtocolFilterMode=hub1ProtocolFilterMode, hub1IFInCrcErrors=hub1IFInCrcErrors, nrc=nrc, hub1PortIndex=hub1PortIndex, hub1ReconnectOnTransmission=hub1ReconnectOnTransmission, hub1PortEntry=hub1PortEntry, hub1BridgingMode=hub1BridgingMode, hub1IFOutMtuExceededDiscards=hub1IFOutMtuExceededDiscards, hub1PortPartitionReason=hub1PortPartitionReason, hub1IFIndex=hub1IFIndex, hub1IFInAlignmentErrors=hub1IFInAlignmentErrors, hub1IncludeOutOfWinColl=hub1IncludeOutOfWinColl, hub1PortTable=hub1PortTable) |
# Animate plot as a wire-frame
plotter = pv.Plotter(window_size=(800, 600))
plotter.add_mesh(grid, scalars=d[:, 1],
scalar_bar_args={'title': 'Y Displacement'},
show_edges=True,
rng=[-d.max(), d.max()], interpolate_before_map=True,
style='wireframe')
plotter.add_axes()
plotter.camera_position = cpos
plotter.open_gif('beam_wireframe.gif')
for phase in np.linspace(0, 2*np.pi, 20):
plotter.update_coordinates(grid.points + d*np.cos(phase), render=False)
plotter.update_scalars(d[:, 1]*np.cos(phase), render=False)
plotter.render()
plotter.write_frame()
# close the plotter when complete
plotter.close() | plotter = pv.Plotter(window_size=(800, 600))
plotter.add_mesh(grid, scalars=d[:, 1], scalar_bar_args={'title': 'Y Displacement'}, show_edges=True, rng=[-d.max(), d.max()], interpolate_before_map=True, style='wireframe')
plotter.add_axes()
plotter.camera_position = cpos
plotter.open_gif('beam_wireframe.gif')
for phase in np.linspace(0, 2 * np.pi, 20):
plotter.update_coordinates(grid.points + d * np.cos(phase), render=False)
plotter.update_scalars(d[:, 1] * np.cos(phase), render=False)
plotter.render()
plotter.write_frame()
plotter.close() |
def display():
def message():
return "Hello "
return message
fun=display()
print(fun())
| def display():
def message():
return 'Hello '
return message
fun = display()
print(fun()) |
def sku_lookup(sku):
price_table = [
{
'item': 'A',
'price': 50,
'offers': [
'3A for 130',
],
},
{
'item': 'B',
'price': 30,
'offers': [
'2B for 45',
],
},
{
'item': 'C',
'price': 20,
'offers': [],
},
{
'item': 'D',
'price': 15,
'offers': [],
},
]
for item in price_table:
if sku == item.get('item'):
return item
return None
# noinspection PyUnusedLocal
# skus = unicode string
def checkout(skus):
sku_list = list(skus)
total = 0
for sku in sku_list:
sku_item = sku_lookup(sku)
if not sku_item:
return -1
price = sku_item.get('price', -1)
if price < 0:
return -1
total += price
return total
| def sku_lookup(sku):
price_table = [{'item': 'A', 'price': 50, 'offers': ['3A for 130']}, {'item': 'B', 'price': 30, 'offers': ['2B for 45']}, {'item': 'C', 'price': 20, 'offers': []}, {'item': 'D', 'price': 15, 'offers': []}]
for item in price_table:
if sku == item.get('item'):
return item
return None
def checkout(skus):
sku_list = list(skus)
total = 0
for sku in sku_list:
sku_item = sku_lookup(sku)
if not sku_item:
return -1
price = sku_item.get('price', -1)
if price < 0:
return -1
total += price
return total |
class One:
def __init__(self):
super().__init__()
print("This is init method of class One")
self.i=5
class Two(One):
def __init__(self):
super().__init__()
print("This is init method of class Two")
self.j=10
class Three(Two):
def __init__(self):
super().__init__()
print("This is init method of class Three")
self.k=15
class Final(Three):
def __init__(self):
super().__init__()
print("This is init method of class Final")
| class One:
def __init__(self):
super().__init__()
print('This is init method of class One')
self.i = 5
class Two(One):
def __init__(self):
super().__init__()
print('This is init method of class Two')
self.j = 10
class Three(Two):
def __init__(self):
super().__init__()
print('This is init method of class Three')
self.k = 15
class Final(Three):
def __init__(self):
super().__init__()
print('This is init method of class Final') |
{
"targets": [
{
"target_name": "mmap",
"sources": ["mmap.cc" ],
"include_dirs": [
"<!(node -e \"require('nan')\")",
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"MACOSX_DEPLOYMENT_TARGET": "10.12",
"OTHER_CPLUSPLUSFLAGS": [ "-std=c++11", "-stdlib=libc++" ],
"OTHER_LDFLAGS": [ "-stdlib=libc++" ]
},
"libraries": [
],
}
]
} | {'targets': [{'target_name': 'mmap', 'sources': ['mmap.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'xcode_settings': {'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'MACOSX_DEPLOYMENT_TARGET': '10.12', 'OTHER_CPLUSPLUSFLAGS': ['-std=c++11', '-stdlib=libc++'], 'OTHER_LDFLAGS': ['-stdlib=libc++']}, 'libraries': []}]} |
# Python modules
# 3rd party modules
# Our modules
#------------------------------------------------------------------------------
# Method calls for different entry points' processing
def do_processing_all(chain):
"""
"""
return
set = chain._block.set
| def do_processing_all(chain):
"""
"""
return
set = chain._block.set |
#!/usr/local/bin/python3.3
L = [1, 2, 3, 4]
print(L[-1000:100])
L[3:1] = ['?']
print(L)
| l = [1, 2, 3, 4]
print(L[-1000:100])
L[3:1] = ['?']
print(L) |
def bissexto(ano):
if(ano % 4 == 0 and (ano % 400 == 0 or ano % 100 != 0)):
return True
return False
def dias_mes(ano):
if(len(ano)=='fev'):
return ValueError("Nao tem 3 caracteres")
return
mes=str(input("Mes: "))
print(dias_mes(mes)) | def bissexto(ano):
if ano % 4 == 0 and (ano % 400 == 0 or ano % 100 != 0):
return True
return False
def dias_mes(ano):
if len(ano) == 'fev':
return value_error('Nao tem 3 caracteres')
return
mes = str(input('Mes: '))
print(dias_mes(mes)) |
'''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''
def can_paginate(operation_name=None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
"""
pass
def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
ClientMethod.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method's model.
"""
pass
def get_paginator(operation_name=None):
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
:rtype: L{botocore.paginate.Paginator}
"""
pass
def get_resources(PaginationToken=None, TagFilters=None, ResourcesPerPage=None, TagsPerPage=None, ResourceTypeFilters=None):
"""
Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as filters . The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.
See also: AWS API Documentation
:example: response = client.get_resources(
PaginationToken='string',
TagFilters=[
{
'Key': 'string',
'Values': [
'string',
]
},
],
ResourcesPerPage=123,
TagsPerPage=123,
ResourceTypeFilters=[
'string',
]
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken , use that string for this value to request an additional page of data.
:type TagFilters: list
:param TagFilters: A list of tags (keys and values). A request can include up to 50 keys, and each key can include up to 20 values.
If you specify multiple filters connected by an AND operator in a single request, the response returns only those resources that are associated with every specified filter.
If you specify multiple filters connected by an OR operator in a single request, the response returns all resources that are associated with at least one or possibly more of the specified filters.
(dict) --A list of tags (keys and values) that are used to specify the associated resources.
Key (string) --One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
Values (list) --The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
(string) --
:type ResourcesPerPage: integer
:param ResourcesPerPage: A limit that restricts the number of resources returned by GetResources in paginated output. You can set ResourcesPerPage to a minimum of 1 item and the maximum of 50 items.
:type TagsPerPage: integer
:param TagsPerPage: A limit that restricts the number of tags (key and value pairs) returned by GetResources in paginated output. A resource with no tags is counted as having one tag (one key and value pair).
GetResources does not split a resource and its associated tags across pages. If the specified TagsPerPage would cause such a break, a PaginationToken is returned in place of the affected resource and its tags. Use that token in another request to get the remaining data. For example, if you specify a TagsPerPage of 100 and the account has 22 resources with 10 tags each (meaning that each resource has 10 key and value pairs), the output will consist of 3 pages, with the first page displaying the first 10 resources, each with its 10 tags, the second page displaying the next 10 resources each with its 10 tags, and the third page displaying the remaining 2 resources, each with its 10 tags.
You can set TagsPerPage to a minimum of 100 items and the maximum of 500 items.
:type ResourceTypeFilters: list
:param ResourceTypeFilters: The constraints on the resources that you want returned. The format of each resource type is service[:resourceType] . For example, specifying a resource type of ec2 returns all tagged Amazon EC2 resources (which includes tagged EC2 instances). Specifying a resource type of ec2:instance returns only EC2 instances.
The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the AWS General Reference for the following:
For a list of service name strings, see AWS Service Namespaces .
For resource type strings, see Example ARNs .
For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces .
(string) --
:rtype: dict
:return: {
'PaginationToken': 'string',
'ResourceTagMappingList': [
{
'ResourceARN': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
"""
pass
def get_tag_keys(PaginationToken=None):
"""
Returns all tag keys in the specified region for the AWS account.
See also: AWS API Documentation
:example: response = client.get_tag_keys(
PaginationToken='string'
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
:rtype: dict
:return: {
'PaginationToken': 'string',
'TagKeys': [
'string',
]
}
"""
pass
def get_tag_values(PaginationToken=None, Key=None):
"""
Returns all tag values for the specified key in the specified region for the AWS account.
See also: AWS API Documentation
:example: response = client.get_tag_values(
PaginationToken='string',
Key='string'
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
:type Key: string
:param Key: [REQUIRED]
The key for which you want to list all existing values in the specified region for the AWS account.
:rtype: dict
:return: {
'PaginationToken': 'string',
'TagValues': [
'string',
]
}
:returns:
(string) --
"""
pass
def get_waiter():
"""
"""
pass
def tag_resources(ResourceARNList=None, Tags=None):
"""
Applies one or more tags to the specified resources. Note the following:
See also: AWS API Documentation
:example: response = client.tag_resources(
ResourceARNList=[
'string',
],
Tags={
'string': 'string'
}
)
:type ResourceARNList: list
:param ResourceARNList: [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
:type Tags: dict
:param Tags: [REQUIRED]
The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.
(string) --
(string) --
:rtype: dict
:return: {
'FailedResourcesMap': {
'string': {
'StatusCode': 123,
'ErrorCode': 'InternalServiceException'|'InvalidParameterException',
'ErrorMessage': 'string'
}
}
}
:returns:
ResourceARNList (list) -- [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
Tags (dict) -- [REQUIRED]
The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.
(string) --
(string) --
"""
pass
def untag_resources(ResourceARNList=None, TagKeys=None):
"""
Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:
See also: AWS API Documentation
:example: response = client.untag_resources(
ResourceARNList=[
'string',
],
TagKeys=[
'string',
]
)
:type ResourceARNList: list
:param ResourceARNList: [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
:type TagKeys: list
:param TagKeys: [REQUIRED]
A list of the tag keys that you want to remove from the specified resources.
(string) --
:rtype: dict
:return: {
'FailedResourcesMap': {
'string': {
'StatusCode': 123,
'ErrorCode': 'InternalServiceException'|'InvalidParameterException',
'ErrorMessage': 'string'
}
}
}
:returns:
ResourceARNList (list) -- [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
TagKeys (list) -- [REQUIRED]
A list of the tag keys that you want to remove from the specified resources.
(string) --
"""
pass
| """
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
def can_paginate(operation_name=None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
"""
pass
def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
ClientMethod.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method's model.
"""
pass
def get_paginator(operation_name=None):
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
:rtype: L{botocore.paginate.Paginator}
"""
pass
def get_resources(PaginationToken=None, TagFilters=None, ResourcesPerPage=None, TagsPerPage=None, ResourceTypeFilters=None):
"""
Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as filters . The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.
See also: AWS API Documentation
:example: response = client.get_resources(
PaginationToken='string',
TagFilters=[
{
'Key': 'string',
'Values': [
'string',
]
},
],
ResourcesPerPage=123,
TagsPerPage=123,
ResourceTypeFilters=[
'string',
]
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken , use that string for this value to request an additional page of data.
:type TagFilters: list
:param TagFilters: A list of tags (keys and values). A request can include up to 50 keys, and each key can include up to 20 values.
If you specify multiple filters connected by an AND operator in a single request, the response returns only those resources that are associated with every specified filter.
If you specify multiple filters connected by an OR operator in a single request, the response returns all resources that are associated with at least one or possibly more of the specified filters.
(dict) --A list of tags (keys and values) that are used to specify the associated resources.
Key (string) --One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
Values (list) --The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
(string) --
:type ResourcesPerPage: integer
:param ResourcesPerPage: A limit that restricts the number of resources returned by GetResources in paginated output. You can set ResourcesPerPage to a minimum of 1 item and the maximum of 50 items.
:type TagsPerPage: integer
:param TagsPerPage: A limit that restricts the number of tags (key and value pairs) returned by GetResources in paginated output. A resource with no tags is counted as having one tag (one key and value pair).
GetResources does not split a resource and its associated tags across pages. If the specified TagsPerPage would cause such a break, a PaginationToken is returned in place of the affected resource and its tags. Use that token in another request to get the remaining data. For example, if you specify a TagsPerPage of 100 and the account has 22 resources with 10 tags each (meaning that each resource has 10 key and value pairs), the output will consist of 3 pages, with the first page displaying the first 10 resources, each with its 10 tags, the second page displaying the next 10 resources each with its 10 tags, and the third page displaying the remaining 2 resources, each with its 10 tags.
You can set TagsPerPage to a minimum of 100 items and the maximum of 500 items.
:type ResourceTypeFilters: list
:param ResourceTypeFilters: The constraints on the resources that you want returned. The format of each resource type is service[:resourceType] . For example, specifying a resource type of ec2 returns all tagged Amazon EC2 resources (which includes tagged EC2 instances). Specifying a resource type of ec2:instance returns only EC2 instances.
The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the AWS General Reference for the following:
For a list of service name strings, see AWS Service Namespaces .
For resource type strings, see Example ARNs .
For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces .
(string) --
:rtype: dict
:return: {
'PaginationToken': 'string',
'ResourceTagMappingList': [
{
'ResourceARN': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
"""
pass
def get_tag_keys(PaginationToken=None):
"""
Returns all tag keys in the specified region for the AWS account.
See also: AWS API Documentation
:example: response = client.get_tag_keys(
PaginationToken='string'
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
:rtype: dict
:return: {
'PaginationToken': 'string',
'TagKeys': [
'string',
]
}
"""
pass
def get_tag_values(PaginationToken=None, Key=None):
"""
Returns all tag values for the specified key in the specified region for the AWS account.
See also: AWS API Documentation
:example: response = client.get_tag_values(
PaginationToken='string',
Key='string'
)
:type PaginationToken: string
:param PaginationToken: A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
:type Key: string
:param Key: [REQUIRED]
The key for which you want to list all existing values in the specified region for the AWS account.
:rtype: dict
:return: {
'PaginationToken': 'string',
'TagValues': [
'string',
]
}
:returns:
(string) --
"""
pass
def get_waiter():
"""
"""
pass
def tag_resources(ResourceARNList=None, Tags=None):
"""
Applies one or more tags to the specified resources. Note the following:
See also: AWS API Documentation
:example: response = client.tag_resources(
ResourceARNList=[
'string',
],
Tags={
'string': 'string'
}
)
:type ResourceARNList: list
:param ResourceARNList: [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
:type Tags: dict
:param Tags: [REQUIRED]
The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.
(string) --
(string) --
:rtype: dict
:return: {
'FailedResourcesMap': {
'string': {
'StatusCode': 123,
'ErrorCode': 'InternalServiceException'|'InvalidParameterException',
'ErrorMessage': 'string'
}
}
}
:returns:
ResourceARNList (list) -- [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
Tags (dict) -- [REQUIRED]
The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.
(string) --
(string) --
"""
pass
def untag_resources(ResourceARNList=None, TagKeys=None):
"""
Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:
See also: AWS API Documentation
:example: response = client.untag_resources(
ResourceARNList=[
'string',
],
TagKeys=[
'string',
]
)
:type ResourceARNList: list
:param ResourceARNList: [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
:type TagKeys: list
:param TagKeys: [REQUIRED]
A list of the tag keys that you want to remove from the specified resources.
(string) --
:rtype: dict
:return: {
'FailedResourcesMap': {
'string': {
'StatusCode': 123,
'ErrorCode': 'InternalServiceException'|'InvalidParameterException',
'ErrorMessage': 'string'
}
}
}
:returns:
ResourceARNList (list) -- [REQUIRED]
A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .
(string) --
TagKeys (list) -- [REQUIRED]
A list of the tag keys that you want to remove from the specified resources.
(string) --
"""
pass |
"""Farcy test helpers."""
class Struct(object):
"""A dynamic class with attributes based on the input dictionary."""
def __init__(self, iterable=None, **attrs):
"""Create an instance of the Struct class."""
self.__dict__.update(attrs)
self._iterable = iterable or []
def __getitem__(self, index):
"""Return the value of the attribute ``index``."""
return self._iterable[index]
def refresh(self):
"""Dummy function to reload this instance."""
return self
| """Farcy test helpers."""
class Struct(object):
"""A dynamic class with attributes based on the input dictionary."""
def __init__(self, iterable=None, **attrs):
"""Create an instance of the Struct class."""
self.__dict__.update(attrs)
self._iterable = iterable or []
def __getitem__(self, index):
"""Return the value of the attribute ``index``."""
return self._iterable[index]
def refresh(self):
"""Dummy function to reload this instance."""
return self |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.