content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class RobotError(Error):
"""Exception raised for robot detection (solvable).
Attributes:
message -- explanation of the error
"""
def __init__(self):
self.message = "Robot Check Detected."
class AQError(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = "Automated Queries Check Detected."
class SearchError(Error):
"""Exception raised for empty search results.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = "No search results."
class GScholarError(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error (non-solvable).
"""
def __init__(self):
self.message = "No more alternative addresses. Restart this program."
|
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class Roboterror(Error):
"""Exception raised for robot detection (solvable).
Attributes:
message -- explanation of the error
"""
def __init__(self):
self.message = 'Robot Check Detected.'
class Aqerror(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = 'Automated Queries Check Detected.'
class Searcherror(Error):
"""Exception raised for empty search results.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = 'No search results.'
class Gscholarerror(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error (non-solvable).
"""
def __init__(self):
self.message = 'No more alternative addresses. Restart this program.'
|
lilly_dict = {"name": "Lilly",
"age": 18,
"pets": False,
"hair_color": 'Black'}
class Person(object):
def __init__(self, name, age, pets, hair_color):
self.name = name
self.age = age
self.pets = pets
self.hair_color = hair_color
self.hungry = True
def eat(self, food):
print('I am eating ' + food)
self.hungry = False
def __str__(self):
return 'Name: ' + self.name
lilly = Person(
name = "Lilly",
age = 18,
pets = False,
hair_color = "Black")
david = Person(
name = "David",
age = 16,
pets = False,
hair_color = "Black")
print(lilly.name)
print(lilly.hungry)
print(lilly.eat("banana"))
print(david.name)
|
lilly_dict = {'name': 'Lilly', 'age': 18, 'pets': False, 'hair_color': 'Black'}
class Person(object):
def __init__(self, name, age, pets, hair_color):
self.name = name
self.age = age
self.pets = pets
self.hair_color = hair_color
self.hungry = True
def eat(self, food):
print('I am eating ' + food)
self.hungry = False
def __str__(self):
return 'Name: ' + self.name
lilly = person(name='Lilly', age=18, pets=False, hair_color='Black')
david = person(name='David', age=16, pets=False, hair_color='Black')
print(lilly.name)
print(lilly.hungry)
print(lilly.eat('banana'))
print(david.name)
|
"""
Exercise 13 - Inventory Management
"""
def create_inventory (items):
"""
:param items: list - list of items to create an inventory from.
:return: dict - the inventory dictionary.
"""
return add_items ({}, items)
def add_items (inventory, items):
"""
:param inventory: dict - dictionary of existing inventory.
:param items: list - list of items to update the inventory with.
:return: dict - the inventory dictionary update with the new items.
"""
return add_or_decrement_items (inventory, items, 'add')
def decrement_items (inventory, items):
"""
:param inventory: dict - inventory dictionary.
:param items: list - list of items to decrement from the inventory.
:return: dict - updated inventory dictionary with items decremented.
"""
return add_or_decrement_items (inventory, items, 'minus')
def remove_item (inventory, item):
"""
:param inventory: dict - inventory dictionary.
:param item: str - item to remove from the inventory.
:return: dict - updated inventory dictionary with item removed.
"""
if item not in inventory:
return inventory
inventory.pop (item)
return inventory
def list_inventory (inventory):
"""
:param inventory: dict - an inventory dictionary.
:return: list of tuples - list of key, value pairs from the inventory dictionary.
"""
result = []
for element, quantity in inventory.items():
if quantity > 0:
result.append ((element, quantity))
return result
def add_or_decrement_items (inventory, items, operation):
"""
:param inventory: dict - dictionary of existing inventory.
:param items: list - list of items to update the inventory with.
:param operation: string - 'add' or 'minus'.
:return: dict - the inventory dictionary update with the new items.
"""
for item in items:
if not item in inventory:
if operation == 'add':
inventory[item] = 1
else:
if operation == 'add':
inventory[item] += 1
else:
if inventory[item] > 0:
inventory[item] -= 1
return inventory
|
"""
Exercise 13 - Inventory Management
"""
def create_inventory(items):
"""
:param items: list - list of items to create an inventory from.
:return: dict - the inventory dictionary.
"""
return add_items({}, items)
def add_items(inventory, items):
"""
:param inventory: dict - dictionary of existing inventory.
:param items: list - list of items to update the inventory with.
:return: dict - the inventory dictionary update with the new items.
"""
return add_or_decrement_items(inventory, items, 'add')
def decrement_items(inventory, items):
"""
:param inventory: dict - inventory dictionary.
:param items: list - list of items to decrement from the inventory.
:return: dict - updated inventory dictionary with items decremented.
"""
return add_or_decrement_items(inventory, items, 'minus')
def remove_item(inventory, item):
"""
:param inventory: dict - inventory dictionary.
:param item: str - item to remove from the inventory.
:return: dict - updated inventory dictionary with item removed.
"""
if item not in inventory:
return inventory
inventory.pop(item)
return inventory
def list_inventory(inventory):
"""
:param inventory: dict - an inventory dictionary.
:return: list of tuples - list of key, value pairs from the inventory dictionary.
"""
result = []
for (element, quantity) in inventory.items():
if quantity > 0:
result.append((element, quantity))
return result
def add_or_decrement_items(inventory, items, operation):
"""
:param inventory: dict - dictionary of existing inventory.
:param items: list - list of items to update the inventory with.
:param operation: string - 'add' or 'minus'.
:return: dict - the inventory dictionary update with the new items.
"""
for item in items:
if not item in inventory:
if operation == 'add':
inventory[item] = 1
elif operation == 'add':
inventory[item] += 1
elif inventory[item] > 0:
inventory[item] -= 1
return inventory
|
startMsg = 'counting...'
endMsg = 'launched !'
count = 10
print (startMsg)
while count >= 0 :
print (count)
count -= 1
print (endMsg)
|
start_msg = 'counting...'
end_msg = 'launched !'
count = 10
print(startMsg)
while count >= 0:
print(count)
count -= 1
print(endMsg)
|
def multiple_letter_count(string):
return {letter: string.count(letter) for letter in string}
print(multiple_letter_count('awesome'))
|
def multiple_letter_count(string):
return {letter: string.count(letter) for letter in string}
print(multiple_letter_count('awesome'))
|
animals = ['bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus']
print("The animal at 1. ", animals[1])
print("The third (3rd) animal. ", animals[3-1])#This is the n - 1 trick
print("The first (1st) animal. ", animals[0])
print("The animal at 3. ", animals[3])
print("The fifth (5th) animal. ", animals[4])
print("The animal at 2. ", animals[2])
print("The sixth (6th) animal. ", animals[5])
print("The animal at 4. ", animals[4])
#Study Drill 2: Here is another list to play with
hobbies = ['Running', 'Programming', 'Flying', 'Gaming', 'Sleeping']
|
animals = ['bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus']
print('The animal at 1. ', animals[1])
print('The third (3rd) animal. ', animals[3 - 1])
print('The first (1st) animal. ', animals[0])
print('The animal at 3. ', animals[3])
print('The fifth (5th) animal. ', animals[4])
print('The animal at 2. ', animals[2])
print('The sixth (6th) animal. ', animals[5])
print('The animal at 4. ', animals[4])
hobbies = ['Running', 'Programming', 'Flying', 'Gaming', 'Sleeping']
|
__author__ = "Douglas Lassance"
__copyright__ = "2020, Douglas Lassance"
__email__ = "[email protected]"
__license__ = "MIT"
__version__ = "0.1.0.dev5"
|
__author__ = 'Douglas Lassance'
__copyright__ = '2020, Douglas Lassance'
__email__ = '[email protected]'
__license__ = 'MIT'
__version__ = '0.1.0.dev5'
|
# Copyright (c) 2019 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:pkg.bzl", "pkg_tar")
# taken from rules_proto:
# https://github.com/stackb/rules_proto/blob/f5d6eea6a4528bef3c1d3a44d486b51a214d61c2/compile.bzl#L369-L393
def get_plugin_runfiles(tool, plugin_runfiles):
"""Gather runfiles for a plugin.
"""
files = []
if not tool:
return files
info = tool[DefaultInfo]
if not info:
return files
if info.files:
files += info.files.to_list()
if info.default_runfiles:
runfiles = info.default_runfiles
if runfiles.files:
files += runfiles.files.to_list()
if info.data_runfiles:
runfiles = info.data_runfiles
if runfiles.files:
files += runfiles.files.to_list()
if plugin_runfiles:
for target in plugin_runfiles:
files += target.files.to_list()
return files
def _proto_gen_impl(ctx):
src_descs = [src.proto.direct_descriptor_set for src in ctx.attr.srcs]
dep_descs = [dep.proto.direct_descriptor_set for dep in ctx.attr.deps]
descriptors = src_descs + dep_descs
sources_out = ctx.actions.declare_directory(ctx.attr.name + "-sources")
descriptor_set_delim = "\;" if _is_windows(ctx) else ":"
args = []
args += [
"--descriptor_set_in=" + descriptor_set_delim.join([d.path for d in descriptors]),
]
args += [
"--{}_out={}:{}".format(ctx.attr.plugin_name, ",".join(ctx.attr.plugin_options), sources_out.path),
]
plugins = []
plugin_runfiles = []
if ctx.attr.plugin_name not in ["java", "python"]:
plugins = [ctx.executable.plugin_exec]
plugin_runfiles = get_plugin_runfiles(ctx.attr.plugin_exec, ctx.attr.plugin_runfiles)
args += [
"--plugin=protoc-gen-{}={}".format(ctx.attr.plugin_name, ctx.executable.plugin_exec.path),
]
inputs = []
for src in ctx.attr.srcs:
src_root = src.proto.proto_source_root
for direct_source in src.proto.direct_sources:
path = ""
# in some cases the paths of src_root and direct_source are only partially
# overlapping. the following for loop finds the maximum overlap of these two paths
for i in range(len(src_root) + 1):
if direct_source.path.startswith(src_root[-i:]):
path = direct_source.path[i:]
else:
# this noop is needed to make bazel happy
noop = ""
path = direct_source.short_path if not path else path
path = path[1:] if path.startswith("/") else path
inputs += [path]
args += inputs
ctx.actions.run_shell(
mnemonic = "ProtoGen",
outputs = [sources_out],
inputs = descriptors + [ctx.executable.protoc] + plugin_runfiles,
command = "mkdir -p " + sources_out.path + " && " + ctx.executable.protoc.path + " " + " ".join(args),
tools = plugins,
use_default_shell_env = True,
)
# since we only have the output directory of the protoc compilation,
# we need to find all the files below sources_out and add them to the zipper args file
zipper_args_file = ctx.actions.declare_file(ctx.label.name + ".zipper_args")
ctx.actions.run_shell(
mnemonic = "CreateZipperArgsFile",
outputs = [zipper_args_file],
inputs = [sources_out],
command = "find -L {src_path} -type f | sed -E 's#^{src_path}/(.*)$#\\1={src_path}/\\1#' | sort > {args_file}".format(
src_path = sources_out.path,
args_file = zipper_args_file.path,
),
progress_message = "zipper_args_file %s" % zipper_args_file.path,
use_default_shell_env = True,
)
# Call zipper to create srcjar
zipper_args = ctx.actions.args()
zipper_args.add("c")
zipper_args.add(ctx.outputs.out.path)
zipper_args.add("@%s" % zipper_args_file.path)
ctx.actions.run(
executable = ctx.executable._zipper,
inputs = [sources_out, zipper_args_file],
outputs = [ctx.outputs.out],
arguments = [zipper_args],
progress_message = "srcjar %s" % ctx.outputs.out.short_path,
)
proto_gen = rule(
implementation = _proto_gen_impl,
attrs = {
"srcs": attr.label_list(allow_files = True),
"deps": attr.label_list(providers = [ProtoInfo]),
"plugin_name": attr.string(),
"plugin_exec": attr.label(
cfg = "host",
executable = True,
),
"plugin_options": attr.string_list(),
"plugin_runfiles": attr.label_list(
default = [],
allow_files = True,
),
"protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
cfg = "host",
allow_files = True,
executable = True,
),
"_zipper": attr.label(
default = Label("@bazel_tools//tools/zip:zipper"),
cfg = "host",
executable = True,
allow_files = True,
),
},
outputs = {
"out": "%{name}.srcjar",
},
output_to_genfiles = True,
)
def _is_windows(ctx):
return ctx.configuration.host_path_separator == ";"
|
load('//bazel_tools:pkg.bzl', 'pkg_tar')
def get_plugin_runfiles(tool, plugin_runfiles):
"""Gather runfiles for a plugin.
"""
files = []
if not tool:
return files
info = tool[DefaultInfo]
if not info:
return files
if info.files:
files += info.files.to_list()
if info.default_runfiles:
runfiles = info.default_runfiles
if runfiles.files:
files += runfiles.files.to_list()
if info.data_runfiles:
runfiles = info.data_runfiles
if runfiles.files:
files += runfiles.files.to_list()
if plugin_runfiles:
for target in plugin_runfiles:
files += target.files.to_list()
return files
def _proto_gen_impl(ctx):
src_descs = [src.proto.direct_descriptor_set for src in ctx.attr.srcs]
dep_descs = [dep.proto.direct_descriptor_set for dep in ctx.attr.deps]
descriptors = src_descs + dep_descs
sources_out = ctx.actions.declare_directory(ctx.attr.name + '-sources')
descriptor_set_delim = '\\;' if _is_windows(ctx) else ':'
args = []
args += ['--descriptor_set_in=' + descriptor_set_delim.join([d.path for d in descriptors])]
args += ['--{}_out={}:{}'.format(ctx.attr.plugin_name, ','.join(ctx.attr.plugin_options), sources_out.path)]
plugins = []
plugin_runfiles = []
if ctx.attr.plugin_name not in ['java', 'python']:
plugins = [ctx.executable.plugin_exec]
plugin_runfiles = get_plugin_runfiles(ctx.attr.plugin_exec, ctx.attr.plugin_runfiles)
args += ['--plugin=protoc-gen-{}={}'.format(ctx.attr.plugin_name, ctx.executable.plugin_exec.path)]
inputs = []
for src in ctx.attr.srcs:
src_root = src.proto.proto_source_root
for direct_source in src.proto.direct_sources:
path = ''
for i in range(len(src_root) + 1):
if direct_source.path.startswith(src_root[-i:]):
path = direct_source.path[i:]
else:
noop = ''
path = direct_source.short_path if not path else path
path = path[1:] if path.startswith('/') else path
inputs += [path]
args += inputs
ctx.actions.run_shell(mnemonic='ProtoGen', outputs=[sources_out], inputs=descriptors + [ctx.executable.protoc] + plugin_runfiles, command='mkdir -p ' + sources_out.path + ' && ' + ctx.executable.protoc.path + ' ' + ' '.join(args), tools=plugins, use_default_shell_env=True)
zipper_args_file = ctx.actions.declare_file(ctx.label.name + '.zipper_args')
ctx.actions.run_shell(mnemonic='CreateZipperArgsFile', outputs=[zipper_args_file], inputs=[sources_out], command="find -L {src_path} -type f | sed -E 's#^{src_path}/(.*)$#\\1={src_path}/\\1#' | sort > {args_file}".format(src_path=sources_out.path, args_file=zipper_args_file.path), progress_message='zipper_args_file %s' % zipper_args_file.path, use_default_shell_env=True)
zipper_args = ctx.actions.args()
zipper_args.add('c')
zipper_args.add(ctx.outputs.out.path)
zipper_args.add('@%s' % zipper_args_file.path)
ctx.actions.run(executable=ctx.executable._zipper, inputs=[sources_out, zipper_args_file], outputs=[ctx.outputs.out], arguments=[zipper_args], progress_message='srcjar %s' % ctx.outputs.out.short_path)
proto_gen = rule(implementation=_proto_gen_impl, attrs={'srcs': attr.label_list(allow_files=True), 'deps': attr.label_list(providers=[ProtoInfo]), 'plugin_name': attr.string(), 'plugin_exec': attr.label(cfg='host', executable=True), 'plugin_options': attr.string_list(), 'plugin_runfiles': attr.label_list(default=[], allow_files=True), 'protoc': attr.label(default=label('@com_google_protobuf//:protoc'), cfg='host', allow_files=True, executable=True), '_zipper': attr.label(default=label('@bazel_tools//tools/zip:zipper'), cfg='host', executable=True, allow_files=True)}, outputs={'out': '%{name}.srcjar'}, output_to_genfiles=True)
def _is_windows(ctx):
return ctx.configuration.host_path_separator == ';'
|
'''
Unit Test Cases for JSON2HTML
Description - python wrapper for converting JSON to HTML Table format
(c) 2013 Varun Malhotra. MIT License
'''
__author__ = 'Varun Malhotra'
__version__ = '1.1.1'
__license__ = 'MIT'
|
"""
Unit Test Cases for JSON2HTML
Description - python wrapper for converting JSON to HTML Table format
(c) 2013 Varun Malhotra. MIT License
"""
__author__ = 'Varun Malhotra'
__version__ = '1.1.1'
__license__ = 'MIT'
|
# bubble_sort
# Bubble_sort uses the technique of comparing and swapping
def bubble_sort(lst):
for passnum in range(len(lst) - 1, 0, -1):
for i in range(passnum):
if lst[i] > lst[i + 1]:
temp = lst[i]
lst[i] = lst[i + 1]
lst[i + 1] = temp
lst = [54,26,93,17,77,31,44,55,20]
bubble_sort(lst)
print("sorted %s" %lst) # [17,20,26,31,44,54,55,77,91]
|
def bubble_sort(lst):
for passnum in range(len(lst) - 1, 0, -1):
for i in range(passnum):
if lst[i] > lst[i + 1]:
temp = lst[i]
lst[i] = lst[i + 1]
lst[i + 1] = temp
lst = [54, 26, 93, 17, 77, 31, 44, 55, 20]
bubble_sort(lst)
print('sorted %s' % lst)
|
def tip(total, percentage):
tip = (total * percentage) / 100
return tip
print(tip(24, 13))
|
def tip(total, percentage):
tip = total * percentage / 100
return tip
print(tip(24, 13))
|
""""""
"""
# Floyd's Tortoise and Hare
[Reference : wiki](https://en.wikipedia.org/wiki/Cycle_detection)
## Description
Floyd's cycle-finding algorithm is a pointer algorithm that uses only two pointers, which move through the sequence at
different speeds. It is also called the "tortoise and the hare algorithm"
Checking the existence of the cycle in the linked-list. We can also find the node with which linked-list is linked
Linear TIme
Constant Space
"""
class Node:
"""
Node for the linked-list
"""
def __init__(self, data=0, next=None):
self.data = data
self.next = next
class FloydTortoiseAndHare:
"""
Implementation of Floyd's Tortoise and Hare Algorithm
"""
def check_cycle(self, head):
"""
Return True if cycle is present else False
:param head:
:return:
"""
# Two pointers
tortoise, hare = head, head
# Base Case
while hare and hare.next:
tortoise = tortoise.next
hare = hare.next.next
# Condition for cycle
if tortoise == hare:
return True
# Condition when there is no cycle
return False
def cycle_node(self, head):
"""
Finding the node where cycle exists
:param head:
:return:
"""
# Two pointers
tortoise, hare = head, head
while True:
# Condition when pointer reaches to end
if not hare or not hare.next:
return None
tortoise = tortoise.next
hare = hare.next.next
if tortoise == hare:
break
# Iterating over the ll to find
tortoise = head
while tortoise != hare:
tortoise = tortoise.next
hare = hare.next
# Returning node where cycle was found
return tortoise
class FormLinkedList:
"""
Class to form linked-list with cycle
"""
def __init__(self, array, ind):
"""
Initialization
:param array: array of data of linked list
:param ind: Tail linked to the index ind,
if no cycle, then ind = -1
"""
self.head = None
self.array = array
self.ind = ind
def createll(self):
"""
Function to create linked-list with cycle
:return:
"""
node_at_cycle = None
self.head = temp = Node(None)
for index, ele in enumerate(self.array):
new_node = Node(ele)
temp.next = new_node
# Keeping track of the node where tail will be linked
if index == self.ind:
node_at_cycle = temp
temp = temp.next
# linking tail to the node of given index
temp.next = node_at_cycle
return self.head.next
if __name__ == "__main__":
print(f"Enter space separated integers")
array = list(map(int, input().split()))
print(f"Enter the index where tail is linked")
ind = int(input())
formll = FormLinkedList(array, ind)
head = formll.createll()
floyd = FloydTortoiseAndHare()
cycle = floyd.check_cycle(head)
print(f"Cycle is {'' if cycle else 'not '}present")
if cycle:
node = floyd.cycle_node(head)
print(f"Tail connects to node {node.data}")
"""
### Implementation
| Problem No. | Level | Problems | Solutions |
| :--- | :---: | :--- | :---|
| 141. | Easy | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | [Python](https://github.com/ramanaditya/data-structure-and-algorithms/tree/master/leetcode/linked-list/linked-list-cycle.py) |
| 142. | Medium | [Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/) | [Python](https://github.com/ramanaditya/data-structure-and-algorithms/tree/master/leetcode/linked-list/linked-list-cycle-ii.py) |
"""
|
""""""
'\n# Floyd\'s Tortoise and Hare\n[Reference : wiki](https://en.wikipedia.org/wiki/Cycle_detection)\n\n## Description \nFloyd\'s cycle-finding algorithm is a pointer algorithm that uses only two pointers, which move through the sequence at \ndifferent speeds. It is also called the "tortoise and the hare algorithm"\n\nChecking the existence of the cycle in the linked-list. We can also find the node with which linked-list is linked\n\nLinear TIme\nConstant Space\n'
class Node:
"""
Node for the linked-list
"""
def __init__(self, data=0, next=None):
self.data = data
self.next = next
class Floydtortoiseandhare:
"""
Implementation of Floyd's Tortoise and Hare Algorithm
"""
def check_cycle(self, head):
"""
Return True if cycle is present else False
:param head:
:return:
"""
(tortoise, hare) = (head, head)
while hare and hare.next:
tortoise = tortoise.next
hare = hare.next.next
if tortoise == hare:
return True
return False
def cycle_node(self, head):
"""
Finding the node where cycle exists
:param head:
:return:
"""
(tortoise, hare) = (head, head)
while True:
if not hare or not hare.next:
return None
tortoise = tortoise.next
hare = hare.next.next
if tortoise == hare:
break
tortoise = head
while tortoise != hare:
tortoise = tortoise.next
hare = hare.next
return tortoise
class Formlinkedlist:
"""
Class to form linked-list with cycle
"""
def __init__(self, array, ind):
"""
Initialization
:param array: array of data of linked list
:param ind: Tail linked to the index ind,
if no cycle, then ind = -1
"""
self.head = None
self.array = array
self.ind = ind
def createll(self):
"""
Function to create linked-list with cycle
:return:
"""
node_at_cycle = None
self.head = temp = node(None)
for (index, ele) in enumerate(self.array):
new_node = node(ele)
temp.next = new_node
if index == self.ind:
node_at_cycle = temp
temp = temp.next
temp.next = node_at_cycle
return self.head.next
if __name__ == '__main__':
print(f'Enter space separated integers')
array = list(map(int, input().split()))
print(f'Enter the index where tail is linked')
ind = int(input())
formll = form_linked_list(array, ind)
head = formll.createll()
floyd = floyd_tortoise_and_hare()
cycle = floyd.check_cycle(head)
print(f"Cycle is {('' if cycle else 'not ')}present")
if cycle:
node = floyd.cycle_node(head)
print(f'Tail connects to node {node.data}')
'\n### Implementation\n| Problem No. | Level | Problems | Solutions |\n| :--- | :---: | :--- | :---|\n| 141. | Easy | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | [Python](https://github.com/ramanaditya/data-structure-and-algorithms/tree/master/leetcode/linked-list/linked-list-cycle.py) |\n| 142. | Medium | [Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/) | [Python](https://github.com/ramanaditya/data-structure-and-algorithms/tree/master/leetcode/linked-list/linked-list-cycle-ii.py) |\n \n'
|
class Solution:
def validPalindrome(self, s: str) -> bool:
return self.isValidPalindrome(s, False)
def isValidPalindrome(self, s: str, did_delete: bool) -> bool:
curr_left = 0
curr_right = len(s) - 1
while curr_left < curr_right:
# If left and right characters are same, keep checking
if s[curr_left] == s[curr_right]:
curr_left += 1
curr_right -= 1
# If already deleted, not a valid palindrome
elif did_delete:
return False
# If we can still delete one character,
# run check after deleting left, right character
else:
return self.isValidPalindrome(s[curr_left + 1:curr_right + 1], True) or self.isValidPalindrome(s[curr_left:curr_right], True)
return True
|
class Solution:
def valid_palindrome(self, s: str) -> bool:
return self.isValidPalindrome(s, False)
def is_valid_palindrome(self, s: str, did_delete: bool) -> bool:
curr_left = 0
curr_right = len(s) - 1
while curr_left < curr_right:
if s[curr_left] == s[curr_right]:
curr_left += 1
curr_right -= 1
elif did_delete:
return False
else:
return self.isValidPalindrome(s[curr_left + 1:curr_right + 1], True) or self.isValidPalindrome(s[curr_left:curr_right], True)
return True
|
# -*- coding: utf-8 -*-
SPELLINGS_MAP={
"accessorise":"accessorize",
"accessorised":"accessorized",
"accessorises":"accessorizes",
"accessorising":"accessorizing",
"acclimatisation":"acclimatization",
"acclimatise":"acclimatize",
"acclimatised":"acclimatized",
"acclimatises":"acclimatizes",
"acclimatising":"acclimatizing",
"accoutrements":"accouterments",
"aeon":"eon",
"aeons":"eons",
"aerogramme":"aerogram",
"aerogrammes":"aerograms",
"aeroplane":"airplane",
"aeroplanes":"airplanes",
"aesthete":"esthete",
"aesthetes":"esthetes",
"aesthetic":"esthetic",
"aesthetically":"esthetically",
"aesthetics":"esthetics",
"aetiology":"etiology",
"ageing":"aging",
"aggrandisement":"aggrandizement",
"agonise":"agonize",
"agonised":"agonized",
"agonises":"agonizes",
"agonising":"agonizing",
"agonisingly":"agonizingly",
"almanack":"almanac",
"almanacks":"almanacs",
"aluminium":"aluminum",
"amortisable":"amortizable",
"amortisation":"amortization",
"amortisations":"amortizations",
"amortise":"amortize",
"amortised":"amortized",
"amortises":"amortizes",
"amortising":"amortizing",
"amphitheatre":"amphitheater",
"amphitheatres":"amphitheaters",
"anaemia":"anemia",
"anaemic":"anemic",
"anaesthesia":"anesthesia",
"anaesthetic":"anesthetic",
"anaesthetics":"anesthetics",
"anaesthetise":"anesthetize",
"anaesthetised":"anesthetized",
"anaesthetises":"anesthetizes",
"anaesthetising":"anesthetizing",
"anaesthetist":"anesthetist",
"anaesthetists":"anesthetists",
"anaesthetize":"anesthetize",
"anaesthetized":"anesthetized",
"anaesthetizes":"anesthetizes",
"anaesthetizing":"anesthetizing",
"analogue":"analog",
"analogues":"analogs",
"analyse":"analyze",
"analysed":"analyzed",
"analyses":"analyzes",
"analysing":"analyzing",
"anglicise":"anglicize",
"anglicised":"anglicized",
"anglicises":"anglicizes",
"anglicising":"anglicizing",
"annualised":"annualized",
"antagonise":"antagonize",
"antagonised":"antagonized",
"antagonises":"antagonizes",
"antagonising":"antagonizing",
"apologise":"apologize",
"apologised":"apologized",
"apologises":"apologizes",
"apologising":"apologizing",
"appal":"appall",
"appals":"appalls",
"appetiser":"appetizer",
"appetisers":"appetizers",
"appetising":"appetizing",
"appetisingly":"appetizingly",
"arbour":"arbor",
"arbours":"arbors",
"archaeological":"archeological",
"archaeologically":"archeologically",
"archaeologist":"archeologist",
"archaeologists":"archeologists",
"archaeology":"archeology",
"ardour":"ardor",
"armour":"armor",
"armoured":"armored",
"armourer":"armorer",
"armourers":"armorers",
"armouries":"armories",
"armoury":"armory",
"artefact":"artifact",
"artefacts":"artifacts",
"authorise":"authorize",
"authorised":"authorized",
"authorises":"authorizes",
"authorising":"authorizing",
"axe":"ax",
"backpedalled":"backpedaled",
"backpedalling":"backpedaling",
"bannister":"banister",
"bannisters":"banisters",
"baptise":"baptize",
"baptised":"baptized",
"baptises":"baptizes",
"baptising":"baptizing",
"bastardise":"bastardize",
"bastardised":"bastardized",
"bastardises":"bastardizes",
"bastardising":"bastardizing",
"battleaxe":"battleax",
"baulk":"balk",
"baulked":"balked",
"baulking":"balking",
"baulks":"balks",
"bedevilled":"bedeviled",
"bedevilling":"bedeviling",
"behaviour":"behavior",
"behavioural":"behavioral",
"behaviourism":"behaviorism",
"behaviourist":"behaviorist",
"behaviourists":"behaviorists",
"behaviours":"behaviors",
"behove":"behoove",
"behoved":"behooved",
"behoves":"behooves",
"bejewelled":"bejeweled",
"belabour":"belabor",
"belaboured":"belabored",
"belabouring":"belaboring",
"belabours":"belabors",
"bevelled":"beveled",
"bevvies":"bevies",
"bevvy":"bevy",
"biassed":"biased",
"biassing":"biasing",
"bingeing":"binging",
"bougainvillaea":"bougainvillea",
"bougainvillaeas":"bougainvilleas",
"bowdlerise":"bowdlerize",
"bowdlerised":"bowdlerized",
"bowdlerises":"bowdlerizes",
"bowdlerising":"bowdlerizing",
"breathalyse":"breathalyze",
"breathalysed":"breathalyzed",
"breathalyser":"breathalyzer",
"breathalysers":"breathalyzers",
"breathalyses":"breathalyzes",
"breathalysing":"breathalyzing",
"brutalise":"brutalize",
"brutalised":"brutalized",
"brutalises":"brutalizes",
"brutalising":"brutalizing",
"buses":"busses",
"busing":"bussing",
"caesarean":"cesarean",
"caesareans":"cesareans",
"calibre":"caliber",
"calibres":"calibers",
"calliper":"caliper",
"callipers":"calipers",
"callisthenics":"calisthenics",
"canalise":"canalize",
"canalised":"canalized",
"canalises":"canalizes",
"canalising":"canalizing",
"cancellation":"cancelation",
"cancellations":"cancelations",
"cancelled":"canceled",
"cancelling":"canceling",
"candour":"candor",
"cannibalise":"cannibalize",
"cannibalised":"cannibalized",
"cannibalises":"cannibalizes",
"cannibalising":"cannibalizing",
"canonise":"canonize",
"canonised":"canonized",
"canonises":"canonizes",
"canonising":"canonizing",
"capitalise":"capitalize",
"capitalised":"capitalized",
"capitalises":"capitalizes",
"capitalising":"capitalizing",
"caramelise":"caramelize",
"caramelised":"caramelized",
"caramelises":"caramelizes",
"caramelising":"caramelizing",
"carbonise":"carbonize",
"carbonised":"carbonized",
"carbonises":"carbonizes",
"carbonising":"carbonizing",
"carolled":"caroled",
"carolling":"caroling",
"catalogue":"catalog",
"catalogued":"cataloged",
"catalogues":"catalogs",
"cataloguing":"cataloging",
"catalyse":"catalyze",
"catalysed":"catalyzed",
"catalyses":"catalyzes",
"catalysing":"catalyzing",
"categorise":"categorize",
"categorised":"categorized",
"categorises":"categorizes",
"categorising":"categorizing",
"cauterise":"cauterize",
"cauterised":"cauterized",
"cauterises":"cauterizes",
"cauterising":"cauterizing",
"cavilled":"caviled",
"cavilling":"caviling",
"centigramme":"centigram",
"centigrammes":"centigrams",
"centilitre":"centiliter",
"centilitres":"centiliters",
"centimetre":"centimeter",
"centimetres":"centimeters",
"centralise":"centralize",
"centralised":"centralized",
"centralises":"centralizes",
"centralising":"centralizing",
"centre":"center",
"centred":"centered",
"centrefold":"centerfold",
"centrefolds":"centerfolds",
"centrepiece":"centerpiece",
"centrepieces":"centerpieces",
"centres":"centers",
"channelled":"channeled",
"channelling":"channeling",
"characterise":"characterize",
"characterised":"characterized",
"characterises":"characterizes",
"characterising":"characterizing",
"cheque":"check",
"chequebook":"checkbook",
"chequebooks":"checkbooks",
"chequered":"checkered",
"cheques":"checks",
"chilli":"chili",
"chimaera":"chimera",
"chimaeras":"chimeras",
"chiselled":"chiseled",
"chiselling":"chiseling",
"circularise":"circularize",
"circularised":"circularized",
"circularises":"circularizes",
"circularising":"circularizing",
"civilise":"civilize",
"civilised":"civilized",
"civilises":"civilizes",
"civilising":"civilizing",
"clamour":"clamor",
"clamoured":"clamored",
"clamouring":"clamoring",
"clamours":"clamors",
"clangour":"clangor",
"clarinettist":"clarinetist",
"clarinettists":"clarinetists",
"collectivise":"collectivize",
"collectivised":"collectivized",
"collectivises":"collectivizes",
"collectivising":"collectivizing",
"colonisation":"colonization",
"colonise":"colonize",
"colonised":"colonized",
"coloniser":"colonizer",
"colonisers":"colonizers",
"colonises":"colonizes",
"colonising":"colonizing",
"colour":"color",
"colourant":"colorant",
"colourants":"colorants",
"coloured":"colored",
"coloureds":"coloreds",
"colourful":"colorful",
"colourfully":"colorfully",
"colouring":"coloring",
"colourize":"colorize",
"colourized":"colorized",
"colourizes":"colorizes",
"colourizing":"colorizing",
"colourless":"colorless",
"colours":"colors",
"commercialise":"commercialize",
"commercialised":"commercialized",
"commercialises":"commercializes",
"commercialising":"commercializing",
"compartmentalise":"compartmentalize",
"compartmentalised":"compartmentalized",
"compartmentalises":"compartmentalizes",
"compartmentalising":"compartmentalizing",
"computerise":"computerize",
"computerised":"computerized",
"computerises":"computerizes",
"computerising":"computerizing",
"conceptualise":"conceptualize",
"conceptualised":"conceptualized",
"conceptualises":"conceptualizes",
"conceptualising":"conceptualizing",
"connexion":"connection",
"connexions":"connections",
"contextualise":"contextualize",
"contextualised":"contextualized",
"contextualises":"contextualizes",
"contextualising":"contextualizing",
"cosier":"cozier",
"cosies":"cozies",
"cosiest":"coziest",
"cosily":"cozily",
"cosiness":"coziness",
"cosy":"cozy",
"councillor":"councilor",
"councillors":"councilors",
"counselled":"counseled",
"counselling":"counseling",
"counsellor":"counselor",
"counsellors":"counselors",
"crenellated":"crenelated",
"criminalise":"criminalize",
"criminalised":"criminalized",
"criminalises":"criminalizes",
"criminalising":"criminalizing",
"criticise":"criticize",
"criticised":"criticized",
"criticises":"criticizes",
"criticising":"criticizing",
"crueller":"crueler",
"cruellest":"cruelest",
"crystallisation":"crystallization",
"crystallise":"crystallize",
"crystallised":"crystallized",
"crystallises":"crystallizes",
"crystallising":"crystallizing",
"cudgelled":"cudgeled",
"cudgelling":"cudgeling",
"customise":"customize",
"customised":"customized",
"customises":"customizes",
"customising":"customizing",
"cypher":"cipher",
"cyphers":"ciphers",
"decentralisation":"decentralization",
"decentralise":"decentralize",
"decentralised":"decentralized",
"decentralises":"decentralizes",
"decentralising":"decentralizing",
"decriminalisation":"decriminalization",
"decriminalise":"decriminalize",
"decriminalised":"decriminalized",
"decriminalises":"decriminalizes",
"decriminalising":"decriminalizing",
"defence":"defense",
"defenceless":"defenseless",
"defences":"defenses",
"dehumanisation":"dehumanization",
"dehumanise":"dehumanize",
"dehumanised":"dehumanized",
"dehumanises":"dehumanizes",
"dehumanising":"dehumanizing",
"demeanour":"demeanor",
"demilitarisation":"demilitarization",
"demilitarise":"demilitarize",
"demilitarised":"demilitarized",
"demilitarises":"demilitarizes",
"demilitarising":"demilitarizing",
"demobilisation":"demobilization",
"demobilise":"demobilize",
"demobilised":"demobilized",
"demobilises":"demobilizes",
"demobilising":"demobilizing",
"democratisation":"democratization",
"democratise":"democratize",
"democratised":"democratized",
"democratises":"democratizes",
"democratising":"democratizing",
"demonise":"demonize",
"demonised":"demonized",
"demonises":"demonizes",
"demonising":"demonizing",
"demoralisation":"demoralization",
"demoralise":"demoralize",
"demoralised":"demoralized",
"demoralises":"demoralizes",
"demoralising":"demoralizing",
"denationalisation":"denationalization",
"denationalise":"denationalize",
"denationalised":"denationalized",
"denationalises":"denationalizes",
"denationalising":"denationalizing",
"deodorise":"deodorize",
"deodorised":"deodorized",
"deodorises":"deodorizes",
"deodorising":"deodorizing",
"depersonalise":"depersonalize",
"depersonalised":"depersonalized",
"depersonalises":"depersonalizes",
"depersonalising":"depersonalizing",
"deputise":"deputize",
"deputised":"deputized",
"deputises":"deputizes",
"deputising":"deputizing",
"desensitisation":"desensitization",
"desensitise":"desensitize",
"desensitised":"desensitized",
"desensitises":"desensitizes",
"desensitising":"desensitizing",
"destabilisation":"destabilization",
"destabilise":"destabilize",
"destabilised":"destabilized",
"destabilises":"destabilizes",
"destabilising":"destabilizing",
"dialled":"dialed",
"dialling":"dialing",
"dialogue":"dialog",
"dialogues":"dialogs",
"diarrhoea":"diarrhea",
"digitise":"digitize",
"digitised":"digitized",
"digitises":"digitizes",
"digitising":"digitizing",
"disc":"disk",
"discolour":"discolor",
"discoloured":"discolored",
"discolouring":"discoloring",
"discolours":"discolors",
"discs":"disks",
"disembowelled":"disemboweled",
"disembowelling":"disemboweling",
"disfavour":"disfavor",
"dishevelled":"disheveled",
"dishonour":"dishonor",
"dishonourable":"dishonorable",
"dishonourably":"dishonorably",
"dishonoured":"dishonored",
"dishonouring":"dishonoring",
"dishonours":"dishonors",
"disorganisation":"disorganization",
"disorganised":"disorganized",
"distil":"distill",
"distils":"distills",
"dramatisation":"dramatization",
"dramatisations":"dramatizations",
"dramatise":"dramatize",
"dramatised":"dramatized",
"dramatises":"dramatizes",
"dramatising":"dramatizing",
"draught":"draft",
"draughtboard":"draftboard",
"draughtboards":"draftboards",
"draughtier":"draftier",
"draughtiest":"draftiest",
"draughts":"drafts",
"draughtsman":"draftsman",
"draughtsmanship":"draftsmanship",
"draughtsmen":"draftsmen",
"draughtswoman":"draftswoman",
"draughtswomen":"draftswomen",
"draughty":"drafty",
"drivelled":"driveled",
"drivelling":"driveling",
"duelled":"dueled",
"duelling":"dueling",
"economise":"economize",
"economised":"economized",
"economises":"economizes",
"economising":"economizing",
"edoema":"edema",
"editorialise":"editorialize",
"editorialised":"editorialized",
"editorialises":"editorializes",
"editorialising":"editorializing",
"empathise":"empathize",
"empathised":"empathized",
"empathises":"empathizes",
"empathising":"empathizing",
"emphasise":"emphasize",
"emphasised":"emphasized",
"emphasises":"emphasizes",
"emphasising":"emphasizing",
"enamelled":"enameled",
"enamelling":"enameling",
"enamoured":"enamored",
"encyclopaedia":"encyclopedia",
"encyclopaedias":"encyclopedias",
"encyclopaedic":"encyclopedic",
"endeavour":"endeavor",
"endeavoured":"endeavored",
"endeavouring":"endeavoring",
"endeavours":"endeavors",
"energise":"energize",
"energised":"energized",
"energises":"energizes",
"energising":"energizing",
"enrol":"enroll",
"enrols":"enrolls",
"enthral":"enthrall",
"enthrals":"enthralls",
"epaulette":"epaulet",
"epaulettes":"epaulets",
"epicentre":"epicenter",
"epicentres":"epicenters",
"epilogue":"epilog",
"epilogues":"epilogs",
"epitomise":"epitomize",
"epitomised":"epitomized",
"epitomises":"epitomizes",
"epitomising":"epitomizing",
"equalisation":"equalization",
"equalise":"equalize",
"equalised":"equalized",
"equaliser":"equalizer",
"equalisers":"equalizers",
"equalises":"equalizes",
"equalising":"equalizing",
"eulogise":"eulogize",
"eulogised":"eulogized",
"eulogises":"eulogizes",
"eulogising":"eulogizing",
"evangelise":"evangelize",
"evangelised":"evangelized",
"evangelises":"evangelizes",
"evangelising":"evangelizing",
"exorcise":"exorcize",
"exorcised":"exorcized",
"exorcises":"exorcizes",
"exorcising":"exorcizing",
"extemporisation":"extemporization",
"extemporise":"extemporize",
"extemporised":"extemporized",
"extemporises":"extemporizes",
"extemporising":"extemporizing",
"externalisation":"externalization",
"externalisations":"externalizations",
"externalise":"externalize",
"externalised":"externalized",
"externalises":"externalizes",
"externalising":"externalizing",
"factorise":"factorize",
"factorised":"factorized",
"factorises":"factorizes",
"factorising":"factorizing",
"faecal":"fecal",
"faeces":"feces",
"familiarisation":"familiarization",
"familiarise":"familiarize",
"familiarised":"familiarized",
"familiarises":"familiarizes",
"familiarising":"familiarizing",
"fantasise":"fantasize",
"fantasised":"fantasized",
"fantasises":"fantasizes",
"fantasising":"fantasizing",
"favour":"favor",
"favourable":"favorable",
"favourably":"favorably",
"favoured":"favored",
"favouring":"favoring",
"favourite":"favorite",
"favourites":"favorites",
"favouritism":"favoritism",
"favours":"favors",
"feminise":"feminize",
"feminised":"feminized",
"feminises":"feminizes",
"feminising":"feminizing",
"fertilisation":"fertilization",
"fertilise":"fertilize",
"fertilised":"fertilized",
"fertiliser":"fertilizer",
"fertilisers":"fertilizers",
"fertilises":"fertilizes",
"fertilising":"fertilizing",
"fervour":"fervor",
"fibre":"fiber",
"fibreglass":"fiberglass",
"fibres":"fibers",
"fictionalisation":"fictionalization",
"fictionalisations":"fictionalizations",
"fictionalise":"fictionalize",
"fictionalised":"fictionalized",
"fictionalises":"fictionalizes",
"fictionalising":"fictionalizing",
"fillet":"filet",
"filleted":"fileted",
"filleting":"fileting",
"fillets":"filets",
"finalisation":"finalization",
"finalise":"finalize",
"finalised":"finalized",
"finalises":"finalizes",
"finalising":"finalizing",
"flautist":"flutist",
"flautists":"flutists",
"flavour":"flavor",
"flavoured":"flavored",
"flavouring":"flavoring",
"flavourings":"flavorings",
"flavourless":"flavorless",
"flavours":"flavors",
"flavoursome":"flavorsome",
"flyer / flier":"flier / flyer",
"foetal":"fetal",
"foetid":"fetid",
"foetus":"fetus",
"foetuses":"fetuses",
"formalisation":"formalization",
"formalise":"formalize",
"formalised":"formalized",
"formalises":"formalizes",
"formalising":"formalizing",
"fossilisation":"fossilization",
"fossilise":"fossilize",
"fossilised":"fossilized",
"fossilises":"fossilizes",
"fossilising":"fossilizing",
"fraternisation":"fraternization",
"fraternise":"fraternize",
"fraternised":"fraternized",
"fraternises":"fraternizes",
"fraternising":"fraternizing",
"fulfil":"fulfill",
"fulfilment":"fulfillment",
"fulfils":"fulfills",
"funnelled":"funneled",
"funnelling":"funneling",
"galvanise":"galvanize",
"galvanised":"galvanized",
"galvanises":"galvanizes",
"galvanising":"galvanizing",
"gambolled":"gamboled",
"gambolling":"gamboling",
"gaol":"jail",
"gaolbird":"jailbird",
"gaolbirds":"jailbirds",
"gaolbreak":"jailbreak",
"gaolbreaks":"jailbreaks",
"gaoled":"jailed",
"gaoler":"jailer",
"gaolers":"jailers",
"gaoling":"jailing",
"gaols":"jails",
"gases":"gasses",
"gauge":"gage",
"gauged":"gaged",
"gauges":"gages",
"gauging":"gaging",
"generalisation":"generalization",
"generalisations":"generalizations",
"generalise":"generalize",
"generalised":"generalized",
"generalises":"generalizes",
"generalising":"generalizing",
"ghettoise":"ghettoize",
"ghettoised":"ghettoized",
"ghettoises":"ghettoizes",
"ghettoising":"ghettoizing",
"gipsies":"gypsies",
"glamorise":"glamorize",
"glamorised":"glamorized",
"glamorises":"glamorizes",
"glamorising":"glamorizing",
"glamour":"glamor",
"globalisation":"globalization",
"globalise":"globalize",
"globalised":"globalized",
"globalises":"globalizes",
"globalising":"globalizing",
"glueing":"gluing",
"goitre":"goiter",
"goitres":"goiters",
"gonorrhoea":"gonorrhea",
"gramme":"gram",
"grammes":"grams",
"gravelled":"graveled",
"grey":"gray",
"greyed":"grayed",
"greying":"graying",
"greyish":"grayish",
"greyness":"grayness",
"greys":"grays",
"grovelled":"groveled",
"grovelling":"groveling",
"groyne":"groin",
"groynes":"groins",
"gruelling":"grueling",
"gruellingly":"gruelingly",
"gryphon":"griffin",
"gryphons":"griffins",
"gynaecological":"gynecological",
"gynaecologist":"gynecologist",
"gynaecologists":"gynecologists",
"gynaecology":"gynecology",
"haematological":"hematological",
"haematologist":"hematologist",
"haematologists":"hematologists",
"haematology":"hematology",
"haemoglobin":"hemoglobin",
"haemophilia":"hemophilia",
"haemophiliac":"hemophiliac",
"haemophiliacs":"hemophiliacs",
"haemorrhage":"hemorrhage",
"haemorrhaged":"hemorrhaged",
"haemorrhages":"hemorrhages",
"haemorrhaging":"hemorrhaging",
"haemorrhoids":"hemorrhoids",
"harbour":"harbor",
"harboured":"harbored",
"harbouring":"harboring",
"harbours":"harbors",
"harmonisation":"harmonization",
"harmonise":"harmonize",
"harmonised":"harmonized",
"harmonises":"harmonizes",
"harmonising":"harmonizing",
"homoeopath":"homeopath",
"homoeopathic":"homeopathic",
"homoeopaths":"homeopaths",
"homoeopathy":"homeopathy",
"homogenise":"homogenize",
"homogenised":"homogenized",
"homogenises":"homogenizes",
"homogenising":"homogenizing",
"honour":"honor",
"honourable":"honorable",
"honourably":"honorably",
"honoured":"honored",
"honouring":"honoring",
"honours":"honors",
"hospitalisation":"hospitalization",
"hospitalise":"hospitalize",
"hospitalised":"hospitalized",
"hospitalises":"hospitalizes",
"hospitalising":"hospitalizing",
"humanise":"humanize",
"humanised":"humanized",
"humanises":"humanizes",
"humanising":"humanizing",
"humour":"humor",
"humoured":"humored",
"humouring":"humoring",
"humourless":"humorless",
"humours":"humors",
"hybridise":"hybridize",
"hybridised":"hybridized",
"hybridises":"hybridizes",
"hybridising":"hybridizing",
"hypnotise":"hypnotize",
"hypnotised":"hypnotized",
"hypnotises":"hypnotizes",
"hypnotising":"hypnotizing",
"hypothesise":"hypothesize",
"hypothesised":"hypothesized",
"hypothesises":"hypothesizes",
"hypothesising":"hypothesizing",
"idealisation":"idealization",
"idealise":"idealize",
"idealised":"idealized",
"idealises":"idealizes",
"idealising":"idealizing",
"idolise":"idolize",
"idolised":"idolized",
"idolises":"idolizes",
"idolising":"idolizing",
"immobilisation":"immobilization",
"immobilise":"immobilize",
"immobilised":"immobilized",
"immobiliser":"immobilizer",
"immobilisers":"immobilizers",
"immobilises":"immobilizes",
"immobilising":"immobilizing",
"immortalise":"immortalize",
"immortalised":"immortalized",
"immortalises":"immortalizes",
"immortalising":"immortalizing",
"immunisation":"immunization",
"immunise":"immunize",
"immunised":"immunized",
"immunises":"immunizes",
"immunising":"immunizing",
"impanelled":"impaneled",
"impanelling":"impaneling",
"imperilled":"imperiled",
"imperilling":"imperiling",
"individualise":"individualize",
"individualised":"individualized",
"individualises":"individualizes",
"individualising":"individualizing",
"industrialise":"industrialize",
"industrialised":"industrialized",
"industrialises":"industrializes",
"industrialising":"industrializing",
"inflexion":"inflection",
"inflexions":"inflections",
"initialise":"initialize",
"initialised":"initialized",
"initialises":"initializes",
"initialising":"initializing",
"initialled":"initialed",
"initialling":"initialing",
"instal":"install",
"instalment":"installment",
"instalments":"installments",
"instals":"installs",
"instil":"instill",
"instils":"instills",
"institutionalisation":"institutionalization",
"institutionalise":"institutionalize",
"institutionalised":"institutionalized",
"institutionalises":"institutionalizes",
"institutionalising":"institutionalizing",
"intellectualise":"intellectualize",
"intellectualised":"intellectualized",
"intellectualises":"intellectualizes",
"intellectualising":"intellectualizing",
"internalisation":"internalization",
"internalise":"internalize",
"internalised":"internalized",
"internalises":"internalizes",
"internalising":"internalizing",
"internationalisation":"internationalization",
"internationalise":"internationalize",
"internationalised":"internationalized",
"internationalises":"internationalizes",
"internationalising":"internationalizing",
"ionisation":"ionization",
"ionise":"ionize",
"ionised":"ionized",
"ioniser":"ionizer",
"ionisers":"ionizers",
"ionises":"ionizes",
"ionising":"ionizing",
"italicise":"italicize",
"italicised":"italicized",
"italicises":"italicizes",
"italicising":"italicizing",
"itemise":"itemize",
"itemised":"itemized",
"itemises":"itemizes",
"itemising":"itemizing",
"jeopardise":"jeopardize",
"jeopardised":"jeopardized",
"jeopardises":"jeopardizes",
"jeopardising":"jeopardizing",
"jewelled":"jeweled",
"jeweller":"jeweler",
"jewellers":"jewelers",
"jewellery":"jewelry",
"judgement":"judgment",
"kilogramme":"kilogram",
"kilogrammes":"kilograms",
"kilometre":"kilometer",
"kilometres":"kilometers",
"labelled":"labeled",
"labelling":"labeling",
"labour":"labor",
"laboured":"labored",
"labourer":"laborer",
"labourers":"laborers",
"labouring":"laboring",
"labours":"labors",
"lacklustre":"lackluster",
"legalisation":"legalization",
"legalise":"legalize",
"legalised":"legalized",
"legalises":"legalizes",
"legalising":"legalizing",
"legitimise":"legitimize",
"legitimised":"legitimized",
"legitimises":"legitimizes",
"legitimising":"legitimizing",
"leukaemia":"leukemia",
"levelled":"leveled",
"leveller":"leveler",
"levellers":"levelers",
"levelling":"leveling",
"libelled":"libeled",
"libelling":"libeling",
"libellous":"libelous",
"liberalisation":"liberalization",
"liberalise":"liberalize",
"liberalised":"liberalized",
"liberalises":"liberalizes",
"liberalising":"liberalizing",
"licence":"license",
"licenced":"licensed",
"licences":"licenses",
"licencing":"licensing",
"likeable":"likable",
"lionisation":"lionization",
"lionise":"lionize",
"lionised":"lionized",
"lionises":"lionizes",
"lionising":"lionizing",
"liquidise":"liquidize",
"liquidised":"liquidized",
"liquidiser":"liquidizer",
"liquidisers":"liquidizers",
"liquidises":"liquidizes",
"liquidising":"liquidizing",
"litre":"liter",
"litres":"liters",
"localise":"localize",
"localised":"localized",
"localises":"localizes",
"localising":"localizing",
"louvre":"louver",
"louvred":"louvered",
"louvres":"louvers",
"lustre":"luster",
"magnetise":"magnetize",
"magnetised":"magnetized",
"magnetises":"magnetizes",
"magnetising":"magnetizing",
"manoeuvrability":"maneuverability",
"manoeuvrable":"maneuverable",
"manoeuvre":"maneuver",
"manoeuvred":"maneuvered",
"manoeuvres":"maneuvers",
"manoeuvring":"maneuvering",
"manoeuvrings":"maneuverings",
"marginalisation":"marginalization",
"marginalise":"marginalize",
"marginalised":"marginalized",
"marginalises":"marginalizes",
"marginalising":"marginalizing",
"marshalled":"marshaled",
"marshalling":"marshaling",
"marvelled":"marveled",
"marvelling":"marveling",
"marvellous":"marvelous",
"marvellously":"marvelously",
"materialisation":"materialization",
"materialise":"materialize",
"materialised":"materialized",
"materialises":"materializes",
"materialising":"materializing",
"maximisation":"maximization",
"maximise":"maximize",
"maximised":"maximized",
"maximises":"maximizes",
"maximising":"maximizing",
"meagre":"meager",
"mechanisation":"mechanization",
"mechanise":"mechanize",
"mechanised":"mechanized",
"mechanises":"mechanizes",
"mechanising":"mechanizing",
"mediaeval":"medieval",
"memorialise":"memorialize",
"memorialised":"memorialized",
"memorialises":"memorializes",
"memorialising":"memorializing",
"memorise":"memorize",
"memorised":"memorized",
"memorises":"memorizes",
"memorising":"memorizing",
"mesmerise":"mesmerize",
"mesmerised":"mesmerized",
"mesmerises":"mesmerizes",
"mesmerising":"mesmerizing",
"metabolise":"metabolize",
"metabolised":"metabolized",
"metabolises":"metabolizes",
"metabolising":"metabolizing",
"metre":"meter",
"metres":"meters",
"micrometre":"micrometer",
"micrometres":"micrometers",
"militarise":"militarize",
"militarised":"militarized",
"militarises":"militarizes",
"militarising":"militarizing",
"milligramme":"milligram",
"milligrammes":"milligrams",
"millilitre":"milliliter",
"millilitres":"milliliters",
"millimetre":"millimeter",
"millimetres":"millimeters",
"miniaturisation":"miniaturization",
"miniaturise":"miniaturize",
"miniaturised":"miniaturized",
"miniaturises":"miniaturizes",
"miniaturising":"miniaturizing",
"minibuses":"minibusses",
"minimise":"minimize",
"minimised":"minimized",
"minimises":"minimizes",
"minimising":"minimizing",
"misbehaviour":"misbehavior",
"misdemeanour":"misdemeanor",
"misdemeanours":"misdemeanors",
"misspelt":"misspelled",
"mitre":"miter",
"mitres":"miters",
"mobilisation":"mobilization",
"mobilise":"mobilize",
"mobilised":"mobilized",
"mobilises":"mobilizes",
"mobilising":"mobilizing",
"modelled":"modeled",
"modeller":"modeler",
"modellers":"modelers",
"modelling":"modeling",
"modernise":"modernize",
"modernised":"modernized",
"modernises":"modernizes",
"modernising":"modernizing",
"moisturise":"moisturize",
"moisturised":"moisturized",
"moisturiser":"moisturizer",
"moisturisers":"moisturizers",
"moisturises":"moisturizes",
"moisturising":"moisturizing",
"monologue":"monolog",
"monologues":"monologs",
"monopolisation":"monopolization",
"monopolise":"monopolize",
"monopolised":"monopolized",
"monopolises":"monopolizes",
"monopolising":"monopolizing",
"moralise":"moralize",
"moralised":"moralized",
"moralises":"moralizes",
"moralising":"moralizing",
"motorised":"motorized",
"mould":"mold",
"moulded":"molded",
"moulder":"molder",
"mouldered":"moldered",
"mouldering":"moldering",
"moulders":"molders",
"mouldier":"moldier",
"mouldiest":"moldiest",
"moulding":"molding",
"mouldings":"moldings",
"moulds":"molds",
"mouldy":"moldy",
"moult":"molt",
"moulted":"molted",
"moulting":"molting",
"moults":"molts",
"moustache":"mustache",
"moustached":"mustached",
"moustaches":"mustaches",
"moustachioed":"mustachioed",
"multicoloured":"multicolored",
"nationalisation":"nationalization",
"nationalisations":"nationalizations",
"nationalise":"nationalize",
"nationalised":"nationalized",
"nationalises":"nationalizes",
"nationalising":"nationalizing",
"naturalisation":"naturalization",
"naturalise":"naturalize",
"naturalised":"naturalized",
"naturalises":"naturalizes",
"naturalising":"naturalizing",
"neighbour":"neighbor",
"neighbourhood":"neighborhood",
"neighbourhoods":"neighborhoods",
"neighbouring":"neighboring",
"neighbourliness":"neighborliness",
"neighbourly":"neighborly",
"neighbours":"neighbors",
"neutralisation":"neutralization",
"neutralise":"neutralize",
"neutralised":"neutralized",
"neutralises":"neutralizes",
"neutralising":"neutralizing",
"normalisation":"normalization",
"normalise":"normalize",
"normalised":"normalized",
"normalises":"normalizes",
"normalising":"normalizing",
"odour":"odor",
"odourless":"odorless",
"odours":"odors",
"oesophagus":"esophagus",
"oesophaguses":"esophaguses",
"oestrogen":"estrogen",
"offence":"offense",
"offences":"offenses",
"omelette":"omelet",
"omelettes":"omelets",
"optimise":"optimize",
"optimised":"optimized",
"optimises":"optimizes",
"optimising":"optimizing",
"organisation":"organization",
"organisational":"organizational",
"organisations":"organizations",
"organise":"organize",
"organised":"organized",
"organiser":"organizer",
"organisers":"organizers",
"organises":"organizes",
"organising":"organizing",
"orthopaedic":"orthopedic",
"orthopaedics":"orthopedics",
"ostracise":"ostracize",
"ostracised":"ostracized",
"ostracises":"ostracizes",
"ostracising":"ostracizing",
"outmanoeuvre":"outmaneuver",
"outmanoeuvred":"outmaneuvered",
"outmanoeuvres":"outmaneuvers",
"outmanoeuvring":"outmaneuvering",
"overemphasise":"overemphasize",
"overemphasised":"overemphasized",
"overemphasises":"overemphasizes",
"overemphasising":"overemphasizing",
"oxidisation":"oxidization",
"oxidise":"oxidize",
"oxidised":"oxidized",
"oxidises":"oxidizes",
"oxidising":"oxidizing",
"paederast":"pederast",
"paederasts":"pederasts",
"paediatric":"pediatric",
"paediatrician":"pediatrician",
"paediatricians":"pediatricians",
"paediatrics":"pediatrics",
"paedophile":"pedophile",
"paedophiles":"pedophiles",
"paedophilia":"pedophilia",
"palaeolithic":"paleolithic",
"palaeontologist":"paleontologist",
"palaeontologists":"paleontologists",
"palaeontology":"paleontology",
"panelled":"paneled",
"panelling":"paneling",
"panellist":"panelist",
"panellists":"panelists",
"paralyse":"paralyze",
"paralysed":"paralyzed",
"paralyses":"paralyzes",
"paralysing":"paralyzing",
"parcelled":"parceled",
"parcelling":"parceling",
"parlour":"parlor",
"parlours":"parlors",
"particularise":"particularize",
"particularised":"particularized",
"particularises":"particularizes",
"particularising":"particularizing",
"passivisation":"passivization",
"passivise":"passivize",
"passivised":"passivized",
"passivises":"passivizes",
"passivising":"passivizing",
"pasteurisation":"pasteurization",
"pasteurise":"pasteurize",
"pasteurised":"pasteurized",
"pasteurises":"pasteurizes",
"pasteurising":"pasteurizing",
"patronise":"patronize",
"patronised":"patronized",
"patronises":"patronizes",
"patronising":"patronizing",
"patronisingly":"patronizingly",
"pedalled":"pedaled",
"pedalling":"pedaling",
"pedestrianisation":"pedestrianization",
"pedestrianise":"pedestrianize",
"pedestrianised":"pedestrianized",
"pedestrianises":"pedestrianizes",
"pedestrianising":"pedestrianizing",
"penalise":"penalize",
"penalised":"penalized",
"penalises":"penalizes",
"penalising":"penalizing",
"pencilled":"penciled",
"pencilling":"penciling",
"personalise":"personalize",
"personalised":"personalized",
"personalises":"personalizes",
"personalising":"personalizing",
"pharmacopoeia":"pharmacopeia",
"pharmacopoeias":"pharmacopeias",
"philosophise":"philosophize",
"philosophised":"philosophized",
"philosophises":"philosophizes",
"philosophising":"philosophizing",
"philtre":"filter",
"philtres":"filters",
"phoney":"phony",
"plagiarise":"plagiarize",
"plagiarised":"plagiarized",
"plagiarises":"plagiarizes",
"plagiarising":"plagiarizing",
"plough":"plow",
"ploughed":"plowed",
"ploughing":"plowing",
"ploughman":"plowman",
"ploughmen":"plowmen",
"ploughs":"plows",
"ploughshare":"plowshare",
"ploughshares":"plowshares",
"polarisation":"polarization",
"polarise":"polarize",
"polarised":"polarized",
"polarises":"polarizes",
"polarising":"polarizing",
"politicisation":"politicization",
"politicise":"politicize",
"politicised":"politicized",
"politicises":"politicizes",
"politicising":"politicizing",
"popularisation":"popularization",
"popularise":"popularize",
"popularised":"popularized",
"popularises":"popularizes",
"popularising":"popularizing",
"pouffe":"pouf",
"pouffes":"poufs",
"practise":"practice",
"practised":"practiced",
"practises":"practices",
"practising":"practicing",
"praesidium":"presidium",
"praesidiums":"presidiums",
"pressurisation":"pressurization",
"pressurise":"pressurize",
"pressurised":"pressurized",
"pressurises":"pressurizes",
"pressurising":"pressurizing",
"pretence":"pretense",
"pretences":"pretenses",
"primaeval":"primeval",
"prioritisation":"prioritization",
"prioritise":"prioritize",
"prioritised":"prioritized",
"prioritises":"prioritizes",
"prioritising":"prioritizing",
"privatisation":"privatization",
"privatisations":"privatizations",
"privatise":"privatize",
"privatised":"privatized",
"privatises":"privatizes",
"privatising":"privatizing",
"professionalisation":"professionalization",
"professionalise":"professionalize",
"professionalised":"professionalized",
"professionalises":"professionalizes",
"professionalising":"professionalizing",
"programme":"program",
"programmes":"programs",
"prologue":"prolog",
"prologues":"prologs",
"propagandise":"propagandize",
"propagandised":"propagandized",
"propagandises":"propagandizes",
"propagandising":"propagandizing",
"proselytise":"proselytize",
"proselytised":"proselytized",
"proselytiser":"proselytizer",
"proselytisers":"proselytizers",
"proselytises":"proselytizes",
"proselytising":"proselytizing",
"psychoanalyse":"psychoanalyze",
"psychoanalysed":"psychoanalyzed",
"psychoanalyses":"psychoanalyzes",
"psychoanalysing":"psychoanalyzing",
"publicise":"publicize",
"publicised":"publicized",
"publicises":"publicizes",
"publicising":"publicizing",
"pulverisation":"pulverization",
"pulverise":"pulverize",
"pulverised":"pulverized",
"pulverises":"pulverizes",
"pulverising":"pulverizing",
"pummelled":"pummel",
"pummelling":"pummeled",
"pyjama":"pajama",
"pyjamas":"pajamas",
"pzazz":"pizzazz",
"quarrelled":"quarreled",
"quarrelling":"quarreling",
"radicalise":"radicalize",
"radicalised":"radicalized",
"radicalises":"radicalizes",
"radicalising":"radicalizing",
"rancour":"rancor",
"randomise":"randomize",
"randomised":"randomized",
"randomises":"randomizes",
"randomising":"randomizing",
"rationalisation":"rationalization",
"rationalisations":"rationalizations",
"rationalise":"rationalize",
"rationalised":"rationalized",
"rationalises":"rationalizes",
"rationalising":"rationalizing",
"ravelled":"raveled",
"ravelling":"raveling",
"realisable":"realizable",
"realisation":"realization",
"realisations":"realizations",
"realise":"realize",
"realised":"realized",
"realises":"realizes",
"realising":"realizing",
"recognisable":"recognizable",
"recognisably":"recognizably",
"recognisance":"recognizance",
"recognise":"recognize",
"recognised":"recognized",
"recognises":"recognizes",
"recognising":"recognizing",
"reconnoitre":"reconnoiter",
"reconnoitred":"reconnoitered",
"reconnoitres":"reconnoiters",
"reconnoitring":"reconnoitering",
"refuelled":"refueled",
"refuelling":"refueling",
"regularisation":"regularization",
"regularise":"regularize",
"regularised":"regularized",
"regularises":"regularizes",
"regularising":"regularizing",
"remodelled":"remodeled",
"remodelling":"remodeling",
"remould":"remold",
"remoulded":"remolded",
"remoulding":"remolding",
"remoulds":"remolds",
"reorganisation":"reorganization",
"reorganisations":"reorganizations",
"reorganise":"reorganize",
"reorganised":"reorganized",
"reorganises":"reorganizes",
"reorganising":"reorganizing",
"revelled":"reveled",
"reveller":"reveler",
"revellers":"revelers",
"revelling":"reveling",
"revitalise":"revitalize",
"revitalised":"revitalized",
"revitalises":"revitalizes",
"revitalising":"revitalizing",
"revolutionise":"revolutionize",
"revolutionised":"revolutionized",
"revolutionises":"revolutionizes",
"revolutionising":"revolutionizing",
"rhapsodise":"rhapsodize",
"rhapsodised":"rhapsodized",
"rhapsodises":"rhapsodizes",
"rhapsodising":"rhapsodizing",
"rigour":"rigor",
"rigours":"rigors",
"ritualised":"ritualized",
"rivalled":"rivaled",
"rivalling":"rivaling",
"romanticise":"romanticize",
"romanticised":"romanticized",
"romanticises":"romanticizes",
"romanticising":"romanticizing",
"rumour":"rumor",
"rumoured":"rumored",
"rumours":"rumors",
"sabre":"saber",
"sabres":"sabers",
"saltpetre":"saltpeter",
"sanitise":"sanitize",
"sanitised":"sanitized",
"sanitises":"sanitizes",
"sanitising":"sanitizing",
"satirise":"satirize",
"satirised":"satirized",
"satirises":"satirizes",
"satirising":"satirizing",
"saviour":"savior",
"saviours":"saviors",
"savour":"savor",
"savoured":"savored",
"savouries":"savories",
"savouring":"savoring",
"savours":"savors",
"savoury":"savory",
"scandalise":"scandalize",
"scandalised":"scandalized",
"scandalises":"scandalizes",
"scandalising":"scandalizing",
"sceptic":"skeptic",
"sceptical":"skeptical",
"sceptically":"skeptically",
"scepticism":"skepticism",
"sceptics":"skeptics",
"sceptre":"scepter",
"sceptres":"scepters",
"scrutinise":"scrutinize",
"scrutinised":"scrutinized",
"scrutinises":"scrutinizes",
"scrutinising":"scrutinizing",
"secularisation":"secularization",
"secularise":"secularize",
"secularised":"secularized",
"secularises":"secularizes",
"secularising":"secularizing",
"sensationalise":"sensationalize",
"sensationalised":"sensationalized",
"sensationalises":"sensationalizes",
"sensationalising":"sensationalizing",
"sensitise":"sensitize",
"sensitised":"sensitized",
"sensitises":"sensitizes",
"sensitising":"sensitizing",
"sentimentalise":"sentimentalize",
"sentimentalised":"sentimentalized",
"sentimentalises":"sentimentalizes",
"sentimentalising":"sentimentalizing",
"sepulchre":"sepulcher",
"sepulchres":"sepulchers",
"serialisation":"serialization",
"serialisations":"serializations",
"serialise":"serialize",
"serialised":"serialized",
"serialises":"serializes",
"serialising":"serializing",
"sermonise":"sermonize",
"sermonised":"sermonized",
"sermonises":"sermonizes",
"sermonising":"sermonizing",
"sheikh":"sheik",
"shovelled":"shoveled",
"shovelling":"shoveling",
"shrivelled":"shriveled",
"shrivelling":"shriveling",
"signalise":"signalize",
"signalised":"signalized",
"signalises":"signalizes",
"signalising":"signalizing",
"signalled":"signaled",
"signalling":"signaling",
"smoulder":"smolder",
"smouldered":"smoldered",
"smouldering":"smoldering",
"smoulders":"smolders",
"snivelled":"sniveled",
"snivelling":"sniveling",
"snorkelled":"snorkeled",
"snorkelling":"snorkeling",
"snowplough":"snowplow",
"snowploughs":"snowplow",
"socialisation":"socialization",
"socialise":"socialize",
"socialised":"socialized",
"socialises":"socializes",
"socialising":"socializing",
"sodomise":"sodomize",
"sodomised":"sodomized",
"sodomises":"sodomizes",
"sodomising":"sodomizing",
"solemnise":"solemnize",
"solemnised":"solemnized",
"solemnises":"solemnizes",
"solemnising":"solemnizing",
"sombre":"somber",
"specialisation":"specialization",
"specialisations":"specializations",
"specialise":"specialize",
"specialised":"specialized",
"specialises":"specializes",
"specialising":"specializing",
"spectre":"specter",
"spectres":"specters",
"spiralled":"spiraled",
"spiralling":"spiraling",
"splendour":"splendor",
"splendours":"splendors",
"squirrelled":"squirreled",
"squirrelling":"squirreling",
"stabilisation":"stabilization",
"stabilise":"stabilize",
"stabilised":"stabilized",
"stabiliser":"stabilizer",
"stabilisers":"stabilizers",
"stabilises":"stabilizes",
"stabilising":"stabilizing",
"standardisation":"standardization",
"standardise":"standardize",
"standardised":"standardized",
"standardises":"standardizes",
"standardising":"standardizing",
"stencilled":"stenciled",
"stencilling":"stenciling",
"sterilisation":"sterilization",
"sterilisations":"sterilizations",
"sterilise":"sterilize",
"sterilised":"sterilized",
"steriliser":"sterilizer",
"sterilisers":"sterilizers",
"sterilises":"sterilizes",
"sterilising":"sterilizing",
"stigmatisation":"stigmatization",
"stigmatise":"stigmatize",
"stigmatised":"stigmatized",
"stigmatises":"stigmatizes",
"stigmatising":"stigmatizing",
"storey":"story",
"storeys":"stories",
"subsidisation":"subsidization",
"subsidise":"subsidize",
"subsidised":"subsidized",
"subsidiser":"subsidizer",
"subsidisers":"subsidizers",
"subsidises":"subsidizes",
"subsidising":"subsidizing",
"succour":"succor",
"succoured":"succored",
"succouring":"succoring",
"succours":"succors",
"sulphate":"sulfate",
"sulphates":"sulfates",
"sulphide":"sulfide",
"sulphides":"sulfides",
"sulphur":"sulfur",
"sulphurous":"sulfurous",
"summarise":"summarize",
"summarised":"summarized",
"summarises":"summarizes",
"summarising":"summarizing",
"swivelled":"swiveled",
"swivelling":"swiveling",
"symbolise":"symbolize",
"symbolised":"symbolized",
"symbolises":"symbolizes",
"symbolising":"symbolizing",
"sympathise":"sympathize",
"sympathised":"sympathized",
"sympathiser":"sympathizer",
"sympathisers":"sympathizers",
"sympathises":"sympathizes",
"sympathising":"sympathizing",
"synchronisation":"synchronization",
"synchronise":"synchronize",
"synchronised":"synchronized",
"synchronises":"synchronizes",
"synchronising":"synchronizing",
"synthesise":"synthesize",
"synthesised":"synthesized",
"synthesiser":"synthesizer",
"synthesisers":"synthesizers",
"synthesises":"synthesizes",
"synthesising":"synthesizing",
"syphon":"siphon",
"syphoned":"siphoned",
"syphoning":"siphoning",
"syphons":"siphons",
"systematisation":"systematization",
"systematise":"systematize",
"systematised":"systematized",
"systematises":"systematizes",
"systematising":"systematizing",
"tantalise":"tantalize",
"tantalised":"tantalized",
"tantalises":"tantalizes",
"tantalising":"tantalizing",
"tantalisingly":"tantalizingly",
"tasselled":"tasseled",
"technicolour":"technicolor",
"temporise":"temporize",
"temporised":"temporized",
"temporises":"temporizes",
"temporising":"temporizing",
"tenderise":"tenderize",
"tenderised":"tenderized",
"tenderises":"tenderizes",
"tenderising":"tenderizing",
"terrorise":"terrorize",
"terrorised":"terrorized",
"terrorises":"terrorizes",
"terrorising":"terrorizing",
"theatre":"theater",
"theatregoer":"theatergoer",
"theatregoers":"theatergoers",
"theatres":"theaters",
"theorise":"theorize",
"theorised":"theorized",
"theorises":"theorizes",
"theorising":"theorizing",
"tonne":"ton",
"tonnes":"tons",
"towelled":"toweled",
"towelling":"toweling",
"toxaemia":"toxemia",
"tranquillise":"tranquilize",
"tranquillised":"tranquilized",
"tranquilliser":"tranquilizer",
"tranquillisers":"tranquilizers",
"tranquillises":"tranquilizes",
"tranquillising":"tranquilizing",
"tranquillity":"tranquility",
"tranquillize":"tranquilize",
"tranquillized":"tranquilized",
"tranquillizer":"tranquilizer",
"tranquillizers":"tranquilizers",
"tranquillizes":"tranquilizes",
"tranquillizing":"tranquilizing",
"tranquilly":"tranquility",
"transistorised":"transistorized",
"traumatise":"traumatize",
"traumatised":"traumatized",
"traumatises":"traumatizes",
"traumatising":"traumatizing",
"travelled":"traveled",
"traveller":"traveler",
"travellers":"travelers",
"travelling":"traveling",
"travelogue":"travelog",
"travelogues":"travelogs",
"trialled":"trialed",
"trialling":"trialing",
"tricolour":"tricolor",
"tricolours":"tricolors",
"trivialise":"trivialize",
"trivialised":"trivialized",
"trivialises":"trivializes",
"trivialising":"trivializing",
"tumour":"tumor",
"tumours":"tumors",
"tunnelled":"tunneled",
"tunnelling":"tunneling",
"tyrannise":"tyrannize",
"tyrannised":"tyrannized",
"tyrannises":"tyrannizes",
"tyrannising":"tyrannizing",
"tyre":"tire",
"tyres":"tires",
"unauthorised":"unauthorized",
"uncivilised":"uncivilized",
"underutilised":"underutilized",
"unequalled":"unequaled",
"unfavourable":"unfavorable",
"unfavourably":"unfavorably",
"unionisation":"unionization",
"unionise":"unionize",
"unionised":"unionized",
"unionises":"unionizes",
"unionising":"unionizing",
"unorganised":"unorganized",
"unravelled":"unraveled",
"unravelling":"unraveling",
"unrecognisable":"unrecognizable",
"unrecognised":"unrecognized",
"unrivalled":"unrivaled",
"unsavoury":"unsavory",
"untrammelled":"untrammeled",
"urbanisation":"urbanization",
"urbanise":"urbanize",
"urbanised":"urbanized",
"urbanises":"urbanizes",
"urbanising":"urbanizing",
"utilisable":"utilizable",
"utilisation":"utilization",
"utilise":"utilize",
"utilised":"utilized",
"utilises":"utilizes",
"utilising":"utilizing",
"valour":"valor",
"vandalise":"vandalize",
"vandalised":"vandalized",
"vandalises":"vandalizes",
"vandalising":"vandalizing",
"vaporisation":"vaporization",
"vaporise":"vaporize",
"vaporised":"vaporized",
"vaporises":"vaporizes",
"vaporising":"vaporizing",
"vapour":"vapor",
"vapours":"vapors",
"verbalise":"verbalize",
"verbalised":"verbalized",
"verbalises":"verbalizes",
"verbalising":"verbalizing",
"victimisation":"victimization",
"victimise":"victimize",
"victimised":"victimized",
"victimises":"victimizes",
"victimising":"victimizing",
"videodisc":"videodisk",
"videodiscs":"videodisks",
"vigour":"vigor",
"visualisation":"visualization",
"visualisations":"visualizations",
"visualise":"visualize",
"visualised":"visualized",
"visualises":"visualizes",
"visualising":"visualizing",
"vocalisation":"vocalization",
"vocalisations":"vocalizations",
"vocalise":"vocalize",
"vocalised":"vocalized",
"vocalises":"vocalizes",
"vocalising":"vocalizing",
"vulcanised":"vulcanized",
"vulgarisation":"vulgarization",
"vulgarise":"vulgarize",
"vulgarised":"vulgarized",
"vulgarises":"vulgarizes",
"vulgarising":"vulgarizing",
"waggon":"wagon",
"waggons":"wagons",
"watercolour":"watercolor",
"watercolours":"watercolors",
"weaselled":"weaseled",
"weaselling":"weaseling",
"westernisation":"westernization",
"westernise":"westernize",
"westernised":"westernized",
"westernises":"westernizes",
"westernising":"westernizing",
"womanise":"womanize",
"womanised":"womanized",
"womaniser":"womanizer",
"womanisers":"womanizers",
"womanises":"womanizes",
"womanising":"womanizing",
"woollen":"woolen",
"woollens":"woolens",
"woollies":"woolies",
"woolly":"wooly",
"worshipped":"worshiped",
"worshipping":"worshiping",
"worshipper":"worshiper",
"yodelled":"yodeled",
"yodelling":"yodeling",
"yoghourt":"yogurt",
"yoghourts":"yogurts",
"yoghurt":"yogurt",
"yoghurts":"yogurts",
}
|
spellings_map = {'accessorise': 'accessorize', 'accessorised': 'accessorized', 'accessorises': 'accessorizes', 'accessorising': 'accessorizing', 'acclimatisation': 'acclimatization', 'acclimatise': 'acclimatize', 'acclimatised': 'acclimatized', 'acclimatises': 'acclimatizes', 'acclimatising': 'acclimatizing', 'accoutrements': 'accouterments', 'aeon': 'eon', 'aeons': 'eons', 'aerogramme': 'aerogram', 'aerogrammes': 'aerograms', 'aeroplane': 'airplane', 'aeroplanes': 'airplanes', 'aesthete': 'esthete', 'aesthetes': 'esthetes', 'aesthetic': 'esthetic', 'aesthetically': 'esthetically', 'aesthetics': 'esthetics', 'aetiology': 'etiology', 'ageing': 'aging', 'aggrandisement': 'aggrandizement', 'agonise': 'agonize', 'agonised': 'agonized', 'agonises': 'agonizes', 'agonising': 'agonizing', 'agonisingly': 'agonizingly', 'almanack': 'almanac', 'almanacks': 'almanacs', 'aluminium': 'aluminum', 'amortisable': 'amortizable', 'amortisation': 'amortization', 'amortisations': 'amortizations', 'amortise': 'amortize', 'amortised': 'amortized', 'amortises': 'amortizes', 'amortising': 'amortizing', 'amphitheatre': 'amphitheater', 'amphitheatres': 'amphitheaters', 'anaemia': 'anemia', 'anaemic': 'anemic', 'anaesthesia': 'anesthesia', 'anaesthetic': 'anesthetic', 'anaesthetics': 'anesthetics', 'anaesthetise': 'anesthetize', 'anaesthetised': 'anesthetized', 'anaesthetises': 'anesthetizes', 'anaesthetising': 'anesthetizing', 'anaesthetist': 'anesthetist', 'anaesthetists': 'anesthetists', 'anaesthetize': 'anesthetize', 'anaesthetized': 'anesthetized', 'anaesthetizes': 'anesthetizes', 'anaesthetizing': 'anesthetizing', 'analogue': 'analog', 'analogues': 'analogs', 'analyse': 'analyze', 'analysed': 'analyzed', 'analyses': 'analyzes', 'analysing': 'analyzing', 'anglicise': 'anglicize', 'anglicised': 'anglicized', 'anglicises': 'anglicizes', 'anglicising': 'anglicizing', 'annualised': 'annualized', 'antagonise': 'antagonize', 'antagonised': 'antagonized', 'antagonises': 'antagonizes', 'antagonising': 'antagonizing', 'apologise': 'apologize', 'apologised': 'apologized', 'apologises': 'apologizes', 'apologising': 'apologizing', 'appal': 'appall', 'appals': 'appalls', 'appetiser': 'appetizer', 'appetisers': 'appetizers', 'appetising': 'appetizing', 'appetisingly': 'appetizingly', 'arbour': 'arbor', 'arbours': 'arbors', 'archaeological': 'archeological', 'archaeologically': 'archeologically', 'archaeologist': 'archeologist', 'archaeologists': 'archeologists', 'archaeology': 'archeology', 'ardour': 'ardor', 'armour': 'armor', 'armoured': 'armored', 'armourer': 'armorer', 'armourers': 'armorers', 'armouries': 'armories', 'armoury': 'armory', 'artefact': 'artifact', 'artefacts': 'artifacts', 'authorise': 'authorize', 'authorised': 'authorized', 'authorises': 'authorizes', 'authorising': 'authorizing', 'axe': 'ax', 'backpedalled': 'backpedaled', 'backpedalling': 'backpedaling', 'bannister': 'banister', 'bannisters': 'banisters', 'baptise': 'baptize', 'baptised': 'baptized', 'baptises': 'baptizes', 'baptising': 'baptizing', 'bastardise': 'bastardize', 'bastardised': 'bastardized', 'bastardises': 'bastardizes', 'bastardising': 'bastardizing', 'battleaxe': 'battleax', 'baulk': 'balk', 'baulked': 'balked', 'baulking': 'balking', 'baulks': 'balks', 'bedevilled': 'bedeviled', 'bedevilling': 'bedeviling', 'behaviour': 'behavior', 'behavioural': 'behavioral', 'behaviourism': 'behaviorism', 'behaviourist': 'behaviorist', 'behaviourists': 'behaviorists', 'behaviours': 'behaviors', 'behove': 'behoove', 'behoved': 'behooved', 'behoves': 'behooves', 'bejewelled': 'bejeweled', 'belabour': 'belabor', 'belaboured': 'belabored', 'belabouring': 'belaboring', 'belabours': 'belabors', 'bevelled': 'beveled', 'bevvies': 'bevies', 'bevvy': 'bevy', 'biassed': 'biased', 'biassing': 'biasing', 'bingeing': 'binging', 'bougainvillaea': 'bougainvillea', 'bougainvillaeas': 'bougainvilleas', 'bowdlerise': 'bowdlerize', 'bowdlerised': 'bowdlerized', 'bowdlerises': 'bowdlerizes', 'bowdlerising': 'bowdlerizing', 'breathalyse': 'breathalyze', 'breathalysed': 'breathalyzed', 'breathalyser': 'breathalyzer', 'breathalysers': 'breathalyzers', 'breathalyses': 'breathalyzes', 'breathalysing': 'breathalyzing', 'brutalise': 'brutalize', 'brutalised': 'brutalized', 'brutalises': 'brutalizes', 'brutalising': 'brutalizing', 'buses': 'busses', 'busing': 'bussing', 'caesarean': 'cesarean', 'caesareans': 'cesareans', 'calibre': 'caliber', 'calibres': 'calibers', 'calliper': 'caliper', 'callipers': 'calipers', 'callisthenics': 'calisthenics', 'canalise': 'canalize', 'canalised': 'canalized', 'canalises': 'canalizes', 'canalising': 'canalizing', 'cancellation': 'cancelation', 'cancellations': 'cancelations', 'cancelled': 'canceled', 'cancelling': 'canceling', 'candour': 'candor', 'cannibalise': 'cannibalize', 'cannibalised': 'cannibalized', 'cannibalises': 'cannibalizes', 'cannibalising': 'cannibalizing', 'canonise': 'canonize', 'canonised': 'canonized', 'canonises': 'canonizes', 'canonising': 'canonizing', 'capitalise': 'capitalize', 'capitalised': 'capitalized', 'capitalises': 'capitalizes', 'capitalising': 'capitalizing', 'caramelise': 'caramelize', 'caramelised': 'caramelized', 'caramelises': 'caramelizes', 'caramelising': 'caramelizing', 'carbonise': 'carbonize', 'carbonised': 'carbonized', 'carbonises': 'carbonizes', 'carbonising': 'carbonizing', 'carolled': 'caroled', 'carolling': 'caroling', 'catalogue': 'catalog', 'catalogued': 'cataloged', 'catalogues': 'catalogs', 'cataloguing': 'cataloging', 'catalyse': 'catalyze', 'catalysed': 'catalyzed', 'catalyses': 'catalyzes', 'catalysing': 'catalyzing', 'categorise': 'categorize', 'categorised': 'categorized', 'categorises': 'categorizes', 'categorising': 'categorizing', 'cauterise': 'cauterize', 'cauterised': 'cauterized', 'cauterises': 'cauterizes', 'cauterising': 'cauterizing', 'cavilled': 'caviled', 'cavilling': 'caviling', 'centigramme': 'centigram', 'centigrammes': 'centigrams', 'centilitre': 'centiliter', 'centilitres': 'centiliters', 'centimetre': 'centimeter', 'centimetres': 'centimeters', 'centralise': 'centralize', 'centralised': 'centralized', 'centralises': 'centralizes', 'centralising': 'centralizing', 'centre': 'center', 'centred': 'centered', 'centrefold': 'centerfold', 'centrefolds': 'centerfolds', 'centrepiece': 'centerpiece', 'centrepieces': 'centerpieces', 'centres': 'centers', 'channelled': 'channeled', 'channelling': 'channeling', 'characterise': 'characterize', 'characterised': 'characterized', 'characterises': 'characterizes', 'characterising': 'characterizing', 'cheque': 'check', 'chequebook': 'checkbook', 'chequebooks': 'checkbooks', 'chequered': 'checkered', 'cheques': 'checks', 'chilli': 'chili', 'chimaera': 'chimera', 'chimaeras': 'chimeras', 'chiselled': 'chiseled', 'chiselling': 'chiseling', 'circularise': 'circularize', 'circularised': 'circularized', 'circularises': 'circularizes', 'circularising': 'circularizing', 'civilise': 'civilize', 'civilised': 'civilized', 'civilises': 'civilizes', 'civilising': 'civilizing', 'clamour': 'clamor', 'clamoured': 'clamored', 'clamouring': 'clamoring', 'clamours': 'clamors', 'clangour': 'clangor', 'clarinettist': 'clarinetist', 'clarinettists': 'clarinetists', 'collectivise': 'collectivize', 'collectivised': 'collectivized', 'collectivises': 'collectivizes', 'collectivising': 'collectivizing', 'colonisation': 'colonization', 'colonise': 'colonize', 'colonised': 'colonized', 'coloniser': 'colonizer', 'colonisers': 'colonizers', 'colonises': 'colonizes', 'colonising': 'colonizing', 'colour': 'color', 'colourant': 'colorant', 'colourants': 'colorants', 'coloured': 'colored', 'coloureds': 'coloreds', 'colourful': 'colorful', 'colourfully': 'colorfully', 'colouring': 'coloring', 'colourize': 'colorize', 'colourized': 'colorized', 'colourizes': 'colorizes', 'colourizing': 'colorizing', 'colourless': 'colorless', 'colours': 'colors', 'commercialise': 'commercialize', 'commercialised': 'commercialized', 'commercialises': 'commercializes', 'commercialising': 'commercializing', 'compartmentalise': 'compartmentalize', 'compartmentalised': 'compartmentalized', 'compartmentalises': 'compartmentalizes', 'compartmentalising': 'compartmentalizing', 'computerise': 'computerize', 'computerised': 'computerized', 'computerises': 'computerizes', 'computerising': 'computerizing', 'conceptualise': 'conceptualize', 'conceptualised': 'conceptualized', 'conceptualises': 'conceptualizes', 'conceptualising': 'conceptualizing', 'connexion': 'connection', 'connexions': 'connections', 'contextualise': 'contextualize', 'contextualised': 'contextualized', 'contextualises': 'contextualizes', 'contextualising': 'contextualizing', 'cosier': 'cozier', 'cosies': 'cozies', 'cosiest': 'coziest', 'cosily': 'cozily', 'cosiness': 'coziness', 'cosy': 'cozy', 'councillor': 'councilor', 'councillors': 'councilors', 'counselled': 'counseled', 'counselling': 'counseling', 'counsellor': 'counselor', 'counsellors': 'counselors', 'crenellated': 'crenelated', 'criminalise': 'criminalize', 'criminalised': 'criminalized', 'criminalises': 'criminalizes', 'criminalising': 'criminalizing', 'criticise': 'criticize', 'criticised': 'criticized', 'criticises': 'criticizes', 'criticising': 'criticizing', 'crueller': 'crueler', 'cruellest': 'cruelest', 'crystallisation': 'crystallization', 'crystallise': 'crystallize', 'crystallised': 'crystallized', 'crystallises': 'crystallizes', 'crystallising': 'crystallizing', 'cudgelled': 'cudgeled', 'cudgelling': 'cudgeling', 'customise': 'customize', 'customised': 'customized', 'customises': 'customizes', 'customising': 'customizing', 'cypher': 'cipher', 'cyphers': 'ciphers', 'decentralisation': 'decentralization', 'decentralise': 'decentralize', 'decentralised': 'decentralized', 'decentralises': 'decentralizes', 'decentralising': 'decentralizing', 'decriminalisation': 'decriminalization', 'decriminalise': 'decriminalize', 'decriminalised': 'decriminalized', 'decriminalises': 'decriminalizes', 'decriminalising': 'decriminalizing', 'defence': 'defense', 'defenceless': 'defenseless', 'defences': 'defenses', 'dehumanisation': 'dehumanization', 'dehumanise': 'dehumanize', 'dehumanised': 'dehumanized', 'dehumanises': 'dehumanizes', 'dehumanising': 'dehumanizing', 'demeanour': 'demeanor', 'demilitarisation': 'demilitarization', 'demilitarise': 'demilitarize', 'demilitarised': 'demilitarized', 'demilitarises': 'demilitarizes', 'demilitarising': 'demilitarizing', 'demobilisation': 'demobilization', 'demobilise': 'demobilize', 'demobilised': 'demobilized', 'demobilises': 'demobilizes', 'demobilising': 'demobilizing', 'democratisation': 'democratization', 'democratise': 'democratize', 'democratised': 'democratized', 'democratises': 'democratizes', 'democratising': 'democratizing', 'demonise': 'demonize', 'demonised': 'demonized', 'demonises': 'demonizes', 'demonising': 'demonizing', 'demoralisation': 'demoralization', 'demoralise': 'demoralize', 'demoralised': 'demoralized', 'demoralises': 'demoralizes', 'demoralising': 'demoralizing', 'denationalisation': 'denationalization', 'denationalise': 'denationalize', 'denationalised': 'denationalized', 'denationalises': 'denationalizes', 'denationalising': 'denationalizing', 'deodorise': 'deodorize', 'deodorised': 'deodorized', 'deodorises': 'deodorizes', 'deodorising': 'deodorizing', 'depersonalise': 'depersonalize', 'depersonalised': 'depersonalized', 'depersonalises': 'depersonalizes', 'depersonalising': 'depersonalizing', 'deputise': 'deputize', 'deputised': 'deputized', 'deputises': 'deputizes', 'deputising': 'deputizing', 'desensitisation': 'desensitization', 'desensitise': 'desensitize', 'desensitised': 'desensitized', 'desensitises': 'desensitizes', 'desensitising': 'desensitizing', 'destabilisation': 'destabilization', 'destabilise': 'destabilize', 'destabilised': 'destabilized', 'destabilises': 'destabilizes', 'destabilising': 'destabilizing', 'dialled': 'dialed', 'dialling': 'dialing', 'dialogue': 'dialog', 'dialogues': 'dialogs', 'diarrhoea': 'diarrhea', 'digitise': 'digitize', 'digitised': 'digitized', 'digitises': 'digitizes', 'digitising': 'digitizing', 'disc': 'disk', 'discolour': 'discolor', 'discoloured': 'discolored', 'discolouring': 'discoloring', 'discolours': 'discolors', 'discs': 'disks', 'disembowelled': 'disemboweled', 'disembowelling': 'disemboweling', 'disfavour': 'disfavor', 'dishevelled': 'disheveled', 'dishonour': 'dishonor', 'dishonourable': 'dishonorable', 'dishonourably': 'dishonorably', 'dishonoured': 'dishonored', 'dishonouring': 'dishonoring', 'dishonours': 'dishonors', 'disorganisation': 'disorganization', 'disorganised': 'disorganized', 'distil': 'distill', 'distils': 'distills', 'dramatisation': 'dramatization', 'dramatisations': 'dramatizations', 'dramatise': 'dramatize', 'dramatised': 'dramatized', 'dramatises': 'dramatizes', 'dramatising': 'dramatizing', 'draught': 'draft', 'draughtboard': 'draftboard', 'draughtboards': 'draftboards', 'draughtier': 'draftier', 'draughtiest': 'draftiest', 'draughts': 'drafts', 'draughtsman': 'draftsman', 'draughtsmanship': 'draftsmanship', 'draughtsmen': 'draftsmen', 'draughtswoman': 'draftswoman', 'draughtswomen': 'draftswomen', 'draughty': 'drafty', 'drivelled': 'driveled', 'drivelling': 'driveling', 'duelled': 'dueled', 'duelling': 'dueling', 'economise': 'economize', 'economised': 'economized', 'economises': 'economizes', 'economising': 'economizing', 'edoema': 'edema', 'editorialise': 'editorialize', 'editorialised': 'editorialized', 'editorialises': 'editorializes', 'editorialising': 'editorializing', 'empathise': 'empathize', 'empathised': 'empathized', 'empathises': 'empathizes', 'empathising': 'empathizing', 'emphasise': 'emphasize', 'emphasised': 'emphasized', 'emphasises': 'emphasizes', 'emphasising': 'emphasizing', 'enamelled': 'enameled', 'enamelling': 'enameling', 'enamoured': 'enamored', 'encyclopaedia': 'encyclopedia', 'encyclopaedias': 'encyclopedias', 'encyclopaedic': 'encyclopedic', 'endeavour': 'endeavor', 'endeavoured': 'endeavored', 'endeavouring': 'endeavoring', 'endeavours': 'endeavors', 'energise': 'energize', 'energised': 'energized', 'energises': 'energizes', 'energising': 'energizing', 'enrol': 'enroll', 'enrols': 'enrolls', 'enthral': 'enthrall', 'enthrals': 'enthralls', 'epaulette': 'epaulet', 'epaulettes': 'epaulets', 'epicentre': 'epicenter', 'epicentres': 'epicenters', 'epilogue': 'epilog', 'epilogues': 'epilogs', 'epitomise': 'epitomize', 'epitomised': 'epitomized', 'epitomises': 'epitomizes', 'epitomising': 'epitomizing', 'equalisation': 'equalization', 'equalise': 'equalize', 'equalised': 'equalized', 'equaliser': 'equalizer', 'equalisers': 'equalizers', 'equalises': 'equalizes', 'equalising': 'equalizing', 'eulogise': 'eulogize', 'eulogised': 'eulogized', 'eulogises': 'eulogizes', 'eulogising': 'eulogizing', 'evangelise': 'evangelize', 'evangelised': 'evangelized', 'evangelises': 'evangelizes', 'evangelising': 'evangelizing', 'exorcise': 'exorcize', 'exorcised': 'exorcized', 'exorcises': 'exorcizes', 'exorcising': 'exorcizing', 'extemporisation': 'extemporization', 'extemporise': 'extemporize', 'extemporised': 'extemporized', 'extemporises': 'extemporizes', 'extemporising': 'extemporizing', 'externalisation': 'externalization', 'externalisations': 'externalizations', 'externalise': 'externalize', 'externalised': 'externalized', 'externalises': 'externalizes', 'externalising': 'externalizing', 'factorise': 'factorize', 'factorised': 'factorized', 'factorises': 'factorizes', 'factorising': 'factorizing', 'faecal': 'fecal', 'faeces': 'feces', 'familiarisation': 'familiarization', 'familiarise': 'familiarize', 'familiarised': 'familiarized', 'familiarises': 'familiarizes', 'familiarising': 'familiarizing', 'fantasise': 'fantasize', 'fantasised': 'fantasized', 'fantasises': 'fantasizes', 'fantasising': 'fantasizing', 'favour': 'favor', 'favourable': 'favorable', 'favourably': 'favorably', 'favoured': 'favored', 'favouring': 'favoring', 'favourite': 'favorite', 'favourites': 'favorites', 'favouritism': 'favoritism', 'favours': 'favors', 'feminise': 'feminize', 'feminised': 'feminized', 'feminises': 'feminizes', 'feminising': 'feminizing', 'fertilisation': 'fertilization', 'fertilise': 'fertilize', 'fertilised': 'fertilized', 'fertiliser': 'fertilizer', 'fertilisers': 'fertilizers', 'fertilises': 'fertilizes', 'fertilising': 'fertilizing', 'fervour': 'fervor', 'fibre': 'fiber', 'fibreglass': 'fiberglass', 'fibres': 'fibers', 'fictionalisation': 'fictionalization', 'fictionalisations': 'fictionalizations', 'fictionalise': 'fictionalize', 'fictionalised': 'fictionalized', 'fictionalises': 'fictionalizes', 'fictionalising': 'fictionalizing', 'fillet': 'filet', 'filleted': 'fileted', 'filleting': 'fileting', 'fillets': 'filets', 'finalisation': 'finalization', 'finalise': 'finalize', 'finalised': 'finalized', 'finalises': 'finalizes', 'finalising': 'finalizing', 'flautist': 'flutist', 'flautists': 'flutists', 'flavour': 'flavor', 'flavoured': 'flavored', 'flavouring': 'flavoring', 'flavourings': 'flavorings', 'flavourless': 'flavorless', 'flavours': 'flavors', 'flavoursome': 'flavorsome', 'flyer / flier': 'flier / flyer', 'foetal': 'fetal', 'foetid': 'fetid', 'foetus': 'fetus', 'foetuses': 'fetuses', 'formalisation': 'formalization', 'formalise': 'formalize', 'formalised': 'formalized', 'formalises': 'formalizes', 'formalising': 'formalizing', 'fossilisation': 'fossilization', 'fossilise': 'fossilize', 'fossilised': 'fossilized', 'fossilises': 'fossilizes', 'fossilising': 'fossilizing', 'fraternisation': 'fraternization', 'fraternise': 'fraternize', 'fraternised': 'fraternized', 'fraternises': 'fraternizes', 'fraternising': 'fraternizing', 'fulfil': 'fulfill', 'fulfilment': 'fulfillment', 'fulfils': 'fulfills', 'funnelled': 'funneled', 'funnelling': 'funneling', 'galvanise': 'galvanize', 'galvanised': 'galvanized', 'galvanises': 'galvanizes', 'galvanising': 'galvanizing', 'gambolled': 'gamboled', 'gambolling': 'gamboling', 'gaol': 'jail', 'gaolbird': 'jailbird', 'gaolbirds': 'jailbirds', 'gaolbreak': 'jailbreak', 'gaolbreaks': 'jailbreaks', 'gaoled': 'jailed', 'gaoler': 'jailer', 'gaolers': 'jailers', 'gaoling': 'jailing', 'gaols': 'jails', 'gases': 'gasses', 'gauge': 'gage', 'gauged': 'gaged', 'gauges': 'gages', 'gauging': 'gaging', 'generalisation': 'generalization', 'generalisations': 'generalizations', 'generalise': 'generalize', 'generalised': 'generalized', 'generalises': 'generalizes', 'generalising': 'generalizing', 'ghettoise': 'ghettoize', 'ghettoised': 'ghettoized', 'ghettoises': 'ghettoizes', 'ghettoising': 'ghettoizing', 'gipsies': 'gypsies', 'glamorise': 'glamorize', 'glamorised': 'glamorized', 'glamorises': 'glamorizes', 'glamorising': 'glamorizing', 'glamour': 'glamor', 'globalisation': 'globalization', 'globalise': 'globalize', 'globalised': 'globalized', 'globalises': 'globalizes', 'globalising': 'globalizing', 'glueing': 'gluing', 'goitre': 'goiter', 'goitres': 'goiters', 'gonorrhoea': 'gonorrhea', 'gramme': 'gram', 'grammes': 'grams', 'gravelled': 'graveled', 'grey': 'gray', 'greyed': 'grayed', 'greying': 'graying', 'greyish': 'grayish', 'greyness': 'grayness', 'greys': 'grays', 'grovelled': 'groveled', 'grovelling': 'groveling', 'groyne': 'groin', 'groynes': 'groins', 'gruelling': 'grueling', 'gruellingly': 'gruelingly', 'gryphon': 'griffin', 'gryphons': 'griffins', 'gynaecological': 'gynecological', 'gynaecologist': 'gynecologist', 'gynaecologists': 'gynecologists', 'gynaecology': 'gynecology', 'haematological': 'hematological', 'haematologist': 'hematologist', 'haematologists': 'hematologists', 'haematology': 'hematology', 'haemoglobin': 'hemoglobin', 'haemophilia': 'hemophilia', 'haemophiliac': 'hemophiliac', 'haemophiliacs': 'hemophiliacs', 'haemorrhage': 'hemorrhage', 'haemorrhaged': 'hemorrhaged', 'haemorrhages': 'hemorrhages', 'haemorrhaging': 'hemorrhaging', 'haemorrhoids': 'hemorrhoids', 'harbour': 'harbor', 'harboured': 'harbored', 'harbouring': 'harboring', 'harbours': 'harbors', 'harmonisation': 'harmonization', 'harmonise': 'harmonize', 'harmonised': 'harmonized', 'harmonises': 'harmonizes', 'harmonising': 'harmonizing', 'homoeopath': 'homeopath', 'homoeopathic': 'homeopathic', 'homoeopaths': 'homeopaths', 'homoeopathy': 'homeopathy', 'homogenise': 'homogenize', 'homogenised': 'homogenized', 'homogenises': 'homogenizes', 'homogenising': 'homogenizing', 'honour': 'honor', 'honourable': 'honorable', 'honourably': 'honorably', 'honoured': 'honored', 'honouring': 'honoring', 'honours': 'honors', 'hospitalisation': 'hospitalization', 'hospitalise': 'hospitalize', 'hospitalised': 'hospitalized', 'hospitalises': 'hospitalizes', 'hospitalising': 'hospitalizing', 'humanise': 'humanize', 'humanised': 'humanized', 'humanises': 'humanizes', 'humanising': 'humanizing', 'humour': 'humor', 'humoured': 'humored', 'humouring': 'humoring', 'humourless': 'humorless', 'humours': 'humors', 'hybridise': 'hybridize', 'hybridised': 'hybridized', 'hybridises': 'hybridizes', 'hybridising': 'hybridizing', 'hypnotise': 'hypnotize', 'hypnotised': 'hypnotized', 'hypnotises': 'hypnotizes', 'hypnotising': 'hypnotizing', 'hypothesise': 'hypothesize', 'hypothesised': 'hypothesized', 'hypothesises': 'hypothesizes', 'hypothesising': 'hypothesizing', 'idealisation': 'idealization', 'idealise': 'idealize', 'idealised': 'idealized', 'idealises': 'idealizes', 'idealising': 'idealizing', 'idolise': 'idolize', 'idolised': 'idolized', 'idolises': 'idolizes', 'idolising': 'idolizing', 'immobilisation': 'immobilization', 'immobilise': 'immobilize', 'immobilised': 'immobilized', 'immobiliser': 'immobilizer', 'immobilisers': 'immobilizers', 'immobilises': 'immobilizes', 'immobilising': 'immobilizing', 'immortalise': 'immortalize', 'immortalised': 'immortalized', 'immortalises': 'immortalizes', 'immortalising': 'immortalizing', 'immunisation': 'immunization', 'immunise': 'immunize', 'immunised': 'immunized', 'immunises': 'immunizes', 'immunising': 'immunizing', 'impanelled': 'impaneled', 'impanelling': 'impaneling', 'imperilled': 'imperiled', 'imperilling': 'imperiling', 'individualise': 'individualize', 'individualised': 'individualized', 'individualises': 'individualizes', 'individualising': 'individualizing', 'industrialise': 'industrialize', 'industrialised': 'industrialized', 'industrialises': 'industrializes', 'industrialising': 'industrializing', 'inflexion': 'inflection', 'inflexions': 'inflections', 'initialise': 'initialize', 'initialised': 'initialized', 'initialises': 'initializes', 'initialising': 'initializing', 'initialled': 'initialed', 'initialling': 'initialing', 'instal': 'install', 'instalment': 'installment', 'instalments': 'installments', 'instals': 'installs', 'instil': 'instill', 'instils': 'instills', 'institutionalisation': 'institutionalization', 'institutionalise': 'institutionalize', 'institutionalised': 'institutionalized', 'institutionalises': 'institutionalizes', 'institutionalising': 'institutionalizing', 'intellectualise': 'intellectualize', 'intellectualised': 'intellectualized', 'intellectualises': 'intellectualizes', 'intellectualising': 'intellectualizing', 'internalisation': 'internalization', 'internalise': 'internalize', 'internalised': 'internalized', 'internalises': 'internalizes', 'internalising': 'internalizing', 'internationalisation': 'internationalization', 'internationalise': 'internationalize', 'internationalised': 'internationalized', 'internationalises': 'internationalizes', 'internationalising': 'internationalizing', 'ionisation': 'ionization', 'ionise': 'ionize', 'ionised': 'ionized', 'ioniser': 'ionizer', 'ionisers': 'ionizers', 'ionises': 'ionizes', 'ionising': 'ionizing', 'italicise': 'italicize', 'italicised': 'italicized', 'italicises': 'italicizes', 'italicising': 'italicizing', 'itemise': 'itemize', 'itemised': 'itemized', 'itemises': 'itemizes', 'itemising': 'itemizing', 'jeopardise': 'jeopardize', 'jeopardised': 'jeopardized', 'jeopardises': 'jeopardizes', 'jeopardising': 'jeopardizing', 'jewelled': 'jeweled', 'jeweller': 'jeweler', 'jewellers': 'jewelers', 'jewellery': 'jewelry', 'judgement': 'judgment', 'kilogramme': 'kilogram', 'kilogrammes': 'kilograms', 'kilometre': 'kilometer', 'kilometres': 'kilometers', 'labelled': 'labeled', 'labelling': 'labeling', 'labour': 'labor', 'laboured': 'labored', 'labourer': 'laborer', 'labourers': 'laborers', 'labouring': 'laboring', 'labours': 'labors', 'lacklustre': 'lackluster', 'legalisation': 'legalization', 'legalise': 'legalize', 'legalised': 'legalized', 'legalises': 'legalizes', 'legalising': 'legalizing', 'legitimise': 'legitimize', 'legitimised': 'legitimized', 'legitimises': 'legitimizes', 'legitimising': 'legitimizing', 'leukaemia': 'leukemia', 'levelled': 'leveled', 'leveller': 'leveler', 'levellers': 'levelers', 'levelling': 'leveling', 'libelled': 'libeled', 'libelling': 'libeling', 'libellous': 'libelous', 'liberalisation': 'liberalization', 'liberalise': 'liberalize', 'liberalised': 'liberalized', 'liberalises': 'liberalizes', 'liberalising': 'liberalizing', 'licence': 'license', 'licenced': 'licensed', 'licences': 'licenses', 'licencing': 'licensing', 'likeable': 'likable', 'lionisation': 'lionization', 'lionise': 'lionize', 'lionised': 'lionized', 'lionises': 'lionizes', 'lionising': 'lionizing', 'liquidise': 'liquidize', 'liquidised': 'liquidized', 'liquidiser': 'liquidizer', 'liquidisers': 'liquidizers', 'liquidises': 'liquidizes', 'liquidising': 'liquidizing', 'litre': 'liter', 'litres': 'liters', 'localise': 'localize', 'localised': 'localized', 'localises': 'localizes', 'localising': 'localizing', 'louvre': 'louver', 'louvred': 'louvered', 'louvres': 'louvers', 'lustre': 'luster', 'magnetise': 'magnetize', 'magnetised': 'magnetized', 'magnetises': 'magnetizes', 'magnetising': 'magnetizing', 'manoeuvrability': 'maneuverability', 'manoeuvrable': 'maneuverable', 'manoeuvre': 'maneuver', 'manoeuvred': 'maneuvered', 'manoeuvres': 'maneuvers', 'manoeuvring': 'maneuvering', 'manoeuvrings': 'maneuverings', 'marginalisation': 'marginalization', 'marginalise': 'marginalize', 'marginalised': 'marginalized', 'marginalises': 'marginalizes', 'marginalising': 'marginalizing', 'marshalled': 'marshaled', 'marshalling': 'marshaling', 'marvelled': 'marveled', 'marvelling': 'marveling', 'marvellous': 'marvelous', 'marvellously': 'marvelously', 'materialisation': 'materialization', 'materialise': 'materialize', 'materialised': 'materialized', 'materialises': 'materializes', 'materialising': 'materializing', 'maximisation': 'maximization', 'maximise': 'maximize', 'maximised': 'maximized', 'maximises': 'maximizes', 'maximising': 'maximizing', 'meagre': 'meager', 'mechanisation': 'mechanization', 'mechanise': 'mechanize', 'mechanised': 'mechanized', 'mechanises': 'mechanizes', 'mechanising': 'mechanizing', 'mediaeval': 'medieval', 'memorialise': 'memorialize', 'memorialised': 'memorialized', 'memorialises': 'memorializes', 'memorialising': 'memorializing', 'memorise': 'memorize', 'memorised': 'memorized', 'memorises': 'memorizes', 'memorising': 'memorizing', 'mesmerise': 'mesmerize', 'mesmerised': 'mesmerized', 'mesmerises': 'mesmerizes', 'mesmerising': 'mesmerizing', 'metabolise': 'metabolize', 'metabolised': 'metabolized', 'metabolises': 'metabolizes', 'metabolising': 'metabolizing', 'metre': 'meter', 'metres': 'meters', 'micrometre': 'micrometer', 'micrometres': 'micrometers', 'militarise': 'militarize', 'militarised': 'militarized', 'militarises': 'militarizes', 'militarising': 'militarizing', 'milligramme': 'milligram', 'milligrammes': 'milligrams', 'millilitre': 'milliliter', 'millilitres': 'milliliters', 'millimetre': 'millimeter', 'millimetres': 'millimeters', 'miniaturisation': 'miniaturization', 'miniaturise': 'miniaturize', 'miniaturised': 'miniaturized', 'miniaturises': 'miniaturizes', 'miniaturising': 'miniaturizing', 'minibuses': 'minibusses', 'minimise': 'minimize', 'minimised': 'minimized', 'minimises': 'minimizes', 'minimising': 'minimizing', 'misbehaviour': 'misbehavior', 'misdemeanour': 'misdemeanor', 'misdemeanours': 'misdemeanors', 'misspelt': 'misspelled', 'mitre': 'miter', 'mitres': 'miters', 'mobilisation': 'mobilization', 'mobilise': 'mobilize', 'mobilised': 'mobilized', 'mobilises': 'mobilizes', 'mobilising': 'mobilizing', 'modelled': 'modeled', 'modeller': 'modeler', 'modellers': 'modelers', 'modelling': 'modeling', 'modernise': 'modernize', 'modernised': 'modernized', 'modernises': 'modernizes', 'modernising': 'modernizing', 'moisturise': 'moisturize', 'moisturised': 'moisturized', 'moisturiser': 'moisturizer', 'moisturisers': 'moisturizers', 'moisturises': 'moisturizes', 'moisturising': 'moisturizing', 'monologue': 'monolog', 'monologues': 'monologs', 'monopolisation': 'monopolization', 'monopolise': 'monopolize', 'monopolised': 'monopolized', 'monopolises': 'monopolizes', 'monopolising': 'monopolizing', 'moralise': 'moralize', 'moralised': 'moralized', 'moralises': 'moralizes', 'moralising': 'moralizing', 'motorised': 'motorized', 'mould': 'mold', 'moulded': 'molded', 'moulder': 'molder', 'mouldered': 'moldered', 'mouldering': 'moldering', 'moulders': 'molders', 'mouldier': 'moldier', 'mouldiest': 'moldiest', 'moulding': 'molding', 'mouldings': 'moldings', 'moulds': 'molds', 'mouldy': 'moldy', 'moult': 'molt', 'moulted': 'molted', 'moulting': 'molting', 'moults': 'molts', 'moustache': 'mustache', 'moustached': 'mustached', 'moustaches': 'mustaches', 'moustachioed': 'mustachioed', 'multicoloured': 'multicolored', 'nationalisation': 'nationalization', 'nationalisations': 'nationalizations', 'nationalise': 'nationalize', 'nationalised': 'nationalized', 'nationalises': 'nationalizes', 'nationalising': 'nationalizing', 'naturalisation': 'naturalization', 'naturalise': 'naturalize', 'naturalised': 'naturalized', 'naturalises': 'naturalizes', 'naturalising': 'naturalizing', 'neighbour': 'neighbor', 'neighbourhood': 'neighborhood', 'neighbourhoods': 'neighborhoods', 'neighbouring': 'neighboring', 'neighbourliness': 'neighborliness', 'neighbourly': 'neighborly', 'neighbours': 'neighbors', 'neutralisation': 'neutralization', 'neutralise': 'neutralize', 'neutralised': 'neutralized', 'neutralises': 'neutralizes', 'neutralising': 'neutralizing', 'normalisation': 'normalization', 'normalise': 'normalize', 'normalised': 'normalized', 'normalises': 'normalizes', 'normalising': 'normalizing', 'odour': 'odor', 'odourless': 'odorless', 'odours': 'odors', 'oesophagus': 'esophagus', 'oesophaguses': 'esophaguses', 'oestrogen': 'estrogen', 'offence': 'offense', 'offences': 'offenses', 'omelette': 'omelet', 'omelettes': 'omelets', 'optimise': 'optimize', 'optimised': 'optimized', 'optimises': 'optimizes', 'optimising': 'optimizing', 'organisation': 'organization', 'organisational': 'organizational', 'organisations': 'organizations', 'organise': 'organize', 'organised': 'organized', 'organiser': 'organizer', 'organisers': 'organizers', 'organises': 'organizes', 'organising': 'organizing', 'orthopaedic': 'orthopedic', 'orthopaedics': 'orthopedics', 'ostracise': 'ostracize', 'ostracised': 'ostracized', 'ostracises': 'ostracizes', 'ostracising': 'ostracizing', 'outmanoeuvre': 'outmaneuver', 'outmanoeuvred': 'outmaneuvered', 'outmanoeuvres': 'outmaneuvers', 'outmanoeuvring': 'outmaneuvering', 'overemphasise': 'overemphasize', 'overemphasised': 'overemphasized', 'overemphasises': 'overemphasizes', 'overemphasising': 'overemphasizing', 'oxidisation': 'oxidization', 'oxidise': 'oxidize', 'oxidised': 'oxidized', 'oxidises': 'oxidizes', 'oxidising': 'oxidizing', 'paederast': 'pederast', 'paederasts': 'pederasts', 'paediatric': 'pediatric', 'paediatrician': 'pediatrician', 'paediatricians': 'pediatricians', 'paediatrics': 'pediatrics', 'paedophile': 'pedophile', 'paedophiles': 'pedophiles', 'paedophilia': 'pedophilia', 'palaeolithic': 'paleolithic', 'palaeontologist': 'paleontologist', 'palaeontologists': 'paleontologists', 'palaeontology': 'paleontology', 'panelled': 'paneled', 'panelling': 'paneling', 'panellist': 'panelist', 'panellists': 'panelists', 'paralyse': 'paralyze', 'paralysed': 'paralyzed', 'paralyses': 'paralyzes', 'paralysing': 'paralyzing', 'parcelled': 'parceled', 'parcelling': 'parceling', 'parlour': 'parlor', 'parlours': 'parlors', 'particularise': 'particularize', 'particularised': 'particularized', 'particularises': 'particularizes', 'particularising': 'particularizing', 'passivisation': 'passivization', 'passivise': 'passivize', 'passivised': 'passivized', 'passivises': 'passivizes', 'passivising': 'passivizing', 'pasteurisation': 'pasteurization', 'pasteurise': 'pasteurize', 'pasteurised': 'pasteurized', 'pasteurises': 'pasteurizes', 'pasteurising': 'pasteurizing', 'patronise': 'patronize', 'patronised': 'patronized', 'patronises': 'patronizes', 'patronising': 'patronizing', 'patronisingly': 'patronizingly', 'pedalled': 'pedaled', 'pedalling': 'pedaling', 'pedestrianisation': 'pedestrianization', 'pedestrianise': 'pedestrianize', 'pedestrianised': 'pedestrianized', 'pedestrianises': 'pedestrianizes', 'pedestrianising': 'pedestrianizing', 'penalise': 'penalize', 'penalised': 'penalized', 'penalises': 'penalizes', 'penalising': 'penalizing', 'pencilled': 'penciled', 'pencilling': 'penciling', 'personalise': 'personalize', 'personalised': 'personalized', 'personalises': 'personalizes', 'personalising': 'personalizing', 'pharmacopoeia': 'pharmacopeia', 'pharmacopoeias': 'pharmacopeias', 'philosophise': 'philosophize', 'philosophised': 'philosophized', 'philosophises': 'philosophizes', 'philosophising': 'philosophizing', 'philtre': 'filter', 'philtres': 'filters', 'phoney': 'phony', 'plagiarise': 'plagiarize', 'plagiarised': 'plagiarized', 'plagiarises': 'plagiarizes', 'plagiarising': 'plagiarizing', 'plough': 'plow', 'ploughed': 'plowed', 'ploughing': 'plowing', 'ploughman': 'plowman', 'ploughmen': 'plowmen', 'ploughs': 'plows', 'ploughshare': 'plowshare', 'ploughshares': 'plowshares', 'polarisation': 'polarization', 'polarise': 'polarize', 'polarised': 'polarized', 'polarises': 'polarizes', 'polarising': 'polarizing', 'politicisation': 'politicization', 'politicise': 'politicize', 'politicised': 'politicized', 'politicises': 'politicizes', 'politicising': 'politicizing', 'popularisation': 'popularization', 'popularise': 'popularize', 'popularised': 'popularized', 'popularises': 'popularizes', 'popularising': 'popularizing', 'pouffe': 'pouf', 'pouffes': 'poufs', 'practise': 'practice', 'practised': 'practiced', 'practises': 'practices', 'practising': 'practicing', 'praesidium': 'presidium', 'praesidiums': 'presidiums', 'pressurisation': 'pressurization', 'pressurise': 'pressurize', 'pressurised': 'pressurized', 'pressurises': 'pressurizes', 'pressurising': 'pressurizing', 'pretence': 'pretense', 'pretences': 'pretenses', 'primaeval': 'primeval', 'prioritisation': 'prioritization', 'prioritise': 'prioritize', 'prioritised': 'prioritized', 'prioritises': 'prioritizes', 'prioritising': 'prioritizing', 'privatisation': 'privatization', 'privatisations': 'privatizations', 'privatise': 'privatize', 'privatised': 'privatized', 'privatises': 'privatizes', 'privatising': 'privatizing', 'professionalisation': 'professionalization', 'professionalise': 'professionalize', 'professionalised': 'professionalized', 'professionalises': 'professionalizes', 'professionalising': 'professionalizing', 'programme': 'program', 'programmes': 'programs', 'prologue': 'prolog', 'prologues': 'prologs', 'propagandise': 'propagandize', 'propagandised': 'propagandized', 'propagandises': 'propagandizes', 'propagandising': 'propagandizing', 'proselytise': 'proselytize', 'proselytised': 'proselytized', 'proselytiser': 'proselytizer', 'proselytisers': 'proselytizers', 'proselytises': 'proselytizes', 'proselytising': 'proselytizing', 'psychoanalyse': 'psychoanalyze', 'psychoanalysed': 'psychoanalyzed', 'psychoanalyses': 'psychoanalyzes', 'psychoanalysing': 'psychoanalyzing', 'publicise': 'publicize', 'publicised': 'publicized', 'publicises': 'publicizes', 'publicising': 'publicizing', 'pulverisation': 'pulverization', 'pulverise': 'pulverize', 'pulverised': 'pulverized', 'pulverises': 'pulverizes', 'pulverising': 'pulverizing', 'pummelled': 'pummel', 'pummelling': 'pummeled', 'pyjama': 'pajama', 'pyjamas': 'pajamas', 'pzazz': 'pizzazz', 'quarrelled': 'quarreled', 'quarrelling': 'quarreling', 'radicalise': 'radicalize', 'radicalised': 'radicalized', 'radicalises': 'radicalizes', 'radicalising': 'radicalizing', 'rancour': 'rancor', 'randomise': 'randomize', 'randomised': 'randomized', 'randomises': 'randomizes', 'randomising': 'randomizing', 'rationalisation': 'rationalization', 'rationalisations': 'rationalizations', 'rationalise': 'rationalize', 'rationalised': 'rationalized', 'rationalises': 'rationalizes', 'rationalising': 'rationalizing', 'ravelled': 'raveled', 'ravelling': 'raveling', 'realisable': 'realizable', 'realisation': 'realization', 'realisations': 'realizations', 'realise': 'realize', 'realised': 'realized', 'realises': 'realizes', 'realising': 'realizing', 'recognisable': 'recognizable', 'recognisably': 'recognizably', 'recognisance': 'recognizance', 'recognise': 'recognize', 'recognised': 'recognized', 'recognises': 'recognizes', 'recognising': 'recognizing', 'reconnoitre': 'reconnoiter', 'reconnoitred': 'reconnoitered', 'reconnoitres': 'reconnoiters', 'reconnoitring': 'reconnoitering', 'refuelled': 'refueled', 'refuelling': 'refueling', 'regularisation': 'regularization', 'regularise': 'regularize', 'regularised': 'regularized', 'regularises': 'regularizes', 'regularising': 'regularizing', 'remodelled': 'remodeled', 'remodelling': 'remodeling', 'remould': 'remold', 'remoulded': 'remolded', 'remoulding': 'remolding', 'remoulds': 'remolds', 'reorganisation': 'reorganization', 'reorganisations': 'reorganizations', 'reorganise': 'reorganize', 'reorganised': 'reorganized', 'reorganises': 'reorganizes', 'reorganising': 'reorganizing', 'revelled': 'reveled', 'reveller': 'reveler', 'revellers': 'revelers', 'revelling': 'reveling', 'revitalise': 'revitalize', 'revitalised': 'revitalized', 'revitalises': 'revitalizes', 'revitalising': 'revitalizing', 'revolutionise': 'revolutionize', 'revolutionised': 'revolutionized', 'revolutionises': 'revolutionizes', 'revolutionising': 'revolutionizing', 'rhapsodise': 'rhapsodize', 'rhapsodised': 'rhapsodized', 'rhapsodises': 'rhapsodizes', 'rhapsodising': 'rhapsodizing', 'rigour': 'rigor', 'rigours': 'rigors', 'ritualised': 'ritualized', 'rivalled': 'rivaled', 'rivalling': 'rivaling', 'romanticise': 'romanticize', 'romanticised': 'romanticized', 'romanticises': 'romanticizes', 'romanticising': 'romanticizing', 'rumour': 'rumor', 'rumoured': 'rumored', 'rumours': 'rumors', 'sabre': 'saber', 'sabres': 'sabers', 'saltpetre': 'saltpeter', 'sanitise': 'sanitize', 'sanitised': 'sanitized', 'sanitises': 'sanitizes', 'sanitising': 'sanitizing', 'satirise': 'satirize', 'satirised': 'satirized', 'satirises': 'satirizes', 'satirising': 'satirizing', 'saviour': 'savior', 'saviours': 'saviors', 'savour': 'savor', 'savoured': 'savored', 'savouries': 'savories', 'savouring': 'savoring', 'savours': 'savors', 'savoury': 'savory', 'scandalise': 'scandalize', 'scandalised': 'scandalized', 'scandalises': 'scandalizes', 'scandalising': 'scandalizing', 'sceptic': 'skeptic', 'sceptical': 'skeptical', 'sceptically': 'skeptically', 'scepticism': 'skepticism', 'sceptics': 'skeptics', 'sceptre': 'scepter', 'sceptres': 'scepters', 'scrutinise': 'scrutinize', 'scrutinised': 'scrutinized', 'scrutinises': 'scrutinizes', 'scrutinising': 'scrutinizing', 'secularisation': 'secularization', 'secularise': 'secularize', 'secularised': 'secularized', 'secularises': 'secularizes', 'secularising': 'secularizing', 'sensationalise': 'sensationalize', 'sensationalised': 'sensationalized', 'sensationalises': 'sensationalizes', 'sensationalising': 'sensationalizing', 'sensitise': 'sensitize', 'sensitised': 'sensitized', 'sensitises': 'sensitizes', 'sensitising': 'sensitizing', 'sentimentalise': 'sentimentalize', 'sentimentalised': 'sentimentalized', 'sentimentalises': 'sentimentalizes', 'sentimentalising': 'sentimentalizing', 'sepulchre': 'sepulcher', 'sepulchres': 'sepulchers', 'serialisation': 'serialization', 'serialisations': 'serializations', 'serialise': 'serialize', 'serialised': 'serialized', 'serialises': 'serializes', 'serialising': 'serializing', 'sermonise': 'sermonize', 'sermonised': 'sermonized', 'sermonises': 'sermonizes', 'sermonising': 'sermonizing', 'sheikh': 'sheik', 'shovelled': 'shoveled', 'shovelling': 'shoveling', 'shrivelled': 'shriveled', 'shrivelling': 'shriveling', 'signalise': 'signalize', 'signalised': 'signalized', 'signalises': 'signalizes', 'signalising': 'signalizing', 'signalled': 'signaled', 'signalling': 'signaling', 'smoulder': 'smolder', 'smouldered': 'smoldered', 'smouldering': 'smoldering', 'smoulders': 'smolders', 'snivelled': 'sniveled', 'snivelling': 'sniveling', 'snorkelled': 'snorkeled', 'snorkelling': 'snorkeling', 'snowplough': 'snowplow', 'snowploughs': 'snowplow', 'socialisation': 'socialization', 'socialise': 'socialize', 'socialised': 'socialized', 'socialises': 'socializes', 'socialising': 'socializing', 'sodomise': 'sodomize', 'sodomised': 'sodomized', 'sodomises': 'sodomizes', 'sodomising': 'sodomizing', 'solemnise': 'solemnize', 'solemnised': 'solemnized', 'solemnises': 'solemnizes', 'solemnising': 'solemnizing', 'sombre': 'somber', 'specialisation': 'specialization', 'specialisations': 'specializations', 'specialise': 'specialize', 'specialised': 'specialized', 'specialises': 'specializes', 'specialising': 'specializing', 'spectre': 'specter', 'spectres': 'specters', 'spiralled': 'spiraled', 'spiralling': 'spiraling', 'splendour': 'splendor', 'splendours': 'splendors', 'squirrelled': 'squirreled', 'squirrelling': 'squirreling', 'stabilisation': 'stabilization', 'stabilise': 'stabilize', 'stabilised': 'stabilized', 'stabiliser': 'stabilizer', 'stabilisers': 'stabilizers', 'stabilises': 'stabilizes', 'stabilising': 'stabilizing', 'standardisation': 'standardization', 'standardise': 'standardize', 'standardised': 'standardized', 'standardises': 'standardizes', 'standardising': 'standardizing', 'stencilled': 'stenciled', 'stencilling': 'stenciling', 'sterilisation': 'sterilization', 'sterilisations': 'sterilizations', 'sterilise': 'sterilize', 'sterilised': 'sterilized', 'steriliser': 'sterilizer', 'sterilisers': 'sterilizers', 'sterilises': 'sterilizes', 'sterilising': 'sterilizing', 'stigmatisation': 'stigmatization', 'stigmatise': 'stigmatize', 'stigmatised': 'stigmatized', 'stigmatises': 'stigmatizes', 'stigmatising': 'stigmatizing', 'storey': 'story', 'storeys': 'stories', 'subsidisation': 'subsidization', 'subsidise': 'subsidize', 'subsidised': 'subsidized', 'subsidiser': 'subsidizer', 'subsidisers': 'subsidizers', 'subsidises': 'subsidizes', 'subsidising': 'subsidizing', 'succour': 'succor', 'succoured': 'succored', 'succouring': 'succoring', 'succours': 'succors', 'sulphate': 'sulfate', 'sulphates': 'sulfates', 'sulphide': 'sulfide', 'sulphides': 'sulfides', 'sulphur': 'sulfur', 'sulphurous': 'sulfurous', 'summarise': 'summarize', 'summarised': 'summarized', 'summarises': 'summarizes', 'summarising': 'summarizing', 'swivelled': 'swiveled', 'swivelling': 'swiveling', 'symbolise': 'symbolize', 'symbolised': 'symbolized', 'symbolises': 'symbolizes', 'symbolising': 'symbolizing', 'sympathise': 'sympathize', 'sympathised': 'sympathized', 'sympathiser': 'sympathizer', 'sympathisers': 'sympathizers', 'sympathises': 'sympathizes', 'sympathising': 'sympathizing', 'synchronisation': 'synchronization', 'synchronise': 'synchronize', 'synchronised': 'synchronized', 'synchronises': 'synchronizes', 'synchronising': 'synchronizing', 'synthesise': 'synthesize', 'synthesised': 'synthesized', 'synthesiser': 'synthesizer', 'synthesisers': 'synthesizers', 'synthesises': 'synthesizes', 'synthesising': 'synthesizing', 'syphon': 'siphon', 'syphoned': 'siphoned', 'syphoning': 'siphoning', 'syphons': 'siphons', 'systematisation': 'systematization', 'systematise': 'systematize', 'systematised': 'systematized', 'systematises': 'systematizes', 'systematising': 'systematizing', 'tantalise': 'tantalize', 'tantalised': 'tantalized', 'tantalises': 'tantalizes', 'tantalising': 'tantalizing', 'tantalisingly': 'tantalizingly', 'tasselled': 'tasseled', 'technicolour': 'technicolor', 'temporise': 'temporize', 'temporised': 'temporized', 'temporises': 'temporizes', 'temporising': 'temporizing', 'tenderise': 'tenderize', 'tenderised': 'tenderized', 'tenderises': 'tenderizes', 'tenderising': 'tenderizing', 'terrorise': 'terrorize', 'terrorised': 'terrorized', 'terrorises': 'terrorizes', 'terrorising': 'terrorizing', 'theatre': 'theater', 'theatregoer': 'theatergoer', 'theatregoers': 'theatergoers', 'theatres': 'theaters', 'theorise': 'theorize', 'theorised': 'theorized', 'theorises': 'theorizes', 'theorising': 'theorizing', 'tonne': 'ton', 'tonnes': 'tons', 'towelled': 'toweled', 'towelling': 'toweling', 'toxaemia': 'toxemia', 'tranquillise': 'tranquilize', 'tranquillised': 'tranquilized', 'tranquilliser': 'tranquilizer', 'tranquillisers': 'tranquilizers', 'tranquillises': 'tranquilizes', 'tranquillising': 'tranquilizing', 'tranquillity': 'tranquility', 'tranquillize': 'tranquilize', 'tranquillized': 'tranquilized', 'tranquillizer': 'tranquilizer', 'tranquillizers': 'tranquilizers', 'tranquillizes': 'tranquilizes', 'tranquillizing': 'tranquilizing', 'tranquilly': 'tranquility', 'transistorised': 'transistorized', 'traumatise': 'traumatize', 'traumatised': 'traumatized', 'traumatises': 'traumatizes', 'traumatising': 'traumatizing', 'travelled': 'traveled', 'traveller': 'traveler', 'travellers': 'travelers', 'travelling': 'traveling', 'travelogue': 'travelog', 'travelogues': 'travelogs', 'trialled': 'trialed', 'trialling': 'trialing', 'tricolour': 'tricolor', 'tricolours': 'tricolors', 'trivialise': 'trivialize', 'trivialised': 'trivialized', 'trivialises': 'trivializes', 'trivialising': 'trivializing', 'tumour': 'tumor', 'tumours': 'tumors', 'tunnelled': 'tunneled', 'tunnelling': 'tunneling', 'tyrannise': 'tyrannize', 'tyrannised': 'tyrannized', 'tyrannises': 'tyrannizes', 'tyrannising': 'tyrannizing', 'tyre': 'tire', 'tyres': 'tires', 'unauthorised': 'unauthorized', 'uncivilised': 'uncivilized', 'underutilised': 'underutilized', 'unequalled': 'unequaled', 'unfavourable': 'unfavorable', 'unfavourably': 'unfavorably', 'unionisation': 'unionization', 'unionise': 'unionize', 'unionised': 'unionized', 'unionises': 'unionizes', 'unionising': 'unionizing', 'unorganised': 'unorganized', 'unravelled': 'unraveled', 'unravelling': 'unraveling', 'unrecognisable': 'unrecognizable', 'unrecognised': 'unrecognized', 'unrivalled': 'unrivaled', 'unsavoury': 'unsavory', 'untrammelled': 'untrammeled', 'urbanisation': 'urbanization', 'urbanise': 'urbanize', 'urbanised': 'urbanized', 'urbanises': 'urbanizes', 'urbanising': 'urbanizing', 'utilisable': 'utilizable', 'utilisation': 'utilization', 'utilise': 'utilize', 'utilised': 'utilized', 'utilises': 'utilizes', 'utilising': 'utilizing', 'valour': 'valor', 'vandalise': 'vandalize', 'vandalised': 'vandalized', 'vandalises': 'vandalizes', 'vandalising': 'vandalizing', 'vaporisation': 'vaporization', 'vaporise': 'vaporize', 'vaporised': 'vaporized', 'vaporises': 'vaporizes', 'vaporising': 'vaporizing', 'vapour': 'vapor', 'vapours': 'vapors', 'verbalise': 'verbalize', 'verbalised': 'verbalized', 'verbalises': 'verbalizes', 'verbalising': 'verbalizing', 'victimisation': 'victimization', 'victimise': 'victimize', 'victimised': 'victimized', 'victimises': 'victimizes', 'victimising': 'victimizing', 'videodisc': 'videodisk', 'videodiscs': 'videodisks', 'vigour': 'vigor', 'visualisation': 'visualization', 'visualisations': 'visualizations', 'visualise': 'visualize', 'visualised': 'visualized', 'visualises': 'visualizes', 'visualising': 'visualizing', 'vocalisation': 'vocalization', 'vocalisations': 'vocalizations', 'vocalise': 'vocalize', 'vocalised': 'vocalized', 'vocalises': 'vocalizes', 'vocalising': 'vocalizing', 'vulcanised': 'vulcanized', 'vulgarisation': 'vulgarization', 'vulgarise': 'vulgarize', 'vulgarised': 'vulgarized', 'vulgarises': 'vulgarizes', 'vulgarising': 'vulgarizing', 'waggon': 'wagon', 'waggons': 'wagons', 'watercolour': 'watercolor', 'watercolours': 'watercolors', 'weaselled': 'weaseled', 'weaselling': 'weaseling', 'westernisation': 'westernization', 'westernise': 'westernize', 'westernised': 'westernized', 'westernises': 'westernizes', 'westernising': 'westernizing', 'womanise': 'womanize', 'womanised': 'womanized', 'womaniser': 'womanizer', 'womanisers': 'womanizers', 'womanises': 'womanizes', 'womanising': 'womanizing', 'woollen': 'woolen', 'woollens': 'woolens', 'woollies': 'woolies', 'woolly': 'wooly', 'worshipped': 'worshiped', 'worshipping': 'worshiping', 'worshipper': 'worshiper', 'yodelled': 'yodeled', 'yodelling': 'yodeling', 'yoghourt': 'yogurt', 'yoghourts': 'yogurts', 'yoghurt': 'yogurt', 'yoghurts': 'yogurts'}
|
n = int(input())
while n != -1:
prev_time = 0
total = 0
for _ in range(n):
(speed, time) = map(int, input().split(" "))
total += (time - prev_time) * speed
prev_time = time
print(total, "miles")
n = int(input())
|
n = int(input())
while n != -1:
prev_time = 0
total = 0
for _ in range(n):
(speed, time) = map(int, input().split(' '))
total += (time - prev_time) * speed
prev_time = time
print(total, 'miles')
n = int(input())
|
"""
URL: https://codeforces.com/problemset/problem/753/A
Author: Safiul Kabir [safiulanik at gmail.com]
Tags: dp, greedy, math, *1000
"""
n = int(input())
count = 0
a = []
summ = 0
for i in range(1, n + 1):
summ += i
if summ > n:
break
count += 1
a.append(i)
if summ > n:
a[-1] += n - summ + i
print(count)
print(' '.join(map(str, a)))
|
"""
URL: https://codeforces.com/problemset/problem/753/A
Author: Safiul Kabir [safiulanik at gmail.com]
Tags: dp, greedy, math, *1000
"""
n = int(input())
count = 0
a = []
summ = 0
for i in range(1, n + 1):
summ += i
if summ > n:
break
count += 1
a.append(i)
if summ > n:
a[-1] += n - summ + i
print(count)
print(' '.join(map(str, a)))
|
"""Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Note: Do not modify the linked list.
Follow up:
Can you solve it without using extra space?
"""
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
def detect_cycle(head):
"""If head is a linked list with a cycle, its entry point node is returned. If not,
None is returned.
Time Complexity: O(N), where N is the number of nodes of the linked list.
Space Complexity: O(1).
:param head: ListNode
:return: entry: ListNode
"""
slow = head
fast = head
while fast and fast.next and fast.next.next:
slow = slow.next
fast = fast.next.next
# If there is a cycle, at some point slow and fast should be equal.
if slow == fast:
# In that case, move head and slow until there are equal. That
# node is the entry node.
while slow != head:
slow = slow.next
head = head.next
return slow
return None
if __name__ == "__main__":
"""
Linked list with a cycle starting at node "b"
c - d
/ \
a - b e
\ /
g - f
"""
a = ListNode("a")
b = ListNode("b")
c = ListNode("c")
d = ListNode("d")
e = ListNode("e")
f = ListNode("f")
g = ListNode("g")
a.next = b
b.next = c
c.next = d
d.next = e
e.next = f
f.next = g
g.next = b
entry_node = detect_cycle(a)
assert entry_node == b
ll = ListNode("a")
ll.next = ListNode("b")
ll.next.next = ListNode("c")
assert detect_cycle(ll) is None
ll = ListNode("a")
ll.next = ListNode("b")
ll.next.next = ListNode("c")
ll.next.next.next = ll
assert detect_cycle(ll) == ll
|
"""Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Note: Do not modify the linked list.
Follow up:
Can you solve it without using extra space?
"""
class Listnode(object):
def __init__(self, x):
self.val = x
self.next = None
def detect_cycle(head):
"""If head is a linked list with a cycle, its entry point node is returned. If not,
None is returned.
Time Complexity: O(N), where N is the number of nodes of the linked list.
Space Complexity: O(1).
:param head: ListNode
:return: entry: ListNode
"""
slow = head
fast = head
while fast and fast.next and fast.next.next:
slow = slow.next
fast = fast.next.next
if slow == fast:
while slow != head:
slow = slow.next
head = head.next
return slow
return None
if __name__ == '__main__':
'\n Linked list with a cycle starting at node "b"\n c - d\n / a - b e\n \\ /\n g - f \n '
a = list_node('a')
b = list_node('b')
c = list_node('c')
d = list_node('d')
e = list_node('e')
f = list_node('f')
g = list_node('g')
a.next = b
b.next = c
c.next = d
d.next = e
e.next = f
f.next = g
g.next = b
entry_node = detect_cycle(a)
assert entry_node == b
ll = list_node('a')
ll.next = list_node('b')
ll.next.next = list_node('c')
assert detect_cycle(ll) is None
ll = list_node('a')
ll.next = list_node('b')
ll.next.next = list_node('c')
ll.next.next.next = ll
assert detect_cycle(ll) == ll
|
class Node:
_fields = []
def __init__(self, *args):
for key, value in zip(self._fields, args):
setattr(self, key, value)
def __repl__(self):
return self.__str__()
# literals...
class Bool(Node):
_fields = ["value"]
def __str__(self):
string = "Boolean=" + str(self.value)
return string
class Num(Node):
_fields = ["value"]
def __str__(self):
string = "Number=" + str(self.value)
return string
class Str(Node):
_fields = ["s"]
def __str__(self):
string = "String=" + str(self.s)
return string
# ids..
class Id(Node):
_fields = ["name"]
def __str__(self):
return "Id=" + str(self.name)
# expressions
class Expr(Node):
_fields = ["body"]
def __str__(self):
return "Expression(" + str(self.body) + ")"
class Assign(Node):
_fields = ["iden", "expr"]
def __str__(self):
return "Assign(" + str(self.iden) + ", " + str(self.expr) + ")"
class Call(Node):
_fields = ["operator", "operands"]
def __str__(self):
operands = ""
for operand in self.operands:
operands += (str(operand) + ', ')
return "Call(" + str(self.operator) + ", [" + operands + "])"
class Lambda(Node):
_fields = ["formals", "body"]
def __str__(self):
body = ""
for exp in self.body:
body += (str(exp) + ', ')
return "Lambda(formals = " + str(self.formals) + ", body=" + body + ")"
class Arguments(Node):
_fields = ["required_args", "optional_args"]
def __str__(self):
r_args = ''
for arg in self.required_args:
r_args += (str(arg) + ", ")
o_args = ''
if self.optional_args:
for arg in self.optional_args:
o_args += (str(arg) + ", ")
return "r_args=[" + r_args + "], o_args=[" + o_args + "]"
class Program(Node):
_fields = ["exprs"]
def __str__(self):
return "Program(" + str(self.exprs) + ")"
class Conditional(Node):
_fields = ["test", "conseq", "alt"]
def __str__(self):
test = str(self.test)
then = str(self.conseq)
el = str(self.alt)
return "Conditional(if=" + test + ", then=" + then + ", else=" + el + ")"
class Do(Node):
_fields = ["iter_specs", "test", "do_result", "cmds"]
def __str__(self):
specs =""
for spec in self.iter_specs:
specs += (str(spec) + ", ")
test = str(self.test)
do_result = str(self.do_result)
return "Do((" + specs + "), " + test + do_result + str(self.cmds) + ")"
class IterSpec(Node):
_fields = ["iden", "init", "step"]
def __str__(self):
return "IterSpec(" + str(self.iden) + ", " + str(self.init) + ", " + str(self.step) + ")"
|
class Node:
_fields = []
def __init__(self, *args):
for (key, value) in zip(self._fields, args):
setattr(self, key, value)
def __repl__(self):
return self.__str__()
class Bool(Node):
_fields = ['value']
def __str__(self):
string = 'Boolean=' + str(self.value)
return string
class Num(Node):
_fields = ['value']
def __str__(self):
string = 'Number=' + str(self.value)
return string
class Str(Node):
_fields = ['s']
def __str__(self):
string = 'String=' + str(self.s)
return string
class Id(Node):
_fields = ['name']
def __str__(self):
return 'Id=' + str(self.name)
class Expr(Node):
_fields = ['body']
def __str__(self):
return 'Expression(' + str(self.body) + ')'
class Assign(Node):
_fields = ['iden', 'expr']
def __str__(self):
return 'Assign(' + str(self.iden) + ', ' + str(self.expr) + ')'
class Call(Node):
_fields = ['operator', 'operands']
def __str__(self):
operands = ''
for operand in self.operands:
operands += str(operand) + ', '
return 'Call(' + str(self.operator) + ', [' + operands + '])'
class Lambda(Node):
_fields = ['formals', 'body']
def __str__(self):
body = ''
for exp in self.body:
body += str(exp) + ', '
return 'Lambda(formals = ' + str(self.formals) + ', body=' + body + ')'
class Arguments(Node):
_fields = ['required_args', 'optional_args']
def __str__(self):
r_args = ''
for arg in self.required_args:
r_args += str(arg) + ', '
o_args = ''
if self.optional_args:
for arg in self.optional_args:
o_args += str(arg) + ', '
return 'r_args=[' + r_args + '], o_args=[' + o_args + ']'
class Program(Node):
_fields = ['exprs']
def __str__(self):
return 'Program(' + str(self.exprs) + ')'
class Conditional(Node):
_fields = ['test', 'conseq', 'alt']
def __str__(self):
test = str(self.test)
then = str(self.conseq)
el = str(self.alt)
return 'Conditional(if=' + test + ', then=' + then + ', else=' + el + ')'
class Do(Node):
_fields = ['iter_specs', 'test', 'do_result', 'cmds']
def __str__(self):
specs = ''
for spec in self.iter_specs:
specs += str(spec) + ', '
test = str(self.test)
do_result = str(self.do_result)
return 'Do((' + specs + '), ' + test + do_result + str(self.cmds) + ')'
class Iterspec(Node):
_fields = ['iden', 'init', 'step']
def __str__(self):
return 'IterSpec(' + str(self.iden) + ', ' + str(self.init) + ', ' + str(self.step) + ')'
|
def enum(**enums):
return type('Enum', (), enums)
control = enum(CHOICE_BOX = 0,
TEXT_BOX = 1,
COMBO_BOX = 2,
INT_CTRL = 3,
FLOAT_CTRL = 4,
DIR_COMBO_BOX = 5,
CHECKLIST_BOX = 6,
LISTBOX_COMBO = 7,
TEXTBOX_COMBO = 8,
CHECKBOX_GRID = 9,
GPA_CHECKBOX_GRID = 10,
SPIN_BOX_FLOAT = 11)
dtype = enum(BOOL = 0,
STR = 1,
NUM = 2,
LBOOL = 3,
LSTR = 4,
LNUM = 5,
LOFL = 6,
COMBO = 7,
LDICT = 8 )
substitution_map = {'On': 1,
'Off': 0,
'On/Off': 10,
'ANTS & FSL': 11,
'3dAutoMask & BET': 12,
'AFNI & BET' : 12,
'ALFF':'alff',
'f/ALFF':'falff',
'ReHo':'reho',
'ROI Average SCA':'sca_roi',
'Multiple Regression SCA':'sca_tempreg',
'VMHC':'vmhc',
'Network Centrality':'centrality',
'Dual Regression':'dr_tempreg',
'ROI Average Time Series Extraction': 'roi_average',
'ROI Voxelwise Time Series Extraction': 'roi_voxelwise',
}
multiple_value_wfs = ['runAnatomicalPreprocessing',
'runFunctionalPreprocessing',
'runRegistrationPreprocessing',
'runRegisterFuncToMNI',
'runAnatomicalToFunctionalRegistration',
'runSegmentationPreprocessing',
'runNuisance',
'runFrequencyFiltering',
'runMedianAngleCorrection',
'runScrubbing',
'runFristonModel'
'runEPI_DistCorr']
|
def enum(**enums):
return type('Enum', (), enums)
control = enum(CHOICE_BOX=0, TEXT_BOX=1, COMBO_BOX=2, INT_CTRL=3, FLOAT_CTRL=4, DIR_COMBO_BOX=5, CHECKLIST_BOX=6, LISTBOX_COMBO=7, TEXTBOX_COMBO=8, CHECKBOX_GRID=9, GPA_CHECKBOX_GRID=10, SPIN_BOX_FLOAT=11)
dtype = enum(BOOL=0, STR=1, NUM=2, LBOOL=3, LSTR=4, LNUM=5, LOFL=6, COMBO=7, LDICT=8)
substitution_map = {'On': 1, 'Off': 0, 'On/Off': 10, 'ANTS & FSL': 11, '3dAutoMask & BET': 12, 'AFNI & BET': 12, 'ALFF': 'alff', 'f/ALFF': 'falff', 'ReHo': 'reho', 'ROI Average SCA': 'sca_roi', 'Multiple Regression SCA': 'sca_tempreg', 'VMHC': 'vmhc', 'Network Centrality': 'centrality', 'Dual Regression': 'dr_tempreg', 'ROI Average Time Series Extraction': 'roi_average', 'ROI Voxelwise Time Series Extraction': 'roi_voxelwise'}
multiple_value_wfs = ['runAnatomicalPreprocessing', 'runFunctionalPreprocessing', 'runRegistrationPreprocessing', 'runRegisterFuncToMNI', 'runAnatomicalToFunctionalRegistration', 'runSegmentationPreprocessing', 'runNuisance', 'runFrequencyFiltering', 'runMedianAngleCorrection', 'runScrubbing', 'runFristonModelrunEPI_DistCorr']
|
"""
Given a binary tree, return the zigzag level order traversal of its nodes'
values. (ie, from left to right, then right to left for the next level and
alternate between).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
[3],
[20,9],
[15,7]
]
"""
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a list of lists of integers
def zigzagLevelOrder(self, root):
if root is None:
return []
res = []
queue = []
rev = False # Reverse direction
level = []
queue.append(root)
queue.append(None)
while queue:
root = queue.pop(0)
if root is None:
if queue:
queue.append(None)
res.append(level)
level = []
rev = not rev # Toggle direction
else:
if rev:
level.insert(0, root.val)
else:
level.append(root.val)
if root.left is not None:
queue.append(root.left)
if root.right is not None:
queue.append(root.right)
return res
|
"""
Given a binary tree, return the zigzag level order traversal of its nodes'
values. (ie, from left to right, then right to left for the next level and
alternate between).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ 9 20
/ 15 7
return its zigzag level order traversal as:
[
[3],
[20,9],
[15,7]
]
"""
class Solution:
def zigzag_level_order(self, root):
if root is None:
return []
res = []
queue = []
rev = False
level = []
queue.append(root)
queue.append(None)
while queue:
root = queue.pop(0)
if root is None:
if queue:
queue.append(None)
res.append(level)
level = []
rev = not rev
else:
if rev:
level.insert(0, root.val)
else:
level.append(root.val)
if root.left is not None:
queue.append(root.left)
if root.right is not None:
queue.append(root.right)
return res
|
'''
lanhuage: python
Descripttion:
version: beta
Author: xiaoshuyui
Date: 2020-09-15 13:53:11
LastEditors: xiaoshuyui
LastEditTime: 2020-09-22 11:20:14
'''
__version__ = '0.0.0'
__appname__ = 'show and search'
|
"""
lanhuage: python
Descripttion:
version: beta
Author: xiaoshuyui
Date: 2020-09-15 13:53:11
LastEditors: xiaoshuyui
LastEditTime: 2020-09-22 11:20:14
"""
__version__ = '0.0.0'
__appname__ = 'show and search'
|
def contains_magic_number(list1, magic_number):
for i in list1:
if i == magic_number:
print("This list contains the magic number")
# if not add break , will run more meaningless loop
break
else:
print("This list does NOT contain the magic number")
if __name__ == "__main__":
contains_magic_number(range(10), 3)
|
def contains_magic_number(list1, magic_number):
for i in list1:
if i == magic_number:
print('This list contains the magic number')
break
else:
print('This list does NOT contain the magic number')
if __name__ == '__main__':
contains_magic_number(range(10), 3)
|
def dfs_inorder(tree):
if tree is None: return None
out = []
dfs_inorder(tree.left)
out.append(tree.value)
print(tree.value)
dfs_inorder(tree.right)
return out
def dfs_preorder(tree):
if tree is None: return None
out = []
out.append(tree.value)
print(tree.value)
dfs_preorder(tree.left)
dfs_preorder(tree.right)
return out
def dfs_postorder(tree):
if tree is None: return None
out = []
dfs_postorder(tree.left)
dfs_postorder(tree.right)
out.append(tree.value)
print(tree.value)
return out
|
def dfs_inorder(tree):
if tree is None:
return None
out = []
dfs_inorder(tree.left)
out.append(tree.value)
print(tree.value)
dfs_inorder(tree.right)
return out
def dfs_preorder(tree):
if tree is None:
return None
out = []
out.append(tree.value)
print(tree.value)
dfs_preorder(tree.left)
dfs_preorder(tree.right)
return out
def dfs_postorder(tree):
if tree is None:
return None
out = []
dfs_postorder(tree.left)
dfs_postorder(tree.right)
out.append(tree.value)
print(tree.value)
return out
|
def round_down(num, digits: int):
a = float(num)
if digits < 0:
b = 10 ** int(abs(digits))
answer = int(a * b) / b
else:
b = 10 ** int(digits)
answer = int(a / b) * b
assert not(not(-0.01 < num < 0.01) and answer == 0)
return answer
|
def round_down(num, digits: int):
a = float(num)
if digits < 0:
b = 10 ** int(abs(digits))
answer = int(a * b) / b
else:
b = 10 ** int(digits)
answer = int(a / b) * b
assert not (not -0.01 < num < 0.01 and answer == 0)
return answer
|
INPUT = {
2647: [
list("#....#####"),
list(".##......#"),
list("##......##"),
list(".....#..#."),
list(".........#"),
list(".....#..##"),
list("#.#....#.."),
list("#......#.#"),
list("#....##..#"),
list("...##....."),
],
1283: [
list("######..#."),
list("#.#..#.#.."),
list("..#..#...#"),
list(".#.##..#.."),
list("#......#.."),
list("#.#....##."),
list(".#.....#.#"),
list("#.#..#.#.#"),
list(".#......##"),
list("...##....."),
],
3547: [
list("#.#.#.###."),
list("#........."),
list("#....##..."),
list("#.....#..#"),
list("#.....#.#."),
list("##..##...#"),
list("#...##...."),
list("......#..#"),
list("#...##...."),
list(".....###.#"),
],
1451: [
list("##..#.#..."),
list("#.#......."),
list("##.#.....#"),
list("....#....."),
list("...#...##."),
list("......#.#."),
list("#...##.##."),
list("........#."),
list(".#.##.#..."),
list("..##..#..."),
],
3137: [
list("....#.##.#"),
list("#....#...#"),
list("..#.#....."),
list("...####..#"),
list(".#.###...#"),
list(".......#.."),
list("##.##.#..#"),
list(".#.##....#"),
list("#...#....#"),
list("..##.##..#"),
],
2897: [
list("###..#.##."),
list("..#......#"),
list(".....#...."),
list("###.#....#"),
list("#.#..#...#"),
list(".#...##..#"),
list("##..##.##."),
list("#.....#..#"),
list(".#......##"),
list("#.#.#.##.#"),
],
1093: [
list("..#.#.#.#."),
list("#.#......."),
list("..##....#."),
list(".#.....#.#"),
list("#........#"),
list(".#....#..#"),
list("##....#..#"),
list("#.##..#..#"),
list("..###...##"),
list(".######.##"),
],
1217: [
list("#..#....##"),
list("#.....#..."),
list("##...##..#"),
list("#.....#..."),
list("..#.#..#.."),
list("#..#....##"),
list(".##.#....."),
list("......#..."),
list(".#........"),
list(".#..###.#."),
],
2801: [
list("###..##.#."),
list(".........#"),
list("##.#...###"),
list("#......#.."),
list("#........#"),
list("......#..."),
list("##.####..."),
list(".....##..."),
list("..#..#.##."),
list("...###.##."),
],
1361: [
list("...#.##..#"),
list("....#....."),
list("###......."),
list("#......#.."),
list(".......##."),
list("#...#..#.."),
list("#.....##.#"),
list("##........"),
list("#.#......."),
list("###.#..###"),
],
2063: [
list("...#....##"),
list("##...#..##"),
list("#........#"),
list("........##"),
list("#.......##"),
list("#........."),
list("##.....##."),
list(".....##..#"),
list(".#.##.#..."),
list(".#..#####."),
],
3797: [
list("##..#...#."),
list(".###.#.##."),
list(".....#.##."),
list("..#......."),
list("...#.#...."),
list("........##"),
list("#.#.#.##.#"),
list("#.....#.##"),
list("#.......#."),
list(".....#.##."),
],
1289: [
list("####.##.#."),
list(".....#...."),
list("#..#.#...."),
list("####...#.."),
list("#.#..#..#."),
list(".#.##..#.."),
list("#........#"),
list("....#..#.."),
list("........#."),
list("###.#.####"),
],
1427: [
list("##.##..##."),
list("###..#.##."),
list("#..##...#."),
list("#..#.#...#"),
list("#........#"),
list("#...##...."),
list("#........#"),
list(".....#..#."),
list(".####....#"),
list("##.#.##.#."),
],
1951: [
list("....##.#.#"),
list(".........#"),
list("#........#"),
list(".#..#...#."),
list(".....#####"),
list("#......#.#"),
list("...##....#"),
list("......#..."),
list("..#...#..#"),
list("....####.#"),
],
1483: [
list("....####.."),
list(".......#.#"),
list("###..#..##"),
list("...#.#...#"),
list("#..##...##"),
list("##.#......"),
list("#...#..#.."),
list("..#...#.##"),
list(".........#"),
list(".#...#...."),
],
1789: [
list("##..#####."),
list("....#....#"),
list("........#."),
list("..#.#..#.#"),
list("..##.#..##"),
list(".........#"),
list(".........#"),
list("#..#.#..##"),
list("....##...."),
list("#.#......."),
],
2129: [
list("#.###.#..#"),
list("....##...#"),
list(".#..#..##."),
list("...###.##."),
list("..#..#...#"),
list("....##...#"),
list("#........."),
list("#...#..###"),
list("#...#....."),
list("...#....##"),
],
2137: [
list("..#.####.#"),
list("##...#.#.."),
list(".......###"),
list(".#.....#.#"),
list(".#....##.#"),
list("#.......#."),
list("#....#...#"),
list("#.....####"),
list("......##.#"),
list("..#####.##"),
],
3761: [
list(".####.#..."),
list("####..#..#"),
list("#...##..##"),
list(".#.....#.#"),
list("....#....#"),
list("#.......#."),
list("...#..#..#"),
list("#.##...##."),
list("...###...#"),
list("...##.#..#"),
],
1327: [
list("..####.#.#"),
list("#..#......"),
list("......#.##"),
list("#..##....."),
list("..##.##..#"),
list("#.#.#....."),
list("####.....#"),
list("..#......."),
list("#.#...##.."),
list("#.##....#."),
],
2741: [
list(".#..#...#."),
list("#....#..#."),
list("......##.#"),
list("....#.#..#"),
list("........##"),
list("...#..#..."),
list("......##.."),
list("#...#..#.#"),
list("......##.."),
list("..#..#..#."),
],
1699: [
list(".###..####"),
list("##.....#.#"),
list(".....##.##"),
list("#.#...##.."),
list(".#........"),
list(".#....#..#"),
list("#..#....#."),
list(".#...#...#"),
list("#.......#."),
list("##.#..#..#"),
],
1151: [
list("..#.##...."),
list("##....#..."),
list("###.#..#.#"),
list("#.......##"),
list("....#.#..#"),
list("#...###..."),
list(".#..#.#..#"),
list("#.#..##..#"),
list(".#.#.#.#.."),
list(".###..####"),
],
2273: [
list("#.#.#.#.##"),
list(".........."),
list("#......#.."),
list("#.....#..."),
list("#.#...#..."),
list("##....##.."),
list("##..##.#.."),
list("#.#####.##"),
list("##.##...##"),
list("#...##..##"),
],
1999: [
list("##.##...##"),
list("#......#.."),
list("##..#....."),
list("#........#"),
list("#.#...####"),
list("..#....#.#"),
list("#..#...#.."),
list(".........#"),
list("#...##...."),
list("##.##.##.."),
],
1721: [
list("....##...#"),
list("###.#....#"),
list(".##..#...."),
list(".#.#.#...."),
list("...##....#"),
list("##..#....#"),
list("#....#.###"),
list("#.....##.."),
list("....#...##"),
list("..#.#.#..#"),
],
2521: [
list("..#######."),
list("#.#..##.#."),
list(".#....##.#"),
list("..#...####"),
list(".......##."),
list("##...###.."),
list("...##....#"),
list(".##.#....."),
list("###..##..#"),
list("####.##.#."),
],
2111: [
list("..#.#..#.."),
list("...#.....#"),
list("..####...#"),
list(".#.#..##.#"),
list(".##..#.##."),
list("........##"),
list("........##"),
list("#..#.#...."),
list("...#.###.."),
list(".#.#...#.."),
],
2767: [
list(".#######.."),
list("##.......#"),
list("#...#.##.."),
list("....#...##"),
list("#........#"),
list("..#.###..."),
list("....#..#.#"),
list("##....#.##"),
list("..##....##"),
list(".#####.#.."),
],
2141: [
list("####.#...."),
list("#..#.#...#"),
list("...#..#..#"),
list(".......#.."),
list(".....###.#"),
list("#....#...."),
list(".......#.#"),
list(".#...#..##"),
list("...#......"),
list(".###.####."),
],
2557: [
list(".#.##..#.."),
list("..##.....#"),
list("#.#.#....#"),
list("..##...#.."),
list("...#..##.#"),
list(".........."),
list("##......##"),
list("#..#......"),
list("#.#..#...#"),
list("##.#####.."),
],
2269: [
list(".#.#...##."),
list("#.......##"),
list("#.....##.."),
list("##.#......"),
list("#.##..###."),
list(".#.....##."),
list("....#....#"),
list("....#...##"),
list("#..##....."),
list("#.#.#.#.##"),
],
3511: [
list(".#.#.##..."),
list(".#.....##."),
list(".#....#..#"),
list("#.#......#"),
list("#.#.#....."),
list("#........#"),
list("..#......."),
list(".##.#....."),
list("##.#.....#"),
list("..####..##"),
],
2789: [
list("#......#.."),
list("#...#....."),
list("#........."),
list(".......#.#"),
list("...#....##"),
list("#.##..###."),
list("#...##...#"),
list(".........#"),
list(".........#"),
list(".###..##.."),
],
2971: [
list("#.##.#...."),
list("...#.....#"),
list(".#....#..."),
list("#.#..##..."),
list("#.....#..."),
list("####.....#"),
list("#..###..##"),
list("#....#...."),
list("#..#.##..."),
list("#.#..###.."),
],
3719: [
list("#.###....."),
list("...#.....#"),
list("...##...##"),
list(".#..#.#..#"),
list("#..#.#..#."),
list("#.#..#..##"),
list("#...###..#"),
list(".#.#..#.##"),
list("........#."),
list("#....###.."),
],
1901: [
list(".#...##.##"),
list("#........."),
list(".#.#.....#"),
list("#.##.....#"),
list("#........#"),
list("#....#...#"),
list(".....##.##"),
list("##.###..##"),
list("....#....#"),
list("....##..##"),
],
3191: [
list("#.#..###.#"),
list("#...#..##."),
list("#.....#..."),
list(".#.#.#...."),
list(".#..##...."),
list("#.....#.#."),
list(".##......."),
list("....#....#"),
list("#..##.#..."),
list("####....##"),
],
3709: [
list("..#......#"),
list("#..#...#.#"),
list("#.##....#."),
list(".#..#.##.."),
list("..#......#"),
list("#....##..."),
list("##........"),
list("....#....#"),
list(".........#"),
list(".#.#..###."),
],
1613: [
list("...##..##."),
list("#......#.."),
list("..##.#..##"),
list("......##.."),
list(".#..#..##."),
list(".......##."),
list(".......#.#"),
list("...#.#...."),
list("#......#.#"),
list("###..#...."),
],
2441: [
list("..#.######"),
list("#.#......."),
list("#..#.#...."),
list("....#...##"),
list("#...#...##"),
list("#.##...#.#"),
list("........##"),
list("#.#...#..."),
list("#..####.##"),
list("#.##.####."),
],
1409: [
list("..####.#.#"),
list("..##....#."),
list("..#.#...#."),
list("..##.##..."),
list(".#.##....#"),
list("#.....##.#"),
list("####.....#"),
list("###....#.."),
list("####..#.#."),
list("#..##.##.#"),
],
1523: [
list(".#.##..##."),
list("#..#.#...."),
list("##.#.#...#"),
list("....#.##.#"),
list("#........#"),
list("#.#......."),
list("#...##...#"),
list("...#..##.#"),
list("#.##...#.."),
list(".####..#.."),
],
1367: [
list("#..#...#.#"),
list("#.#......."),
list("..#..#...."),
list(".###..###."),
list("###..#.##."),
list("##...#..#."),
list("#..#...#.#"),
list("......##.."),
list("##.....#.#"),
list(".#####..##"),
],
1783: [
list("...#.####."),
list(".####..#.."),
list("#....#.###"),
list("#.#..#.#.#"),
list("#.#.#.#..#"),
list("#.......##"),
list("#.##.#.#.."),
list(".#.#....#."),
list("#..#.#...#"),
list(".###..##.#"),
],
1871: [
list(".##..#.##."),
list("#........#"),
list("#...#....#"),
list("##.#..##.."),
list("##.....##."),
list("#.....#.##"),
list("........##"),
list("....#....#"),
list("#........."),
list("....#.#..#"),
],
3217: [
list("#.#...#.##"),
list(".........#"),
list(".........#"),
list("#...#....."),
list("#....#.#.#"),
list(".........#"),
list("...#.##.##"),
list("#...#....."),
list(".#..#....#"),
list("#..###.#.#"),
],
3163: [
list("...##.#.##"),
list("#.#......#"),
list("....#...##"),
list("#.......##"),
list("###..#.#.."),
list(".#....####"),
list("##....#.##"),
list("#.......#."),
list(".....#..#."),
list(".##.#.#.##"),
],
3271: [
list("##.#.#.##."),
list("##....##.#"),
list("#.#.##..##"),
list("#.#...##.#"),
list(".##......#"),
list("#.....#.#."),
list("#........#"),
list("##..##...."),
list("#.#..##..#"),
list("#..#.####."),
],
2707: [
list("..###.#..."),
list("#...#....."),
list("#.#..#...."),
list("#..##...##"),
list(".###......"),
list(".#..##...#"),
list("#...#....."),
list("....#....."),
list("#..#.#...."),
list(".##....#.#"),
],
3083: [
list("##..#.#.##"),
list("#..#....##"),
list(".........#"),
list("..#.#...##"),
list("..#......."),
list(".#.#.....#"),
list("..#..#.#.."),
list("#...#.#..#"),
list("#..#.#...."),
list("#.###..##."),
],
1051: [
list("####...##."),
list("...#.#...#"),
list(".........."),
list("..#......."),
list("#......#.."),
list(".#.##.##.."),
list("#....#.#.#"),
list("#..#.#...#"),
list("#.#..##..#"),
list("......###."),
],
3767: [
list(".#..##.###"),
list("...#.#...."),
list("..#.....#."),
list("#.#......."),
list(".#.....#.#"),
list("##..#....#"),
list("#...#..#.#"),
list("........##"),
list("#........#"),
list("..#....##."),
],
2267: [
list(".#..#..#.."),
list(".#.#.#...."),
list(".#......#."),
list("#...#....#"),
list(".###..#..."),
list(".##.#...##"),
list("..#.##.##."),
list("...#.#.##."),
list("##.#.##..#"),
list(".#.##....."),
],
1973: [
list("#.#####..#"),
list(".#.......#"),
list("#..#.#..#."),
list("#.#.#.#.#."),
list(".##......."),
list("#.#.....#."),
list(".#.......#"),
list("#...##.#.#"),
list("##.......#"),
list(".##...####"),
],
3671: [
list("#..##.#.##"),
list("....##...#"),
list(".###.##..."),
list(".........#"),
list("#..#.....#"),
list("..##...#.."),
list("......#..."),
list("..#..#..##"),
list("..#......."),
list("##..###..#"),
],
3221: [
list("#.#..###.#"),
list("#..#....##"),
list("#..#......"),
list("#...#...##"),
list("..#..#..#."),
list("#..##...#."),
list("...#....#."),
list(".....#..#."),
list("##..#..#.."),
list(".....#...#"),
],
1549: [
list(".###.##..#"),
list("#.#.##...#"),
list("#....#...."),
list(".........."),
list("#.#......#"),
list("##.#.#..##"),
list("...#.#..##"),
list("........#."),
list("#.#....###"),
list("#....#...#"),
],
3461: [
list(".######..#"),
list("#.......##"),
list(".......#.."),
list(".#...#...."),
list("..##....#."),
list("#.....##.."),
list("##.#.#..#."),
list(".........#"),
list("##.##.#..."),
list("....#...##"),
],
2459: [
list("..##.##.#."),
list("...#..#..."),
list(".........#"),
list("#.#..#..##"),
list("#.###.#..."),
list("##.#......"),
list(".......#.."),
list(".........#"),
list("........##"),
list("#.##...#.."),
],
3203: [
list(".#...####."),
list("..##..#.#."),
list("#..#..##.."),
list("#.#....##."),
list("...#.#...."),
list(".......###"),
list("#.....##.."),
list("....#....#"),
list("#......#.."),
list("###......."),
],
2203: [
list("#.#..##.##"),
list(".......#.."),
list("......#.##"),
list("#.......##"),
list("#..##.##.#"),
list("..#.....##"),
list("#.##.....#"),
list("#.#....#.."),
list(".##.....##"),
list("......#..."),
],
3637: [
list("#...###.#."),
list("#........."),
list("..#......."),
list("...#.....#"),
list("#..##....#"),
list("#........#"),
list(".......#.."),
list("#....#.#.."),
list("#.#..##..#"),
list("..#.#..##."),
],
2467: [
list("..##.##..."),
list("##....####"),
list("...#.#.#.#"),
list("#.##...#.#"),
list("...##.##.."),
list("#.....#..."),
list("##........"),
list("..#...#.#."),
list("#...####.#"),
list("#......###"),
],
2411: [
list("...##....#"),
list("...##..###"),
list("...##.####"),
list("#.#..##.#."),
list("..##.#.###"),
list(".#..#.###."),
list("....####.#"),
list(".....##.#."),
list("#........."),
list(".#..#..###"),
],
2221: [
list("####.....#"),
list("#.#.....##"),
list(".#....#..."),
list(".#.#......"),
list(".##..#..#."),
list("....#....."),
list(".........#"),
list("##.......#"),
list("#....#...."),
list(".##.######"),
],
1487: [
list("..#..##..."),
list(".........#"),
list("#..#...###"),
list("....#...#."),
list(".#...##.#."),
list(".....#.#.#"),
list(".....##..."),
list("#.##......"),
list("#.#......."),
list("#.#####.#."),
],
1481: [
list("#.###.##.."),
list("....##...#"),
list("....#....."),
list("...#......"),
list("##.###.#.#"),
list("#.##..####"),
list("..#......#"),
list(".#....##.#"),
list("..##.##.#."),
list(".#####.#.#"),
],
1669: [
list("#...##.##."),
list("...#..#..."),
list(".##..#.#.#"),
list("#..#..#..#"),
list("#......#.#"),
list(".#......##"),
list("........#."),
list("......#..#"),
list(".##..#.#.#"),
list("##.##....#"),
],
3167: [
list(".#.####..."),
list(".........#"),
list("#......##."),
list(".....#...."),
list("..#.#...##"),
list("#.#.####.#"),
list("...#....#."),
list(".........#"),
list("#...#.#..#"),
list("#.#.#.#.#."),
],
3347: [
list("###...##.."),
list("#.#......#"),
list("...#.....#"),
list(".........."),
list("#.#.....#."),
list("..####..##"),
list("..#.#.#..#"),
list("##...#..#."),
list("..##.....#"),
list("#..#....#."),
],
2213: [
list("#..#####.#"),
list(".........."),
list("#..#.##.#."),
list("...###.#.#"),
list("......##.."),
list("......#..#"),
list(".##.....##"),
list("..#....###"),
list("...####..#"),
list(".####.#.##"),
],
3329: [
list("..##...#.."),
list("#.#....#.#"),
list("#...#..#.."),
list("......#.##"),
list("#...####.#"),
list(".........."),
list("##....##.#"),
list("#......##."),
list("....##...#"),
list("..####.##."),
],
3851: [
list("#.#....##."),
list(".........#"),
list("#.....#..."),
list("##.##....."),
list("...#.###.."),
list("#....##..."),
list(".....#.##."),
list(".#........"),
list("#......#.#"),
list("...#..#..#"),
],
2659: [
list("#.#...#.#."),
list(".....#.##."),
list("#..##.####"),
list("#.#.##...."),
list("#....#..#."),
list("...#...#.."),
list("...#....#."),
list("#....#.#.."),
list(".##.#....#"),
list(".....#..#."),
],
1933: [
list(".####.##.."),
list("#..####..."),
list(".#..####.."),
list(".#.#.##..."),
list("......#.#."),
list("##........"),
list(".#.#.....#"),
list("#..#......"),
list("....#....."),
list("...#...##."),
],
3299: [
list("###.##..#."),
list(".......#.."),
list("...#...##."),
list("###...#.##"),
list("......##.."),
list("....#.#..#"),
list(".###......"),
list(".#.#####.."),
list("#..#.#..#."),
list(".....#.#.#"),
],
3691: [
list("...###...#"),
list("#........."),
list("#.#.....##"),
list("#.#....#.."),
list("#..#...#.."),
list(".........."),
list("##...##..#"),
list(".#...#...#"),
list("#.....#.##"),
list(".###..#..."),
],
3733: [
list("#..#.#####"),
list(".....#...."),
list("....###..#"),
list("#..#.#...."),
list("#.#..#.###"),
list("..###...##"),
list("......#.##"),
list("...###...."),
list("...#....#."),
list("..##......"),
],
2131: [
list("##.#..#.#."),
list(".#...#..##"),
list("#.......#."),
list("....##...#"),
list(".###..#..."),
list("...#####.."),
list(".....#...#"),
list("##..#..##."),
list("..##....#."),
list(".#...####."),
],
1723: [
list(".....#####"),
list(".#.#..#..."),
list("##......#."),
list("#.......##"),
list(".###...#.."),
list("#..#......"),
list("#........."),
list("......#..#"),
list(".........#"),
list(".###.##.##"),
],
3463: [
list("##.#....##"),
list("#....##..#"),
list("..#.#....."),
list("#.#...#..#"),
list("#....#...."),
list("..#....#.#"),
list("#...#..###"),
list("##....#.##"),
list("..#.#....."),
list(".#..#.##.."),
],
2549: [
list("#.####.#.."),
list("...##....#"),
list("##..#.##.#"),
list("..###.#..#"),
list("#.#......#"),
list("#........#"),
list("....#....."),
list("#......#.#"),
list("#....####."),
list("...##.#.##"),
],
1031: [
list("#..#.#.#.#"),
list("......##.."),
list("#........#"),
list(".###......"),
list("..#..#..#."),
list("##....##.."),
list("......#..."),
list("...#...###"),
list(".###...#.."),
list(".##.#.###."),
],
1979: [
list("#.######.."),
list(".#.#.....#"),
list("#........#"),
list("#..##....."),
list("##........"),
list("##.....#.."),
list("......#..."),
list(".........#"),
list(".#........"),
list("..#.#####."),
],
2939: [
list("#.#...#.##"),
list(".#..#....#"),
list(".#.....#.#"),
list("##......##"),
list("...#..##.."),
list("#....#.##."),
list("#...##.#.#"),
list("..#...#..."),
list("##.....#.."),
list(".....##.#."),
],
2381: [
list("..##.###.#"),
list("..##...#.."),
list(".#...#...."),
list("#......#.#"),
list("##.......#"),
list("#..####..."),
list("...#.#.#.#"),
list("#.##.....#"),
list("..#......#"),
list("#..#.##..."),
],
3943: [
list("#.#.###..#"),
list(".......###"),
list("#.#...###."),
list("#..##.#..#"),
list("#......#.."),
list("#.##...#.#"),
list("#........."),
list("##....##.#"),
list("....#.#..."),
list(".###.#...."),
],
1553: [
list("#####.####"),
list("#...#....."),
list("#.#.....#."),
list("##......#."),
list("#....#.#.."),
list(".#.....#.#"),
list("##....#.#."),
list("#........#"),
list(".........#"),
list(".#.....##."),
],
2351: [
list(".###.###.."),
list("#.....#..."),
list("##.##....#"),
list("..#..##.#."),
list("#.#......."),
list("#....#...."),
list("......##.#"),
list("##...##..#"),
list(".#.....#.."),
list(".#.###..#."),
],
2311: [
list("#.#.#..##."),
list("#..###.#.."),
list("...##..#.#"),
list("###......."),
list("##........"),
list("#.#......."),
list("..##.....#"),
list(".#.####..."),
list("..#.#.#..."),
list("###..##.#."),
],
1567: [
list("..###.#.##"),
list(".#.....###"),
list("#...#..##."),
list("#.......#."),
list(".......#.."),
list("#....#...."),
list("...#.##.#."),
list("....#...##"),
list("....#....#"),
list("#.#...##.."),
],
2579: [
list("#.##..##.."),
list("#......#.."),
list("#..#..#..#"),
list("##.......#"),
list("....##.#.#"),
list("#.####..#."),
list("#..#..#.##"),
list("#...#..#.#"),
list("...##...#."),
list("#..#.###.."),
],
3593: [
list(".#.##.#.##"),
list("#...#....#"),
list(".........."),
list("##....#..#"),
list("##......##"),
list("#........."),
list("......#..#"),
list("...#.....#"),
list("....#....#"),
list("##..###..#"),
],
2281: [
list("##....###."),
list("...#......"),
list("#......#.#"),
list("##.#..#..#"),
list("###.#..##."),
list(".#...#...#"),
list(".........."),
list(".#.###.#.."),
list("#..#......"),
list("#..#.##.#."),
],
1193: [
list(".......###"),
list("##..#..#.."),
list(".###...###"),
list("....#.###."),
list("..#...#..#"),
list("#.#....#.."),
list("...####..#"),
list("#....#..##"),
list(".#.......#"),
list(".#.#...##."),
],
3833: [
list("...#####.."),
list("#..####..."),
list("#.#....###"),
list("...##.#.##"),
list("..#...#..#"),
list(".##.#####."),
list("#..#..#..#"),
list("#...##...."),
list(".....#.#.."),
list(".##.##.#.#"),
],
2003: [
list(".#.###.#.."),
list(".........#"),
list("..#..#...."),
list("#........."),
list("#..##....#"),
list(".......#.#"),
list("......#..."),
list("#....##..#"),
list(".#......##"),
list("..#..##.#."),
],
2731: [
list("#.#..#..##"),
list("....#..#.#"),
list("..#...#..."),
list("..#..#...."),
list("#.#..#...#"),
list("#....##..."),
list("#........."),
list("#..##..#.#"),
list("#........."),
list(".###.#...."),
],
3881: [
list("..##......"),
list("#...#..#.#"),
list("##...#...."),
list("....#....."),
list("##.......#"),
list(".....#####"),
list("...#....##"),
list(".........#"),
list(".........."),
list("#..##.####"),
],
3673: [
list("##..###.#."),
list("...##....#"),
list("###.....##"),
list("#..#...#.#"),
list("#.##......"),
list("..#.#....."),
list("..#.#....#"),
list(".###.....#"),
list(".###.##..."),
list("###.#..#.#"),
],
1021: [
list("#..###.#.."),
list("###..##.#."),
list("#..##....#"),
list(".....###.."),
list("....##...#"),
list("....#....."),
list("#.##..#..#"),
list(".........."),
list(".......#.#"),
list("..#.##..#."),
],
2423: [
list("#.....####"),
list(".##.#....#"),
list(".#........"),
list("##.....#.."),
list("#.....###."),
list("#...#...#."),
list("#...#..#.#"),
list(".#..#..##."),
list("##.......#"),
list(".#####.###"),
],
3923: [
list("..#....###"),
list("#.....#..#"),
list("#...#.#.#."),
list(".#.......#"),
list("#..#.#...."),
list(".......#.#"),
list("##....##.#"),
list(".#..#...#."),
list("#...##..#."),
list("..#.#.#..#"),
],
2753: [
list("..####..#."),
list("#.......#."),
list("#.##.#..##"),
list("#.#.#....."),
list("#..#......"),
list("....#.#..."),
list(".#.#..#..#"),
list("#.....#..#"),
list("##.#..#..."),
list("#####....#"),
],
3929: [
list("....#####."),
list("##..#.##.."),
list("##.#.#.##."),
list("##...#.#.."),
list("#........#"),
list(".##.#..#.."),
list("#..#.##..."),
list("##..#...#."),
list(".....#...#"),
list("###..####."),
],
3041: [
list(".##.#..#.#"),
list("#..#...#.."),
list("###..#..#."),
list(".#.#....##"),
list("...##....."),
list("#....#..##"),
list("#........#"),
list("##.#...#.."),
list("##....#..#"),
list("...#..#..#"),
],
3433: [
list("..#.#.#..."),
list("#.#......."),
list(".....#...."),
list("..#......#"),
list("#..#.....#"),
list("........##"),
list("##..##.##."),
list("##........"),
list("#.#.##..##"),
list("###.###..#"),
],
2719: [
list("..##..#..#"),
list("#.##..##.."),
list("#......#.."),
list("#...##..##"),
list("..#..#.#.#"),
list("#......###"),
list("..###..#.."),
list("....#.#..#"),
list("....##...#"),
list("##..#..###"),
],
1201: [
list(".#...##.##"),
list("#........#"),
list("##...##..."),
list(".........."),
list(".....#.#.."),
list("#.##.....#"),
list("...#.##..#"),
list(".........#"),
list(".#.#.....#"),
list(".##...#..."),
],
1129: [
list("...####..#"),
list("......##.."),
list("#.....##.."),
list("#.......#."),
list("#......#.."),
list("...##....#"),
list("........##"),
list("##.#.#.#.."),
list("...#..##.#"),
list("...##....#"),
],
3019: [
list("..#...###."),
list(".....#.##."),
list("#.##.....#"),
list(".#.##..#.."),
list(".#..###..#"),
list("..#.####.#"),
list("#..#.#...#"),
list(".......#.#"),
list("#..##.#..#"),
list("#.##....##"),
],
1747: [
list("##.###.#.."),
list("#.......#."),
list("#...#..#.#"),
list("##...##.#."),
list("..###.#..#"),
list("#..#..##.."),
list("#...#....."),
list("..#......."),
list("...#..#.#."),
list(".##..##.##"),
],
1741: [
list(".##.#..#.#"),
list("#...##..##"),
list("#....#.#.#"),
list("##...##..#"),
list("##.......#"),
list("#...#..##."),
list("...#.##.##"),
list("...#..#.#."),
list(".......#.#"),
list(".#####.###"),
],
1867: [
list("#..##....."),
list(".......###"),
list("#..##....#"),
list("##...#...."),
list("...###...."),
list("##..#....."),
list(".##......."),
list("#.....###."),
list("#...#..#.#"),
list("...###...."),
],
2803: [
list(".#.##....#"),
list("#.####..#."),
list("#........."),
list("#.#......#"),
list(".......#.#"),
list("........#."),
list("..#..#.#.#"),
list("....###..."),
list("#...##...."),
list("...###...."),
],
3643: [
list("#..#..#.##"),
list("####.#..#."),
list("#.#...#.##"),
list(".#..#....."),
list("##....#..#"),
list(".##......."),
list(".......#.#"),
list("...##.#..."),
list(".....#.##."),
list("#...####.#"),
],
2437: [
list("..###..###"),
list("....#....."),
list(".........."),
list("#.#..#.###"),
list("##...####."),
list("....##...."),
list("...##....."),
list("##..#.##.."),
list("#......#.."),
list("#.#.....#."),
],
1069: [
list("..####...."),
list("##..##...#"),
list(".#..#..##."),
list(".#....##.#"),
list("###.#.#.##"),
list("...##..#.#"),
list("##....#..."),
list("#.#....#.#"),
list(".#.....#.#"),
list("#.#.#....."),
],
1381: [
list(".###.#.##."),
list("....#..#.."),
list("#.......##"),
list("#...#....."),
list(".#...#..##"),
list("...#....##"),
list("#..#.###.."),
list("..######.#"),
list("#....#...#"),
list("#######.#."),
],
2617: [
list("..##..#.#."),
list("#.....##.#"),
list("..#.#..#.."),
list(".##.#..#.."),
list("###...#.#."),
list(".###.##..."),
list("#.#......."),
list("#..##.#..#"),
list("##.....#.."),
list(".##..#..##"),
],
2393: [
list(".##..#.#.#"),
list("..#.#..###"),
list("..##..#.##"),
list("....#....."),
list("#...#....."),
list("##.#.....#"),
list(".#.#..#.#."),
list("##.....#.."),
list(".......#.#"),
list("####..#..."),
],
3529: [
list("#.#...##.#"),
list("......#..#"),
list(".........#"),
list("#.....#..."),
list(".......#.."),
list(".....#.#.#"),
list(".....#...."),
list("#....#.#.#"),
list("....#.##.#"),
list(".####.#..#"),
],
2953: [
list("...##...#."),
list("##.#.#..##"),
list("#...#....."),
list("##.#...###"),
list("...#......"),
list("#.#.#..#.#"),
list(".#...#...#"),
list("##....#.##"),
list(".......#.."),
list(".#.#..#..."),
],
3617: [
list("#..##...##"),
list("......#..."),
list("#....#...."),
list(".........."),
list(".######.##"),
list("##..#.#.##"),
list("#.#...#..."),
list("........#."),
list(".######.##"),
list("##...###.#"),
],
3863: [
list(".##.#...##"),
list("#...#....."),
list("..#.#....#"),
list("#....#..##"),
list(".....###.."),
list("#.#......#"),
list("#.......#."),
list("...#.....#"),
list("#........."),
list("..###....#"),
],
3727: [
list("#.###.##.#"),
list(".........."),
list("...##....."),
list("..#..#..##"),
list("#......###"),
list("#....##..."),
list("###.##...."),
list(".....#...."),
list("##.####.#."),
list("#..#.#.###"),
],
3803: [
list("###..#.##."),
list(".##......#"),
list(".........#"),
list("###.....##"),
list("....###..#"),
list(".......#.#"),
list("........##"),
list("#..#......"),
list("##......##"),
list("#.###..#.."),
],
1579: [
list("#...##.###"),
list(".....#.###"),
list(".##...#..."),
list("#.#..#..#."),
list("..##.....#"),
list(".........#"),
list(".........."),
list("#.....#.##"),
list(".....#...."),
list(".###..#..."),
],
1049: [
list("#..#.##.##"),
list("##......##"),
list("..#.##...#"),
list("#.......#."),
list("###.....#."),
list(".....#.#.#"),
list("...#......"),
list("..##......"),
list("#.#....#.."),
list("##..#.#..."),
],
2687: [
list("##..#.##.."),
list(".#........"),
list("##..#...#."),
list(".#.#.....#"),
list(".#..#.#..#"),
list("#.###..#.."),
list("..#......#"),
list("#.......##"),
list("#..#.....#"),
list("#.##.#..##"),
],
1637: [
list("#..##...##"),
list("##..#....#"),
list("...#....#."),
list("#....#...."),
list(".....#...#"),
list("#...#...##"),
list(".#....#..."),
list("#........."),
list("..#....#.."),
list(".#.####..."),
],
3527: [
list(".#....#.#."),
list("#.......#."),
list("..#....#.#"),
list("####.#.#.#"),
list("...#..#..."),
list("###..#.###"),
list("##..#....#"),
list("#.##....##"),
list("..#......#"),
list(".....#.#.."),
],
2963: [
list("#.#.#.#.#."),
list("#.....#..."),
list("##.#.....#"),
list("..##......"),
list("..#......."),
list(".#...#.##."),
list("###......#"),
list("##....#..#"),
list(".#...#..##"),
list("..##..##.#"),
],
2287: [
list("##.######."),
list(".#.##.##.."),
list("#..#....##"),
list("##.#.#...#"),
list(".......##."),
list("#...##...#"),
list("...##..#.."),
list("##....#.#."),
list("....#.##.."),
list("..#.#..###"),
],
3677: [
list("###.....##"),
list("#..#.#..#."),
list("#.#......."),
list(".....#..##"),
list(".........."),
list("......#.##"),
list(".....#..#."),
list("#..#...#.."),
list(".##......#"),
list("#...##.##."),
],
3559: [
list("..#..#.##."),
list("###......#"),
list("..#.##...."),
list("#.#..#...."),
list("##..##..##"),
list("..#...#.#."),
list("#.....#.##"),
list("....#....#"),
list("...#.#...#"),
list("...#.###.."),
],
2837: [
list("..#...#..."),
list(".....##..."),
list("#.#..#...#"),
list("....#....#"),
list("...####.##"),
list("#........."),
list("...#...##."),
list(".#..###.#."),
list("....#....."),
list(".###.##.#."),
],
3539: [
list("..##....#."),
list("........#."),
list("......#..#"),
list("...#..#..."),
list("###....###"),
list("#...#....."),
list(".#........"),
list("#.....#..."),
list("..##.#..#."),
list("..###..#.#"),
],
1667: [
list(".#..####.."),
list(".....#...."),
list("......#..."),
list("#.#...##.#"),
list("#...#.#..#"),
list("##.#.#...#"),
list("##..#..#.."),
list("#...##...#"),
list(".#..###..."),
list("..#..####."),
],
2791: [
list("#.##.###.#"),
list("...#..#..."),
list("##.....###"),
list("...#.#..##"),
list(".........#"),
list(".###...#.."),
list("...#.....#"),
list("##.....##."),
list("###......."),
list("#..#.#...."),
],
2609: [
list("..##.#...."),
list("##.#.#...#"),
list("#.#..#...."),
list("#........."),
list("...#..#..#"),
list("#...#.#..."),
list("##.##....#"),
list(".###......"),
list("##.....##."),
list("#.#...#.#."),
],
3061: [
list("####..#.##"),
list("#.....##.."),
list(".........."),
list("......#..."),
list("..#.#..###"),
list(".#.#..#..#"),
list(".#...#...#"),
list("#........#"),
list(".....#.#.."),
list("#..#....##"),
],
}
|
input = {2647: [list('#....#####'), list('.##......#'), list('##......##'), list('.....#..#.'), list('.........#'), list('.....#..##'), list('#.#....#..'), list('#......#.#'), list('#....##..#'), list('...##.....')], 1283: [list('######..#.'), list('#.#..#.#..'), list('..#..#...#'), list('.#.##..#..'), list('#......#..'), list('#.#....##.'), list('.#.....#.#'), list('#.#..#.#.#'), list('.#......##'), list('...##.....')], 3547: [list('#.#.#.###.'), list('#.........'), list('#....##...'), list('#.....#..#'), list('#.....#.#.'), list('##..##...#'), list('#...##....'), list('......#..#'), list('#...##....'), list('.....###.#')], 1451: [list('##..#.#...'), list('#.#.......'), list('##.#.....#'), list('....#.....'), list('...#...##.'), list('......#.#.'), list('#...##.##.'), list('........#.'), list('.#.##.#...'), list('..##..#...')], 3137: [list('....#.##.#'), list('#....#...#'), list('..#.#.....'), list('...####..#'), list('.#.###...#'), list('.......#..'), list('##.##.#..#'), list('.#.##....#'), list('#...#....#'), list('..##.##..#')], 2897: [list('###..#.##.'), list('..#......#'), list('.....#....'), list('###.#....#'), list('#.#..#...#'), list('.#...##..#'), list('##..##.##.'), list('#.....#..#'), list('.#......##'), list('#.#.#.##.#')], 1093: [list('..#.#.#.#.'), list('#.#.......'), list('..##....#.'), list('.#.....#.#'), list('#........#'), list('.#....#..#'), list('##....#..#'), list('#.##..#..#'), list('..###...##'), list('.######.##')], 1217: [list('#..#....##'), list('#.....#...'), list('##...##..#'), list('#.....#...'), list('..#.#..#..'), list('#..#....##'), list('.##.#.....'), list('......#...'), list('.#........'), list('.#..###.#.')], 2801: [list('###..##.#.'), list('.........#'), list('##.#...###'), list('#......#..'), list('#........#'), list('......#...'), list('##.####...'), list('.....##...'), list('..#..#.##.'), list('...###.##.')], 1361: [list('...#.##..#'), list('....#.....'), list('###.......'), list('#......#..'), list('.......##.'), list('#...#..#..'), list('#.....##.#'), list('##........'), list('#.#.......'), list('###.#..###')], 2063: [list('...#....##'), list('##...#..##'), list('#........#'), list('........##'), list('#.......##'), list('#.........'), list('##.....##.'), list('.....##..#'), list('.#.##.#...'), list('.#..#####.')], 3797: [list('##..#...#.'), list('.###.#.##.'), list('.....#.##.'), list('..#.......'), list('...#.#....'), list('........##'), list('#.#.#.##.#'), list('#.....#.##'), list('#.......#.'), list('.....#.##.')], 1289: [list('####.##.#.'), list('.....#....'), list('#..#.#....'), list('####...#..'), list('#.#..#..#.'), list('.#.##..#..'), list('#........#'), list('....#..#..'), list('........#.'), list('###.#.####')], 1427: [list('##.##..##.'), list('###..#.##.'), list('#..##...#.'), list('#..#.#...#'), list('#........#'), list('#...##....'), list('#........#'), list('.....#..#.'), list('.####....#'), list('##.#.##.#.')], 1951: [list('....##.#.#'), list('.........#'), list('#........#'), list('.#..#...#.'), list('.....#####'), list('#......#.#'), list('...##....#'), list('......#...'), list('..#...#..#'), list('....####.#')], 1483: [list('....####..'), list('.......#.#'), list('###..#..##'), list('...#.#...#'), list('#..##...##'), list('##.#......'), list('#...#..#..'), list('..#...#.##'), list('.........#'), list('.#...#....')], 1789: [list('##..#####.'), list('....#....#'), list('........#.'), list('..#.#..#.#'), list('..##.#..##'), list('.........#'), list('.........#'), list('#..#.#..##'), list('....##....'), list('#.#.......')], 2129: [list('#.###.#..#'), list('....##...#'), list('.#..#..##.'), list('...###.##.'), list('..#..#...#'), list('....##...#'), list('#.........'), list('#...#..###'), list('#...#.....'), list('...#....##')], 2137: [list('..#.####.#'), list('##...#.#..'), list('.......###'), list('.#.....#.#'), list('.#....##.#'), list('#.......#.'), list('#....#...#'), list('#.....####'), list('......##.#'), list('..#####.##')], 3761: [list('.####.#...'), list('####..#..#'), list('#...##..##'), list('.#.....#.#'), list('....#....#'), list('#.......#.'), list('...#..#..#'), list('#.##...##.'), list('...###...#'), list('...##.#..#')], 1327: [list('..####.#.#'), list('#..#......'), list('......#.##'), list('#..##.....'), list('..##.##..#'), list('#.#.#.....'), list('####.....#'), list('..#.......'), list('#.#...##..'), list('#.##....#.')], 2741: [list('.#..#...#.'), list('#....#..#.'), list('......##.#'), list('....#.#..#'), list('........##'), list('...#..#...'), list('......##..'), list('#...#..#.#'), list('......##..'), list('..#..#..#.')], 1699: [list('.###..####'), list('##.....#.#'), list('.....##.##'), list('#.#...##..'), list('.#........'), list('.#....#..#'), list('#..#....#.'), list('.#...#...#'), list('#.......#.'), list('##.#..#..#')], 1151: [list('..#.##....'), list('##....#...'), list('###.#..#.#'), list('#.......##'), list('....#.#..#'), list('#...###...'), list('.#..#.#..#'), list('#.#..##..#'), list('.#.#.#.#..'), list('.###..####')], 2273: [list('#.#.#.#.##'), list('..........'), list('#......#..'), list('#.....#...'), list('#.#...#...'), list('##....##..'), list('##..##.#..'), list('#.#####.##'), list('##.##...##'), list('#...##..##')], 1999: [list('##.##...##'), list('#......#..'), list('##..#.....'), list('#........#'), list('#.#...####'), list('..#....#.#'), list('#..#...#..'), list('.........#'), list('#...##....'), list('##.##.##..')], 1721: [list('....##...#'), list('###.#....#'), list('.##..#....'), list('.#.#.#....'), list('...##....#'), list('##..#....#'), list('#....#.###'), list('#.....##..'), list('....#...##'), list('..#.#.#..#')], 2521: [list('..#######.'), list('#.#..##.#.'), list('.#....##.#'), list('..#...####'), list('.......##.'), list('##...###..'), list('...##....#'), list('.##.#.....'), list('###..##..#'), list('####.##.#.')], 2111: [list('..#.#..#..'), list('...#.....#'), list('..####...#'), list('.#.#..##.#'), list('.##..#.##.'), list('........##'), list('........##'), list('#..#.#....'), list('...#.###..'), list('.#.#...#..')], 2767: [list('.#######..'), list('##.......#'), list('#...#.##..'), list('....#...##'), list('#........#'), list('..#.###...'), list('....#..#.#'), list('##....#.##'), list('..##....##'), list('.#####.#..')], 2141: [list('####.#....'), list('#..#.#...#'), list('...#..#..#'), list('.......#..'), list('.....###.#'), list('#....#....'), list('.......#.#'), list('.#...#..##'), list('...#......'), list('.###.####.')], 2557: [list('.#.##..#..'), list('..##.....#'), list('#.#.#....#'), list('..##...#..'), list('...#..##.#'), list('..........'), list('##......##'), list('#..#......'), list('#.#..#...#'), list('##.#####..')], 2269: [list('.#.#...##.'), list('#.......##'), list('#.....##..'), list('##.#......'), list('#.##..###.'), list('.#.....##.'), list('....#....#'), list('....#...##'), list('#..##.....'), list('#.#.#.#.##')], 3511: [list('.#.#.##...'), list('.#.....##.'), list('.#....#..#'), list('#.#......#'), list('#.#.#.....'), list('#........#'), list('..#.......'), list('.##.#.....'), list('##.#.....#'), list('..####..##')], 2789: [list('#......#..'), list('#...#.....'), list('#.........'), list('.......#.#'), list('...#....##'), list('#.##..###.'), list('#...##...#'), list('.........#'), list('.........#'), list('.###..##..')], 2971: [list('#.##.#....'), list('...#.....#'), list('.#....#...'), list('#.#..##...'), list('#.....#...'), list('####.....#'), list('#..###..##'), list('#....#....'), list('#..#.##...'), list('#.#..###..')], 3719: [list('#.###.....'), list('...#.....#'), list('...##...##'), list('.#..#.#..#'), list('#..#.#..#.'), list('#.#..#..##'), list('#...###..#'), list('.#.#..#.##'), list('........#.'), list('#....###..')], 1901: [list('.#...##.##'), list('#.........'), list('.#.#.....#'), list('#.##.....#'), list('#........#'), list('#....#...#'), list('.....##.##'), list('##.###..##'), list('....#....#'), list('....##..##')], 3191: [list('#.#..###.#'), list('#...#..##.'), list('#.....#...'), list('.#.#.#....'), list('.#..##....'), list('#.....#.#.'), list('.##.......'), list('....#....#'), list('#..##.#...'), list('####....##')], 3709: [list('..#......#'), list('#..#...#.#'), list('#.##....#.'), list('.#..#.##..'), list('..#......#'), list('#....##...'), list('##........'), list('....#....#'), list('.........#'), list('.#.#..###.')], 1613: [list('...##..##.'), list('#......#..'), list('..##.#..##'), list('......##..'), list('.#..#..##.'), list('.......##.'), list('.......#.#'), list('...#.#....'), list('#......#.#'), list('###..#....')], 2441: [list('..#.######'), list('#.#.......'), list('#..#.#....'), list('....#...##'), list('#...#...##'), list('#.##...#.#'), list('........##'), list('#.#...#...'), list('#..####.##'), list('#.##.####.')], 1409: [list('..####.#.#'), list('..##....#.'), list('..#.#...#.'), list('..##.##...'), list('.#.##....#'), list('#.....##.#'), list('####.....#'), list('###....#..'), list('####..#.#.'), list('#..##.##.#')], 1523: [list('.#.##..##.'), list('#..#.#....'), list('##.#.#...#'), list('....#.##.#'), list('#........#'), list('#.#.......'), list('#...##...#'), list('...#..##.#'), list('#.##...#..'), list('.####..#..')], 1367: [list('#..#...#.#'), list('#.#.......'), list('..#..#....'), list('.###..###.'), list('###..#.##.'), list('##...#..#.'), list('#..#...#.#'), list('......##..'), list('##.....#.#'), list('.#####..##')], 1783: [list('...#.####.'), list('.####..#..'), list('#....#.###'), list('#.#..#.#.#'), list('#.#.#.#..#'), list('#.......##'), list('#.##.#.#..'), list('.#.#....#.'), list('#..#.#...#'), list('.###..##.#')], 1871: [list('.##..#.##.'), list('#........#'), list('#...#....#'), list('##.#..##..'), list('##.....##.'), list('#.....#.##'), list('........##'), list('....#....#'), list('#.........'), list('....#.#..#')], 3217: [list('#.#...#.##'), list('.........#'), list('.........#'), list('#...#.....'), list('#....#.#.#'), list('.........#'), list('...#.##.##'), list('#...#.....'), list('.#..#....#'), list('#..###.#.#')], 3163: [list('...##.#.##'), list('#.#......#'), list('....#...##'), list('#.......##'), list('###..#.#..'), list('.#....####'), list('##....#.##'), list('#.......#.'), list('.....#..#.'), list('.##.#.#.##')], 3271: [list('##.#.#.##.'), list('##....##.#'), list('#.#.##..##'), list('#.#...##.#'), list('.##......#'), list('#.....#.#.'), list('#........#'), list('##..##....'), list('#.#..##..#'), list('#..#.####.')], 2707: [list('..###.#...'), list('#...#.....'), list('#.#..#....'), list('#..##...##'), list('.###......'), list('.#..##...#'), list('#...#.....'), list('....#.....'), list('#..#.#....'), list('.##....#.#')], 3083: [list('##..#.#.##'), list('#..#....##'), list('.........#'), list('..#.#...##'), list('..#.......'), list('.#.#.....#'), list('..#..#.#..'), list('#...#.#..#'), list('#..#.#....'), list('#.###..##.')], 1051: [list('####...##.'), list('...#.#...#'), list('..........'), list('..#.......'), list('#......#..'), list('.#.##.##..'), list('#....#.#.#'), list('#..#.#...#'), list('#.#..##..#'), list('......###.')], 3767: [list('.#..##.###'), list('...#.#....'), list('..#.....#.'), list('#.#.......'), list('.#.....#.#'), list('##..#....#'), list('#...#..#.#'), list('........##'), list('#........#'), list('..#....##.')], 2267: [list('.#..#..#..'), list('.#.#.#....'), list('.#......#.'), list('#...#....#'), list('.###..#...'), list('.##.#...##'), list('..#.##.##.'), list('...#.#.##.'), list('##.#.##..#'), list('.#.##.....')], 1973: [list('#.#####..#'), list('.#.......#'), list('#..#.#..#.'), list('#.#.#.#.#.'), list('.##.......'), list('#.#.....#.'), list('.#.......#'), list('#...##.#.#'), list('##.......#'), list('.##...####')], 3671: [list('#..##.#.##'), list('....##...#'), list('.###.##...'), list('.........#'), list('#..#.....#'), list('..##...#..'), list('......#...'), list('..#..#..##'), list('..#.......'), list('##..###..#')], 3221: [list('#.#..###.#'), list('#..#....##'), list('#..#......'), list('#...#...##'), list('..#..#..#.'), list('#..##...#.'), list('...#....#.'), list('.....#..#.'), list('##..#..#..'), list('.....#...#')], 1549: [list('.###.##..#'), list('#.#.##...#'), list('#....#....'), list('..........'), list('#.#......#'), list('##.#.#..##'), list('...#.#..##'), list('........#.'), list('#.#....###'), list('#....#...#')], 3461: [list('.######..#'), list('#.......##'), list('.......#..'), list('.#...#....'), list('..##....#.'), list('#.....##..'), list('##.#.#..#.'), list('.........#'), list('##.##.#...'), list('....#...##')], 2459: [list('..##.##.#.'), list('...#..#...'), list('.........#'), list('#.#..#..##'), list('#.###.#...'), list('##.#......'), list('.......#..'), list('.........#'), list('........##'), list('#.##...#..')], 3203: [list('.#...####.'), list('..##..#.#.'), list('#..#..##..'), list('#.#....##.'), list('...#.#....'), list('.......###'), list('#.....##..'), list('....#....#'), list('#......#..'), list('###.......')], 2203: [list('#.#..##.##'), list('.......#..'), list('......#.##'), list('#.......##'), list('#..##.##.#'), list('..#.....##'), list('#.##.....#'), list('#.#....#..'), list('.##.....##'), list('......#...')], 3637: [list('#...###.#.'), list('#.........'), list('..#.......'), list('...#.....#'), list('#..##....#'), list('#........#'), list('.......#..'), list('#....#.#..'), list('#.#..##..#'), list('..#.#..##.')], 2467: [list('..##.##...'), list('##....####'), list('...#.#.#.#'), list('#.##...#.#'), list('...##.##..'), list('#.....#...'), list('##........'), list('..#...#.#.'), list('#...####.#'), list('#......###')], 2411: [list('...##....#'), list('...##..###'), list('...##.####'), list('#.#..##.#.'), list('..##.#.###'), list('.#..#.###.'), list('....####.#'), list('.....##.#.'), list('#.........'), list('.#..#..###')], 2221: [list('####.....#'), list('#.#.....##'), list('.#....#...'), list('.#.#......'), list('.##..#..#.'), list('....#.....'), list('.........#'), list('##.......#'), list('#....#....'), list('.##.######')], 1487: [list('..#..##...'), list('.........#'), list('#..#...###'), list('....#...#.'), list('.#...##.#.'), list('.....#.#.#'), list('.....##...'), list('#.##......'), list('#.#.......'), list('#.#####.#.')], 1481: [list('#.###.##..'), list('....##...#'), list('....#.....'), list('...#......'), list('##.###.#.#'), list('#.##..####'), list('..#......#'), list('.#....##.#'), list('..##.##.#.'), list('.#####.#.#')], 1669: [list('#...##.##.'), list('...#..#...'), list('.##..#.#.#'), list('#..#..#..#'), list('#......#.#'), list('.#......##'), list('........#.'), list('......#..#'), list('.##..#.#.#'), list('##.##....#')], 3167: [list('.#.####...'), list('.........#'), list('#......##.'), list('.....#....'), list('..#.#...##'), list('#.#.####.#'), list('...#....#.'), list('.........#'), list('#...#.#..#'), list('#.#.#.#.#.')], 3347: [list('###...##..'), list('#.#......#'), list('...#.....#'), list('..........'), list('#.#.....#.'), list('..####..##'), list('..#.#.#..#'), list('##...#..#.'), list('..##.....#'), list('#..#....#.')], 2213: [list('#..#####.#'), list('..........'), list('#..#.##.#.'), list('...###.#.#'), list('......##..'), list('......#..#'), list('.##.....##'), list('..#....###'), list('...####..#'), list('.####.#.##')], 3329: [list('..##...#..'), list('#.#....#.#'), list('#...#..#..'), list('......#.##'), list('#...####.#'), list('..........'), list('##....##.#'), list('#......##.'), list('....##...#'), list('..####.##.')], 3851: [list('#.#....##.'), list('.........#'), list('#.....#...'), list('##.##.....'), list('...#.###..'), list('#....##...'), list('.....#.##.'), list('.#........'), list('#......#.#'), list('...#..#..#')], 2659: [list('#.#...#.#.'), list('.....#.##.'), list('#..##.####'), list('#.#.##....'), list('#....#..#.'), list('...#...#..'), list('...#....#.'), list('#....#.#..'), list('.##.#....#'), list('.....#..#.')], 1933: [list('.####.##..'), list('#..####...'), list('.#..####..'), list('.#.#.##...'), list('......#.#.'), list('##........'), list('.#.#.....#'), list('#..#......'), list('....#.....'), list('...#...##.')], 3299: [list('###.##..#.'), list('.......#..'), list('...#...##.'), list('###...#.##'), list('......##..'), list('....#.#..#'), list('.###......'), list('.#.#####..'), list('#..#.#..#.'), list('.....#.#.#')], 3691: [list('...###...#'), list('#.........'), list('#.#.....##'), list('#.#....#..'), list('#..#...#..'), list('..........'), list('##...##..#'), list('.#...#...#'), list('#.....#.##'), list('.###..#...')], 3733: [list('#..#.#####'), list('.....#....'), list('....###..#'), list('#..#.#....'), list('#.#..#.###'), list('..###...##'), list('......#.##'), list('...###....'), list('...#....#.'), list('..##......')], 2131: [list('##.#..#.#.'), list('.#...#..##'), list('#.......#.'), list('....##...#'), list('.###..#...'), list('...#####..'), list('.....#...#'), list('##..#..##.'), list('..##....#.'), list('.#...####.')], 1723: [list('.....#####'), list('.#.#..#...'), list('##......#.'), list('#.......##'), list('.###...#..'), list('#..#......'), list('#.........'), list('......#..#'), list('.........#'), list('.###.##.##')], 3463: [list('##.#....##'), list('#....##..#'), list('..#.#.....'), list('#.#...#..#'), list('#....#....'), list('..#....#.#'), list('#...#..###'), list('##....#.##'), list('..#.#.....'), list('.#..#.##..')], 2549: [list('#.####.#..'), list('...##....#'), list('##..#.##.#'), list('..###.#..#'), list('#.#......#'), list('#........#'), list('....#.....'), list('#......#.#'), list('#....####.'), list('...##.#.##')], 1031: [list('#..#.#.#.#'), list('......##..'), list('#........#'), list('.###......'), list('..#..#..#.'), list('##....##..'), list('......#...'), list('...#...###'), list('.###...#..'), list('.##.#.###.')], 1979: [list('#.######..'), list('.#.#.....#'), list('#........#'), list('#..##.....'), list('##........'), list('##.....#..'), list('......#...'), list('.........#'), list('.#........'), list('..#.#####.')], 2939: [list('#.#...#.##'), list('.#..#....#'), list('.#.....#.#'), list('##......##'), list('...#..##..'), list('#....#.##.'), list('#...##.#.#'), list('..#...#...'), list('##.....#..'), list('.....##.#.')], 2381: [list('..##.###.#'), list('..##...#..'), list('.#...#....'), list('#......#.#'), list('##.......#'), list('#..####...'), list('...#.#.#.#'), list('#.##.....#'), list('..#......#'), list('#..#.##...')], 3943: [list('#.#.###..#'), list('.......###'), list('#.#...###.'), list('#..##.#..#'), list('#......#..'), list('#.##...#.#'), list('#.........'), list('##....##.#'), list('....#.#...'), list('.###.#....')], 1553: [list('#####.####'), list('#...#.....'), list('#.#.....#.'), list('##......#.'), list('#....#.#..'), list('.#.....#.#'), list('##....#.#.'), list('#........#'), list('.........#'), list('.#.....##.')], 2351: [list('.###.###..'), list('#.....#...'), list('##.##....#'), list('..#..##.#.'), list('#.#.......'), list('#....#....'), list('......##.#'), list('##...##..#'), list('.#.....#..'), list('.#.###..#.')], 2311: [list('#.#.#..##.'), list('#..###.#..'), list('...##..#.#'), list('###.......'), list('##........'), list('#.#.......'), list('..##.....#'), list('.#.####...'), list('..#.#.#...'), list('###..##.#.')], 1567: [list('..###.#.##'), list('.#.....###'), list('#...#..##.'), list('#.......#.'), list('.......#..'), list('#....#....'), list('...#.##.#.'), list('....#...##'), list('....#....#'), list('#.#...##..')], 2579: [list('#.##..##..'), list('#......#..'), list('#..#..#..#'), list('##.......#'), list('....##.#.#'), list('#.####..#.'), list('#..#..#.##'), list('#...#..#.#'), list('...##...#.'), list('#..#.###..')], 3593: [list('.#.##.#.##'), list('#...#....#'), list('..........'), list('##....#..#'), list('##......##'), list('#.........'), list('......#..#'), list('...#.....#'), list('....#....#'), list('##..###..#')], 2281: [list('##....###.'), list('...#......'), list('#......#.#'), list('##.#..#..#'), list('###.#..##.'), list('.#...#...#'), list('..........'), list('.#.###.#..'), list('#..#......'), list('#..#.##.#.')], 1193: [list('.......###'), list('##..#..#..'), list('.###...###'), list('....#.###.'), list('..#...#..#'), list('#.#....#..'), list('...####..#'), list('#....#..##'), list('.#.......#'), list('.#.#...##.')], 3833: [list('...#####..'), list('#..####...'), list('#.#....###'), list('...##.#.##'), list('..#...#..#'), list('.##.#####.'), list('#..#..#..#'), list('#...##....'), list('.....#.#..'), list('.##.##.#.#')], 2003: [list('.#.###.#..'), list('.........#'), list('..#..#....'), list('#.........'), list('#..##....#'), list('.......#.#'), list('......#...'), list('#....##..#'), list('.#......##'), list('..#..##.#.')], 2731: [list('#.#..#..##'), list('....#..#.#'), list('..#...#...'), list('..#..#....'), list('#.#..#...#'), list('#....##...'), list('#.........'), list('#..##..#.#'), list('#.........'), list('.###.#....')], 3881: [list('..##......'), list('#...#..#.#'), list('##...#....'), list('....#.....'), list('##.......#'), list('.....#####'), list('...#....##'), list('.........#'), list('..........'), list('#..##.####')], 3673: [list('##..###.#.'), list('...##....#'), list('###.....##'), list('#..#...#.#'), list('#.##......'), list('..#.#.....'), list('..#.#....#'), list('.###.....#'), list('.###.##...'), list('###.#..#.#')], 1021: [list('#..###.#..'), list('###..##.#.'), list('#..##....#'), list('.....###..'), list('....##...#'), list('....#.....'), list('#.##..#..#'), list('..........'), list('.......#.#'), list('..#.##..#.')], 2423: [list('#.....####'), list('.##.#....#'), list('.#........'), list('##.....#..'), list('#.....###.'), list('#...#...#.'), list('#...#..#.#'), list('.#..#..##.'), list('##.......#'), list('.#####.###')], 3923: [list('..#....###'), list('#.....#..#'), list('#...#.#.#.'), list('.#.......#'), list('#..#.#....'), list('.......#.#'), list('##....##.#'), list('.#..#...#.'), list('#...##..#.'), list('..#.#.#..#')], 2753: [list('..####..#.'), list('#.......#.'), list('#.##.#..##'), list('#.#.#.....'), list('#..#......'), list('....#.#...'), list('.#.#..#..#'), list('#.....#..#'), list('##.#..#...'), list('#####....#')], 3929: [list('....#####.'), list('##..#.##..'), list('##.#.#.##.'), list('##...#.#..'), list('#........#'), list('.##.#..#..'), list('#..#.##...'), list('##..#...#.'), list('.....#...#'), list('###..####.')], 3041: [list('.##.#..#.#'), list('#..#...#..'), list('###..#..#.'), list('.#.#....##'), list('...##.....'), list('#....#..##'), list('#........#'), list('##.#...#..'), list('##....#..#'), list('...#..#..#')], 3433: [list('..#.#.#...'), list('#.#.......'), list('.....#....'), list('..#......#'), list('#..#.....#'), list('........##'), list('##..##.##.'), list('##........'), list('#.#.##..##'), list('###.###..#')], 2719: [list('..##..#..#'), list('#.##..##..'), list('#......#..'), list('#...##..##'), list('..#..#.#.#'), list('#......###'), list('..###..#..'), list('....#.#..#'), list('....##...#'), list('##..#..###')], 1201: [list('.#...##.##'), list('#........#'), list('##...##...'), list('..........'), list('.....#.#..'), list('#.##.....#'), list('...#.##..#'), list('.........#'), list('.#.#.....#'), list('.##...#...')], 1129: [list('...####..#'), list('......##..'), list('#.....##..'), list('#.......#.'), list('#......#..'), list('...##....#'), list('........##'), list('##.#.#.#..'), list('...#..##.#'), list('...##....#')], 3019: [list('..#...###.'), list('.....#.##.'), list('#.##.....#'), list('.#.##..#..'), list('.#..###..#'), list('..#.####.#'), list('#..#.#...#'), list('.......#.#'), list('#..##.#..#'), list('#.##....##')], 1747: [list('##.###.#..'), list('#.......#.'), list('#...#..#.#'), list('##...##.#.'), list('..###.#..#'), list('#..#..##..'), list('#...#.....'), list('..#.......'), list('...#..#.#.'), list('.##..##.##')], 1741: [list('.##.#..#.#'), list('#...##..##'), list('#....#.#.#'), list('##...##..#'), list('##.......#'), list('#...#..##.'), list('...#.##.##'), list('...#..#.#.'), list('.......#.#'), list('.#####.###')], 1867: [list('#..##.....'), list('.......###'), list('#..##....#'), list('##...#....'), list('...###....'), list('##..#.....'), list('.##.......'), list('#.....###.'), list('#...#..#.#'), list('...###....')], 2803: [list('.#.##....#'), list('#.####..#.'), list('#.........'), list('#.#......#'), list('.......#.#'), list('........#.'), list('..#..#.#.#'), list('....###...'), list('#...##....'), list('...###....')], 3643: [list('#..#..#.##'), list('####.#..#.'), list('#.#...#.##'), list('.#..#.....'), list('##....#..#'), list('.##.......'), list('.......#.#'), list('...##.#...'), list('.....#.##.'), list('#...####.#')], 2437: [list('..###..###'), list('....#.....'), list('..........'), list('#.#..#.###'), list('##...####.'), list('....##....'), list('...##.....'), list('##..#.##..'), list('#......#..'), list('#.#.....#.')], 1069: [list('..####....'), list('##..##...#'), list('.#..#..##.'), list('.#....##.#'), list('###.#.#.##'), list('...##..#.#'), list('##....#...'), list('#.#....#.#'), list('.#.....#.#'), list('#.#.#.....')], 1381: [list('.###.#.##.'), list('....#..#..'), list('#.......##'), list('#...#.....'), list('.#...#..##'), list('...#....##'), list('#..#.###..'), list('..######.#'), list('#....#...#'), list('#######.#.')], 2617: [list('..##..#.#.'), list('#.....##.#'), list('..#.#..#..'), list('.##.#..#..'), list('###...#.#.'), list('.###.##...'), list('#.#.......'), list('#..##.#..#'), list('##.....#..'), list('.##..#..##')], 2393: [list('.##..#.#.#'), list('..#.#..###'), list('..##..#.##'), list('....#.....'), list('#...#.....'), list('##.#.....#'), list('.#.#..#.#.'), list('##.....#..'), list('.......#.#'), list('####..#...')], 3529: [list('#.#...##.#'), list('......#..#'), list('.........#'), list('#.....#...'), list('.......#..'), list('.....#.#.#'), list('.....#....'), list('#....#.#.#'), list('....#.##.#'), list('.####.#..#')], 2953: [list('...##...#.'), list('##.#.#..##'), list('#...#.....'), list('##.#...###'), list('...#......'), list('#.#.#..#.#'), list('.#...#...#'), list('##....#.##'), list('.......#..'), list('.#.#..#...')], 3617: [list('#..##...##'), list('......#...'), list('#....#....'), list('..........'), list('.######.##'), list('##..#.#.##'), list('#.#...#...'), list('........#.'), list('.######.##'), list('##...###.#')], 3863: [list('.##.#...##'), list('#...#.....'), list('..#.#....#'), list('#....#..##'), list('.....###..'), list('#.#......#'), list('#.......#.'), list('...#.....#'), list('#.........'), list('..###....#')], 3727: [list('#.###.##.#'), list('..........'), list('...##.....'), list('..#..#..##'), list('#......###'), list('#....##...'), list('###.##....'), list('.....#....'), list('##.####.#.'), list('#..#.#.###')], 3803: [list('###..#.##.'), list('.##......#'), list('.........#'), list('###.....##'), list('....###..#'), list('.......#.#'), list('........##'), list('#..#......'), list('##......##'), list('#.###..#..')], 1579: [list('#...##.###'), list('.....#.###'), list('.##...#...'), list('#.#..#..#.'), list('..##.....#'), list('.........#'), list('..........'), list('#.....#.##'), list('.....#....'), list('.###..#...')], 1049: [list('#..#.##.##'), list('##......##'), list('..#.##...#'), list('#.......#.'), list('###.....#.'), list('.....#.#.#'), list('...#......'), list('..##......'), list('#.#....#..'), list('##..#.#...')], 2687: [list('##..#.##..'), list('.#........'), list('##..#...#.'), list('.#.#.....#'), list('.#..#.#..#'), list('#.###..#..'), list('..#......#'), list('#.......##'), list('#..#.....#'), list('#.##.#..##')], 1637: [list('#..##...##'), list('##..#....#'), list('...#....#.'), list('#....#....'), list('.....#...#'), list('#...#...##'), list('.#....#...'), list('#.........'), list('..#....#..'), list('.#.####...')], 3527: [list('.#....#.#.'), list('#.......#.'), list('..#....#.#'), list('####.#.#.#'), list('...#..#...'), list('###..#.###'), list('##..#....#'), list('#.##....##'), list('..#......#'), list('.....#.#..')], 2963: [list('#.#.#.#.#.'), list('#.....#...'), list('##.#.....#'), list('..##......'), list('..#.......'), list('.#...#.##.'), list('###......#'), list('##....#..#'), list('.#...#..##'), list('..##..##.#')], 2287: [list('##.######.'), list('.#.##.##..'), list('#..#....##'), list('##.#.#...#'), list('.......##.'), list('#...##...#'), list('...##..#..'), list('##....#.#.'), list('....#.##..'), list('..#.#..###')], 3677: [list('###.....##'), list('#..#.#..#.'), list('#.#.......'), list('.....#..##'), list('..........'), list('......#.##'), list('.....#..#.'), list('#..#...#..'), list('.##......#'), list('#...##.##.')], 3559: [list('..#..#.##.'), list('###......#'), list('..#.##....'), list('#.#..#....'), list('##..##..##'), list('..#...#.#.'), list('#.....#.##'), list('....#....#'), list('...#.#...#'), list('...#.###..')], 2837: [list('..#...#...'), list('.....##...'), list('#.#..#...#'), list('....#....#'), list('...####.##'), list('#.........'), list('...#...##.'), list('.#..###.#.'), list('....#.....'), list('.###.##.#.')], 3539: [list('..##....#.'), list('........#.'), list('......#..#'), list('...#..#...'), list('###....###'), list('#...#.....'), list('.#........'), list('#.....#...'), list('..##.#..#.'), list('..###..#.#')], 1667: [list('.#..####..'), list('.....#....'), list('......#...'), list('#.#...##.#'), list('#...#.#..#'), list('##.#.#...#'), list('##..#..#..'), list('#...##...#'), list('.#..###...'), list('..#..####.')], 2791: [list('#.##.###.#'), list('...#..#...'), list('##.....###'), list('...#.#..##'), list('.........#'), list('.###...#..'), list('...#.....#'), list('##.....##.'), list('###.......'), list('#..#.#....')], 2609: [list('..##.#....'), list('##.#.#...#'), list('#.#..#....'), list('#.........'), list('...#..#..#'), list('#...#.#...'), list('##.##....#'), list('.###......'), list('##.....##.'), list('#.#...#.#.')], 3061: [list('####..#.##'), list('#.....##..'), list('..........'), list('......#...'), list('..#.#..###'), list('.#.#..#..#'), list('.#...#...#'), list('#........#'), list('.....#.#..'), list('#..#....##')]}
|
def solve(s):
if s==s[::-1]:
return 1
else:
return 0
s=str(input())
print(solve(s))
|
def solve(s):
if s == s[::-1]:
return 1
else:
return 0
s = str(input())
print(solve(s))
|
"""Effects"""
class FxName:
"""FX name"""
def __init__(self, name):
self.name = name
BITCRUSHER = FxName('bitcrusher')
COMPRESSOR = FxName('compressor')
ECHO = FxName('echo')
FLANGER = FxName('flanger')
KRUSH = FxName('krush')
LPF = FxName('lpf')
PAN = FxName('pan')
PANSLICER = FxName('panslicer')
REVERB = FxName('reverb')
SLICER = FxName('slicer')
WOBBLE = FxName('wobble')
|
"""Effects"""
class Fxname:
"""FX name"""
def __init__(self, name):
self.name = name
bitcrusher = fx_name('bitcrusher')
compressor = fx_name('compressor')
echo = fx_name('echo')
flanger = fx_name('flanger')
krush = fx_name('krush')
lpf = fx_name('lpf')
pan = fx_name('pan')
panslicer = fx_name('panslicer')
reverb = fx_name('reverb')
slicer = fx_name('slicer')
wobble = fx_name('wobble')
|
# Copyright (c) 2017-2017 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This section is organized by N9K CLI commands
# show inventory
PATH_GET_NEXUS_TYPE = 'api/mo/sys/ch.json'
# conf t
# vlan <a,n-y>
# state active
PATH_VLAN_ALL = 'api/mo.json'
BODY_VLAN_ALL_BEG = '{"topSystem": { "children": [ {"bdEntity":'
BODY_VLAN_ALL_BEG += ' { children": ['
BODY_VLAN_ALL_INCR = ' {"l2BD": {"attributes": {"fabEncap": "vlan-%s",'
BODY_VLAN_ALL_INCR += ' "pcTag": "1", "adminSt": "active"}}}'
BODY_VXLAN_ALL_INCR = ' {"l2BD": {"attributes": {"fabEncap": "vlan-%s",'
BODY_VXLAN_ALL_INCR += ' "pcTag": "1", "adminSt": "active",'
BODY_VXLAN_ALL_INCR += ' "accEncap": "vxlan-%s"}}}'
BODY_VLAN_ALL_CONT = ','
BODY_VLAN_ALL_END = ' ]}}]}}'
# The following was added to make simple Test case results more readible.
BODY_VLAN_ADD_START = (BODY_VLAN_ALL_BEG + BODY_VLAN_ALL_INCR +
BODY_VLAN_ALL_CONT)
BODY_VLAN_ADD_NEXT = BODY_VLAN_ALL_INCR + BODY_VLAN_ALL_CONT
BODY_VLAN_ADD = (BODY_VLAN_ALL_BEG + BODY_VLAN_ALL_INCR +
BODY_VLAN_ALL_CONT + BODY_VLAN_ALL_END)
BODY_VXLAN_ADD = (BODY_VLAN_ALL_BEG + BODY_VXLAN_ALL_INCR +
BODY_VLAN_ALL_CONT + BODY_VLAN_ALL_END)
# conf t
# vlan <n>
# state active
PATH_VLAN = 'api/mo/sys/bd/bd-[vlan-%s].json'
BODY_VLAN_ACTIVE = '{"l2BD": {"attributes": {"adminSt": "active"}}}'
# conf t
# vlan <n>
# state active
# vn-segment <vni>
BODY_VXLAN_ACTIVE = '{"l2BD": {"attributes": {"adminSt": "active",'
BODY_VXLAN_ACTIVE += ' "accEncap": "vxlan-%s"}}}'
# conf t
# int ethernet x/x OR int port-channel n
# where %s is "phys-[eth1/19]" OR "aggr-[po50]"
PATH_IF = 'api/mo/sys/intf/%s.json'
# THEN
# switchport trunk native vlan <vlan>
# switchport trunk allowed vlan none | add <vlan> | remove <vlan>
# first %s is "l1PhysIf" | "pcAggrIf", 2nd trunkvlan string, 3rd one
# native vlan
BODY_TRUNKVLAN = '{"%s": {"attributes": {"trunkVlans": "%s"}}}'
BODY_NATIVE_TRUNKVLAN = '{"%s": {"attributes": {"trunkVlans": "%s",'
BODY_NATIVE_TRUNKVLAN += ' "nativeVlan": "%s"}}}'
# conf t
# feature nv overlay
PATH_VXLAN_STATE = 'api/mo/sys/fm/nvo.json'
# where %s is "enable" | "disable"
BODY_VXLAN_STATE = '{"fmNvo": {"attributes": {"adminSt": "%s"}}}'
# conf t
# feature vn-segment-vlan-based
PATH_VNSEG_STATE = 'api/mo/sys/fm/vnsegment.json'
BODY_VNSEG_STATE = '{"fmVnSegment": {"attributes": {"adminSt": "%s"}}}'
# conf t
# int nve%s
# no shut
# source-interface loopback %s
PATH_NVE_CREATE = 'api/mo/sys/epId-%s.json'
BODY_NVE_CREATE = '{"nvoEp": {"attributes": {"epId": "%s"}}}'
BODY_NVE_ADD_LOOPBACK = '{"nvoEp": {"attributes": {"adminSt": "%s",'
BODY_NVE_ADD_LOOPBACK += ' "sourceInterface": "lo%s"}}}'
# conf t
# int nve%s
# no shut
# source-interface loopback %s
# conf t
# int nve%s
# [no] member vni %s mcast-group %s
PATH_VNI_UPDATE = 'api/mo/sys/epId-%s/nws/vni-%s.json'
BODY_VNI_UPDATE = '{"nvoNw": {"attributes": {"vni": "%s", "vniRangeMin": "%s",'
BODY_VNI_UPDATE += ' "vniRangeMax": "%s", "mcastGroup": "%s", "isMcastRange":'
BODY_VNI_UPDATE += ' "yes", "suppressARP": "no", "associateVrfFlag": "no"}}}'
# channel-group x mode active is not immediately available beneath the
# ethernet interface data. Instead one needs to gather pc channel members
# and search for ethernet interface.
PATH_GET_PC_MEMBERS = 'api/mo/sys/intf.json?query-target=subtree&'
PATH_GET_PC_MEMBERS += 'target-subtree-class=pcRsMbrIfs'
|
path_get_nexus_type = 'api/mo/sys/ch.json'
path_vlan_all = 'api/mo.json'
body_vlan_all_beg = '{"topSystem": { "children": [ {"bdEntity":'
body_vlan_all_beg += ' { children": ['
body_vlan_all_incr = ' {"l2BD": {"attributes": {"fabEncap": "vlan-%s",'
body_vlan_all_incr += ' "pcTag": "1", "adminSt": "active"}}}'
body_vxlan_all_incr = ' {"l2BD": {"attributes": {"fabEncap": "vlan-%s",'
body_vxlan_all_incr += ' "pcTag": "1", "adminSt": "active",'
body_vxlan_all_incr += ' "accEncap": "vxlan-%s"}}}'
body_vlan_all_cont = ','
body_vlan_all_end = ' ]}}]}}'
body_vlan_add_start = BODY_VLAN_ALL_BEG + BODY_VLAN_ALL_INCR + BODY_VLAN_ALL_CONT
body_vlan_add_next = BODY_VLAN_ALL_INCR + BODY_VLAN_ALL_CONT
body_vlan_add = BODY_VLAN_ALL_BEG + BODY_VLAN_ALL_INCR + BODY_VLAN_ALL_CONT + BODY_VLAN_ALL_END
body_vxlan_add = BODY_VLAN_ALL_BEG + BODY_VXLAN_ALL_INCR + BODY_VLAN_ALL_CONT + BODY_VLAN_ALL_END
path_vlan = 'api/mo/sys/bd/bd-[vlan-%s].json'
body_vlan_active = '{"l2BD": {"attributes": {"adminSt": "active"}}}'
body_vxlan_active = '{"l2BD": {"attributes": {"adminSt": "active",'
body_vxlan_active += ' "accEncap": "vxlan-%s"}}}'
path_if = 'api/mo/sys/intf/%s.json'
body_trunkvlan = '{"%s": {"attributes": {"trunkVlans": "%s"}}}'
body_native_trunkvlan = '{"%s": {"attributes": {"trunkVlans": "%s",'
body_native_trunkvlan += ' "nativeVlan": "%s"}}}'
path_vxlan_state = 'api/mo/sys/fm/nvo.json'
body_vxlan_state = '{"fmNvo": {"attributes": {"adminSt": "%s"}}}'
path_vnseg_state = 'api/mo/sys/fm/vnsegment.json'
body_vnseg_state = '{"fmVnSegment": {"attributes": {"adminSt": "%s"}}}'
path_nve_create = 'api/mo/sys/epId-%s.json'
body_nve_create = '{"nvoEp": {"attributes": {"epId": "%s"}}}'
body_nve_add_loopback = '{"nvoEp": {"attributes": {"adminSt": "%s",'
body_nve_add_loopback += ' "sourceInterface": "lo%s"}}}'
path_vni_update = 'api/mo/sys/epId-%s/nws/vni-%s.json'
body_vni_update = '{"nvoNw": {"attributes": {"vni": "%s", "vniRangeMin": "%s",'
body_vni_update += ' "vniRangeMax": "%s", "mcastGroup": "%s", "isMcastRange":'
body_vni_update += ' "yes", "suppressARP": "no", "associateVrfFlag": "no"}}}'
path_get_pc_members = 'api/mo/sys/intf.json?query-target=subtree&'
path_get_pc_members += 'target-subtree-class=pcRsMbrIfs'
|
message = [ 'e', 'k', 'a', 'c', ' ',
'd', 'n', 'u', 'o', 'p', ' ',
'l', 'a', 'e', 't', 's']
def reversed_words(message):
cur_pos = 0
end_pos = len(message)
current_word_start = cur_pos
while cur_pos < end_pos:
if message[cur_pos] == ' ':
message[current_word_start:cur_pos] = reversed(message[current_word_start:cur_pos])
current_word_start = cur_pos + 1
if cur_pos == end_pos - 1:
message[current_word_start:end_pos] = reversed(message[current_word_start:end_pos])
cur_pos += 1
reversed_words(message)
# Prints: 'steal pound cake'
print(''.join(message))
|
message = ['e', 'k', 'a', 'c', ' ', 'd', 'n', 'u', 'o', 'p', ' ', 'l', 'a', 'e', 't', 's']
def reversed_words(message):
cur_pos = 0
end_pos = len(message)
current_word_start = cur_pos
while cur_pos < end_pos:
if message[cur_pos] == ' ':
message[current_word_start:cur_pos] = reversed(message[current_word_start:cur_pos])
current_word_start = cur_pos + 1
if cur_pos == end_pos - 1:
message[current_word_start:end_pos] = reversed(message[current_word_start:end_pos])
cur_pos += 1
reversed_words(message)
print(''.join(message))
|
class EquationClass:
def __init__(self):
pass
def calculation(self):
...
def info(self):
...
|
class Equationclass:
def __init__(self):
pass
def calculation(self):
...
def info(self):
...
|
class BufferFile:
def __init__(self, write):
self.write = write
def readline(self): pass
def writelines(self, l): map(self.append, l)
def flush(self): pass
def isatty(self): return 1
|
class Bufferfile:
def __init__(self, write):
self.write = write
def readline(self):
pass
def writelines(self, l):
map(self.append, l)
def flush(self):
pass
def isatty(self):
return 1
|
# Class could be designed to be used in cooperative multiple inheritance
# so `super()` could be resolved to some non-object class that is able to receive passed arguments.
class Shape(object):
def __init__(self, shapename, **kwds):
self.shapename = shapename
# in case of ColoredShape the call below will be executed on Colored
# so warning should not be raised
super(Shape, self).__init__(**kwds)
class Colored(object):
def __init__(self, color, **kwds):
self.color = color
super(Colored, self).__init__(**kwds)
class ColoredShape(Shape, Colored):
pass
cs = ColoredShape(color='red', shapename='circle')
|
class Shape(object):
def __init__(self, shapename, **kwds):
self.shapename = shapename
super(Shape, self).__init__(**kwds)
class Colored(object):
def __init__(self, color, **kwds):
self.color = color
super(Colored, self).__init__(**kwds)
class Coloredshape(Shape, Colored):
pass
cs = colored_shape(color='red', shapename='circle')
|
# Space Walk
# by Sean McManus
# www.sean.co.uk / www.nostarch.com
WIDTH = 800
HEIGHT = 600
player_x = 500
player_y = 550
def draw():
screen.blit(images.backdrop, (0, 0))
|
width = 800
height = 600
player_x = 500
player_y = 550
def draw():
screen.blit(images.backdrop, (0, 0))
|
def countPaths(maze, rows, cols):
if (maze[0][0] == -1):
return 0
# Initializing the leftmost column
for i in range(rows):
if (maze[i][0] == 0):
maze[i][0] = 1
# If we encounter a blocked cell in
# leftmost row, there is no way of
# visiting any cell directly below it.
else:
break
# Similarly initialize the topmost row
for i in range(1, cols, 1):
if (maze[0][i] == 0):
maze[0][i] = 1
# If we encounter a blocked cell in
# bottommost row, there is no way of
# visiting any cell directly below it.
else:
break
# The only difference is that if a cell is -1,
# simply ignore it else recursively compute
# count value maze[i][j]
for i in range(1, rows, 1):
for j in range(1, cols, 1):
# If blockage is found, ignore this cell
if (maze[i][j] == -1):
continue
# If we can reach maze[i][j] from
# maze[i-1][j] then increment count.
if (maze[i - 1][j] > 0):
maze[i][j] = (maze[i][j] +
maze[i - 1][j])
# If we can reach maze[i][j] from
# maze[i][j-1] then increment count.
if (maze[i][j - 1] > 0):
maze[i][j] = (maze[i][j] +
maze[i][j - 1])
# If the final cell is blocked,
# output 0, otherwise the answer
if (maze[rows - 1][cols - 1] > 0):
return maze[rows - 1][cols - 1]
else:
return 0
# Driver code
res=[]
maze=[]
rows, cols = input().split()
rows=int(rows)
cols=int(cols)
for i in range(rows):
col =input()
row=[]
for j in col:
row.append(j)
maze.append(row)
# print(maze)
for i in range(rows):
for j in range(cols):
if(maze[i][j]=='.'):
maze[i][j]=0
else:
maze[i][j]=-1
print(maze)
arr = [x[:] for x in maze]
# print(arr)
for i in range(0, rows):
for j in range(0, cols):
if(maze[i][j]==-1):
maze[i][j]=0
else:
maze[i][j]=-1
n=countPaths(maze, rows, cols)
if(n==0):
print("0", end=' ')
else:
print("1", end=' ')
maze = [x[:] for x in arr]
print()
# # print(countPaths(arr))
# # maze = [[0, 0, 0, 0],
# # [0, -1, 0, 0],
# # [-1, 0, 0, 0],
# # [0, 0, 0, 0 ]]
# # print(countPaths(maze))
# # print(maze)
# # for i in range(0, rows):
# # for j in range(0,cols):
# # print(arr[i][j])
# # print()
# # print(arr)
# # print(arr)
# # This code is contributed by
# # Surendra_Gangwar
|
def count_paths(maze, rows, cols):
if maze[0][0] == -1:
return 0
for i in range(rows):
if maze[i][0] == 0:
maze[i][0] = 1
else:
break
for i in range(1, cols, 1):
if maze[0][i] == 0:
maze[0][i] = 1
else:
break
for i in range(1, rows, 1):
for j in range(1, cols, 1):
if maze[i][j] == -1:
continue
if maze[i - 1][j] > 0:
maze[i][j] = maze[i][j] + maze[i - 1][j]
if maze[i][j - 1] > 0:
maze[i][j] = maze[i][j] + maze[i][j - 1]
if maze[rows - 1][cols - 1] > 0:
return maze[rows - 1][cols - 1]
else:
return 0
res = []
maze = []
(rows, cols) = input().split()
rows = int(rows)
cols = int(cols)
for i in range(rows):
col = input()
row = []
for j in col:
row.append(j)
maze.append(row)
for i in range(rows):
for j in range(cols):
if maze[i][j] == '.':
maze[i][j] = 0
else:
maze[i][j] = -1
print(maze)
arr = [x[:] for x in maze]
for i in range(0, rows):
for j in range(0, cols):
if maze[i][j] == -1:
maze[i][j] = 0
else:
maze[i][j] = -1
n = count_paths(maze, rows, cols)
if n == 0:
print('0', end=' ')
else:
print('1', end=' ')
maze = [x[:] for x in arr]
print()
|
n,s,t=map(int,input().split())
w=c=0
for i in range(n):
w+=int(input())
c+=s<=w<=t
print(c)
|
(n, s, t) = map(int, input().split())
w = c = 0
for i in range(n):
w += int(input())
c += s <= w <= t
print(c)
|
'''
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
'''
# find the factors of num using modulus operator
num = 600851475143
div = 2
highestFactor = 1
while num > 1:
if(num%div==0):
num = num/div
highestFactor = div
else:
div+=1
print(highestFactor)
|
"""
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
"""
num = 600851475143
div = 2
highest_factor = 1
while num > 1:
if num % div == 0:
num = num / div
highest_factor = div
else:
div += 1
print(highestFactor)
|
# Problem Statement: https://www.hackerrank.com/challenges/map-and-lambda-expression/problem
cube = lambda x: x**3
def fibonacci(n):
fib = [0, 1]
for i in range(2, n):
fib.append(fib[i - 1] + fib[i - 2])
return fib[0:n]
|
cube = lambda x: x ** 3
def fibonacci(n):
fib = [0, 1]
for i in range(2, n):
fib.append(fib[i - 1] + fib[i - 2])
return fib[0:n]
|
def multiply_by(a, b=2, c=1):
return a * b + c
print(multiply_by(3, 47, 0)) # Call function using custom values for all parameters
print(multiply_by(3, 47)) # Call function using default value for c parameter
print(multiply_by(3, c=47)) # Call function using default value for b parameter
print(multiply_by(3)) # Call function using default values for parameters b and c
print(multiply_by(a=7)) # Call function using default values for parameters b and c
def hello(subject, name="Max"):
print(f"Hello {subject}! My name is {name}")
hello("PyCharm", "Jane") # Call "hello" function with "PyCharm as a subject parameter and "Jane" as a name
hello("PyCharm") # Call "hello" function with "PyCharm as a subject parameter and default value for the name
|
def multiply_by(a, b=2, c=1):
return a * b + c
print(multiply_by(3, 47, 0))
print(multiply_by(3, 47))
print(multiply_by(3, c=47))
print(multiply_by(3))
print(multiply_by(a=7))
def hello(subject, name='Max'):
print(f'Hello {subject}! My name is {name}')
hello('PyCharm', 'Jane')
hello('PyCharm')
|
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the commercial license agreement provided with the
# Software or, alternatively, in accordance with the terms contained in
# a written agreement between you and The Qt Company. For licensing terms
# and conditions see https://www.qt.io/terms-conditions. For further
# information use the contact form at https://www.qt.io/contact-us.
#
# GNU General Public License Usage
# Alternatively, this file may be used under the terms of the GNU
# General Public License version 3 as published by the Free Software
# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
# included in the packaging of this file. Please review the following
# information to ensure the GNU General Public License requirements will
# be met: https://www.gnu.org/licenses/gpl-3.0.html.
#
############################################################################
source("../../shared/qtcreator.py")
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(tempDir(), "DesignerTestApp")
selectFromLocator("mainwindow.ui")
widgetIndex = "{container=':qdesigner_internal::WidgetBoxCategoryListView' text='%s' type='QModelIndex'}"
widgets = {"Push Button": 50,
"Check Box": 100}
for current in widgets.keys():
dragAndDrop(waitForObject(widgetIndex % current), 5, 5,
":FormEditorStack_qdesigner_internal::FormWindow", 20, widgets[current], Qt.CopyAction)
connections = []
for record in testData.dataset("connections.tsv"):
connections.append([testData.field(record, col) for col in ["widget", "baseclass",
"signal", "slot"]])
for con in connections:
selectFromLocator("mainwindow.ui")
openContextMenu(waitForObject(con[0]), 5, 5, 0)
snooze(1)
# hack for Squish 5/Qt5.2 problems of handling menus on Mac - remove asap
if platform.system() == 'Darwin':
waitFor("macHackActivateContextMenuItem('Go to slot...', con[0])", 6000)
else:
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
try:
# Creator built with Qt <= 5.9
signalWidgetObject = waitForObject(":Select signal.signalList_QTreeWidget", 5000)
signalName = con[2]
except:
# Creator built with Qt >= 5.10
signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView")
signalName = con[1] + "." + con[2]
waitForObjectItem(signalWidgetObject, signalName)
clickItem(signalWidgetObject, signalName, 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject(":Go to slot.OK_QPushButton"))
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
type(editor, "<Up>")
type(editor, "<Up>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3]))
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
|
source('../../shared/qtcreator.py')
def main():
start_application('qtcreator' + SettingsPath)
if not started_without_plugin_error():
return
create_project__qt_gui(temp_dir(), 'DesignerTestApp')
select_from_locator('mainwindow.ui')
widget_index = "{container=':qdesigner_internal::WidgetBoxCategoryListView' text='%s' type='QModelIndex'}"
widgets = {'Push Button': 50, 'Check Box': 100}
for current in widgets.keys():
drag_and_drop(wait_for_object(widgetIndex % current), 5, 5, ':FormEditorStack_qdesigner_internal::FormWindow', 20, widgets[current], Qt.CopyAction)
connections = []
for record in testData.dataset('connections.tsv'):
connections.append([testData.field(record, col) for col in ['widget', 'baseclass', 'signal', 'slot']])
for con in connections:
select_from_locator('mainwindow.ui')
open_context_menu(wait_for_object(con[0]), 5, 5, 0)
snooze(1)
if platform.system() == 'Darwin':
wait_for("macHackActivateContextMenuItem('Go to slot...', con[0])", 6000)
else:
activate_item(wait_for_object_item("{type='QMenu' unnamed='1' visible='1'}", 'Go to slot...'))
try:
signal_widget_object = wait_for_object(':Select signal.signalList_QTreeWidget', 5000)
signal_name = con[2]
except:
signal_widget_object = wait_for_object(':Select signal.signalList_QTreeView')
signal_name = con[1] + '.' + con[2]
wait_for_object_item(signalWidgetObject, signalName)
click_item(signalWidgetObject, signalName, 5, 5, 0, Qt.LeftButton)
click_button(wait_for_object(':Go to slot.OK_QPushButton'))
editor = wait_for_object(':Qt Creator_CppEditor::Internal::CPPEditorWidget')
type(editor, '<Up>')
type(editor, '<Up>')
test.verify(wait_for('str(lineUnderCursor(editor)).strip() == con[3]', 1000), 'Comparing line "%s" to expected "%s"' % (line_under_cursor(editor), con[3]))
invoke_menu_item('File', 'Save All')
invoke_menu_item('File', 'Exit')
|
# -*- coding: utf-8 -*-
# @Time : 2018/8/13 16:45
# @Author : Dylan
# @File : config.py
# @Email : [email protected]
class Config():
train_imgs_path = "images/train/images"
train_labels_path = "images/train/label"
merge_path = ""
aug_merge_path = "deform/deform_norm2"
aug_train_path = "deform/train/"
aug_label_path = "deform/label/"
test_path = "images/test"
npy_path = "../npydata"
result_np_save = '../results/imgs_mask_test.npy'
save_img_path = "../results/"
checkpoint_path = ""
save_model_path = ""
tensorboard_path = ""
load_model_path = ""
load_model = False
model_train = True
img_type = 'tif'
aug_img_num = 30
norm_size = 512
channels = 1
batch_size = 6
use_gpu = "1"
aug = True
ratio = 0.2
max_epoch = 200
lr = 1e-4
lr_reduce = 0.5
config = Config()
|
class Config:
train_imgs_path = 'images/train/images'
train_labels_path = 'images/train/label'
merge_path = ''
aug_merge_path = 'deform/deform_norm2'
aug_train_path = 'deform/train/'
aug_label_path = 'deform/label/'
test_path = 'images/test'
npy_path = '../npydata'
result_np_save = '../results/imgs_mask_test.npy'
save_img_path = '../results/'
checkpoint_path = ''
save_model_path = ''
tensorboard_path = ''
load_model_path = ''
load_model = False
model_train = True
img_type = 'tif'
aug_img_num = 30
norm_size = 512
channels = 1
batch_size = 6
use_gpu = '1'
aug = True
ratio = 0.2
max_epoch = 200
lr = 0.0001
lr_reduce = 0.5
config = config()
|
tile_colors = {}
for _ in range(400):
path = input()
i = 0
pos_north = 0.0
pos_east = 0.0
while i < len(path):
if path[i] == 'e':
pos_east += 1.0
i += 1
elif path[i] == 'w':
pos_east -= 1.0
i += 1
elif path[i] == 'n' and path[i+1] == 'e':
pos_north += 0.5
pos_east += 0.5
i += 2
elif path[i] == 's' and path[i+1] == 'e':
pos_north -= 0.5
pos_east += 0.5
i += 2
elif path[i] == 's' and path[i+1] == 'w':
pos_north -= 0.5
pos_east -= 0.5
i += 2
else:
pos_north += 0.5
pos_east -= 0.5
i += 2
pos = (pos_east, pos_north)
if pos in tile_colors:
tile_colors[pos] = 'black' if tile_colors.get(pos) == 'white' else 'white'
else:
tile_colors[pos] = 'black'
counter = 0
for pos in tile_colors.keys():
if tile_colors.get(pos) == 'black':
counter += 1
print(counter)
|
tile_colors = {}
for _ in range(400):
path = input()
i = 0
pos_north = 0.0
pos_east = 0.0
while i < len(path):
if path[i] == 'e':
pos_east += 1.0
i += 1
elif path[i] == 'w':
pos_east -= 1.0
i += 1
elif path[i] == 'n' and path[i + 1] == 'e':
pos_north += 0.5
pos_east += 0.5
i += 2
elif path[i] == 's' and path[i + 1] == 'e':
pos_north -= 0.5
pos_east += 0.5
i += 2
elif path[i] == 's' and path[i + 1] == 'w':
pos_north -= 0.5
pos_east -= 0.5
i += 2
else:
pos_north += 0.5
pos_east -= 0.5
i += 2
pos = (pos_east, pos_north)
if pos in tile_colors:
tile_colors[pos] = 'black' if tile_colors.get(pos) == 'white' else 'white'
else:
tile_colors[pos] = 'black'
counter = 0
for pos in tile_colors.keys():
if tile_colors.get(pos) == 'black':
counter += 1
print(counter)
|
# Copyright 2018 Inap.
#
# 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.
class ShellSession(object):
def __init__(self, command_processor):
self.command_processor = command_processor
self.command_processor.write("\n")
self.command_processor.show_prompt()
def receive(self, line):
self.command_processor.logger.debug("received: %s" % line)
try:
processed = self.command_processor.process_command(line)
except TerminalExitSignal:
return False
if not processed:
self.command_processor.logger.info("Command not supported : %s" % line)
self.handle_unknown_command(line)
self.command_processor.show_prompt()
return not self.command_processor.is_done
def handle_unknown_command(self, line):
pass
class TerminalExitSignal(Exception):
pass
|
class Shellsession(object):
def __init__(self, command_processor):
self.command_processor = command_processor
self.command_processor.write('\n')
self.command_processor.show_prompt()
def receive(self, line):
self.command_processor.logger.debug('received: %s' % line)
try:
processed = self.command_processor.process_command(line)
except TerminalExitSignal:
return False
if not processed:
self.command_processor.logger.info('Command not supported : %s' % line)
self.handle_unknown_command(line)
self.command_processor.show_prompt()
return not self.command_processor.is_done
def handle_unknown_command(self, line):
pass
class Terminalexitsignal(Exception):
pass
|
function_classes = {}
class RegisteringMetaclass(type):
def __new__(*args): # pylint: disable=no-method-argument
cls = type.__new__(*args)
if cls.name:
function_classes[cls.name] = cls
return cls
class Function(metaclass=RegisteringMetaclass):
name = None
min_args = None
max_args = None
def __init__(self, *args):
if self.min_args is not None and len(args) < self.min_args:
raise ValueError(
'Expected min {} args but was {}'.format(self.min_args, len(args))
)
if self.max_args is not None and len(args) > self.max_args:
raise ValueError(
'Expected max {} args but was {}'.format(self.max_args, len(args))
)
self.args = args
def evaluate(self, context):
raise NotImplementedError()
def debug(self, context):
try:
result = self.evaluate(context)
except Exception as e:
result = type(e).__name__
return '<{}({})={}>'.format(
self.name,
', '.join(
f.debug(context) if isinstance(f, Function) else str(f)
for f in self.args
),
result,
)
def to_dict(self):
return {
self.name: [
f.to_dict()
if isinstance(f, Function) else f for f in self.args
]
}
@classmethod
def from_dict(cls, dct):
if (
isinstance(dct, dict) and
len(dct) == 1 and
list(dct.keys())[0] in function_classes
):
func_name, arg_dicts = list(dct.items())[0]
func_class = function_classes[func_name]
return func_class(*[
cls.from_dict(arg_dict) for arg_dict in arg_dicts
])
return dct
class Equals(Function):
name = 'equals'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 == result2
class Lte(Function):
name = 'lte'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 <= result2
class Gte(Function):
name = 'gte'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 >= result2
class In(Function):
name = 'in'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) in self.args[1].evaluate(context)
class NotIn(Function):
name = 'notin'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) not in self.args[1].evaluate(context)
class Or(Function):
name = 'or'
min_args = 2
max_args = None
def evaluate(self, context):
return any(f.evaluate(context) for f in self.args)
class And(Function):
name = 'and'
min_args = 2
max_args = None
def evaluate(self, context):
return all(f.evaluate(context) for f in self.args)
class Not(Function):
name = 'not'
min_args = 1
max_args = 1
def evaluate(self, context):
return not self.args[0].evaluate(context)
class If(Function):
name = 'if'
min_args = 3
max_args = 3
def evaluate(self, context):
if self.args[0].evaluate(context):
return self.args[1].evaluate(context)
return self.args[2].evaluate(context)
class Constant(Function):
name = 'constant'
min_args = 1
max_args = 1
def evaluate(self, context):
return self.args[0]
def debug(self, context):
return '<constant({})>'.format(str(self.args[0]))
class ParamMixin:
def _evaluate(self, context):
result = context
for item in self.path_items:
if hasattr(result, item):
result = getattr(result, item)
elif isinstance(result, dict):
result = result.get(item)
else:
return None
return result
class Param(Function, ParamMixin):
name = 'param'
min_args = 1
max_args = 1
def __init__(self, path):
super().__init__(path)
self.path_items = path.split('.')
def evaluate(self, context):
return self._evaluate(context)
class ParamWithDefault(Function, ParamMixin):
name = 'dparam'
min_args = 2
max_args = 2
def __init__(self, path, default):
super().__init__(path, default)
self.path_items = path.split('.')
self.default = default
def evaluate(self, context):
result = self._evaluate(context)
if result is None:
return self.default
return result
class Add(Function):
name = 'add'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) + self.args[1].evaluate(context)
class Subtract(Function):
name = 'subtract'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) - self.args[1].evaluate(context)
class Multiply(Function):
name = 'multiply'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) * self.args[1].evaluate(context)
class Divide(Function):
name = 'divide'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) / self.args[1].evaluate(context)
|
function_classes = {}
class Registeringmetaclass(type):
def __new__(*args):
cls = type.__new__(*args)
if cls.name:
function_classes[cls.name] = cls
return cls
class Function(metaclass=RegisteringMetaclass):
name = None
min_args = None
max_args = None
def __init__(self, *args):
if self.min_args is not None and len(args) < self.min_args:
raise value_error('Expected min {} args but was {}'.format(self.min_args, len(args)))
if self.max_args is not None and len(args) > self.max_args:
raise value_error('Expected max {} args but was {}'.format(self.max_args, len(args)))
self.args = args
def evaluate(self, context):
raise not_implemented_error()
def debug(self, context):
try:
result = self.evaluate(context)
except Exception as e:
result = type(e).__name__
return '<{}({})={}>'.format(self.name, ', '.join((f.debug(context) if isinstance(f, Function) else str(f) for f in self.args)), result)
def to_dict(self):
return {self.name: [f.to_dict() if isinstance(f, Function) else f for f in self.args]}
@classmethod
def from_dict(cls, dct):
if isinstance(dct, dict) and len(dct) == 1 and (list(dct.keys())[0] in function_classes):
(func_name, arg_dicts) = list(dct.items())[0]
func_class = function_classes[func_name]
return func_class(*[cls.from_dict(arg_dict) for arg_dict in arg_dicts])
return dct
class Equals(Function):
name = 'equals'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 == result2
class Lte(Function):
name = 'lte'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 <= result2
class Gte(Function):
name = 'gte'
min_args = 2
max_args = 2
def evaluate(self, context):
result1 = self.args[0].evaluate(context)
result2 = self.args[1].evaluate(context)
return result1 >= result2
class In(Function):
name = 'in'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) in self.args[1].evaluate(context)
class Notin(Function):
name = 'notin'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) not in self.args[1].evaluate(context)
class Or(Function):
name = 'or'
min_args = 2
max_args = None
def evaluate(self, context):
return any((f.evaluate(context) for f in self.args))
class And(Function):
name = 'and'
min_args = 2
max_args = None
def evaluate(self, context):
return all((f.evaluate(context) for f in self.args))
class Not(Function):
name = 'not'
min_args = 1
max_args = 1
def evaluate(self, context):
return not self.args[0].evaluate(context)
class If(Function):
name = 'if'
min_args = 3
max_args = 3
def evaluate(self, context):
if self.args[0].evaluate(context):
return self.args[1].evaluate(context)
return self.args[2].evaluate(context)
class Constant(Function):
name = 'constant'
min_args = 1
max_args = 1
def evaluate(self, context):
return self.args[0]
def debug(self, context):
return '<constant({})>'.format(str(self.args[0]))
class Parammixin:
def _evaluate(self, context):
result = context
for item in self.path_items:
if hasattr(result, item):
result = getattr(result, item)
elif isinstance(result, dict):
result = result.get(item)
else:
return None
return result
class Param(Function, ParamMixin):
name = 'param'
min_args = 1
max_args = 1
def __init__(self, path):
super().__init__(path)
self.path_items = path.split('.')
def evaluate(self, context):
return self._evaluate(context)
class Paramwithdefault(Function, ParamMixin):
name = 'dparam'
min_args = 2
max_args = 2
def __init__(self, path, default):
super().__init__(path, default)
self.path_items = path.split('.')
self.default = default
def evaluate(self, context):
result = self._evaluate(context)
if result is None:
return self.default
return result
class Add(Function):
name = 'add'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) + self.args[1].evaluate(context)
class Subtract(Function):
name = 'subtract'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) - self.args[1].evaluate(context)
class Multiply(Function):
name = 'multiply'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) * self.args[1].evaluate(context)
class Divide(Function):
name = 'divide'
min_args = 2
max_args = 2
def evaluate(self, context):
return self.args[0].evaluate(context) / self.args[1].evaluate(context)
|
load("@bazel_skylib//lib:shell.bzl", "shell")
load("//:golink.bzl", "gen_copy_files_script")
def go_proto_link_impl(ctx, **kwargs):
print("Copying generated files for proto library %s" % ctx.attr.dep[OutputGroupInfo])
return gen_copy_files_script(ctx, ctx.attr.dep[OutputGroupInfo].go_generated_srcs.to_list())
_go_proto_link = rule(
implementation = go_proto_link_impl,
attrs = {
"dir": attr.string(),
"dep": attr.label(),
"_template": attr.label(
default = "//:copy_into_workspace.sh",
allow_single_file = True,
),
# It is not used, just used for versioning since this is experimental
"version": attr.string(),
},
)
def go_proto_link(name, **kwargs):
if not "dir" in kwargs:
dir = native.package_name()
kwargs["dir"] = dir
gen_rule_name = "%s_copy_gen" % name
_go_proto_link(name = gen_rule_name, **kwargs)
native.sh_binary(
name = name,
srcs = [":%s" % gen_rule_name]
)
|
load('@bazel_skylib//lib:shell.bzl', 'shell')
load('//:golink.bzl', 'gen_copy_files_script')
def go_proto_link_impl(ctx, **kwargs):
print('Copying generated files for proto library %s' % ctx.attr.dep[OutputGroupInfo])
return gen_copy_files_script(ctx, ctx.attr.dep[OutputGroupInfo].go_generated_srcs.to_list())
_go_proto_link = rule(implementation=go_proto_link_impl, attrs={'dir': attr.string(), 'dep': attr.label(), '_template': attr.label(default='//:copy_into_workspace.sh', allow_single_file=True), 'version': attr.string()})
def go_proto_link(name, **kwargs):
if not 'dir' in kwargs:
dir = native.package_name()
kwargs['dir'] = dir
gen_rule_name = '%s_copy_gen' % name
_go_proto_link(name=gen_rule_name, **kwargs)
native.sh_binary(name=name, srcs=[':%s' % gen_rule_name])
|
# -*- coding: utf-8 -*-
"""Responses.
responses serve both testing purpose aswell as dynamic docstring replacement.
"""
responses = {
"_v3_HistoricalPositions": {
"url": "/openapi/hist/v3/positions/{ClientKey}",
"params": {
'FromDate': '2019-03-01',
'ToDate': '2019-03-10'
},
"response": {
"Data": [
{
"AccountId": "112209INET",
"AccountValueEndOfDay": {
"AccountBalance": 7526.17183,
"CashTransfers": 0,
"Date": "2016-07-19",
"PositionsValue": -978.29753,
"SecurityTransfers": 0,
"TotalValue": 6547.8743
},
"Amount": -1,
"AmountAccountValueCloseRatio": "2:1",
"AmountAccountValueOpenRatio": "2:1",
"ClosingAssetType": "CfdOnIndex",
"ClosingTradeDate": "2016-07-19",
"ClosingValueDate": "2016-07-19",
"CopiedFrom": "1",
"CorrelationType": "None",
"Decimals": 2,
"ExecutionTimeClose": "2016-07-19T07:25:37.000000Z",
"ExecutionTimeOpen": "2016-07-18T10:38:06.000000Z",
"FigureValue": 1,
"InstrumentCcyToAccountCcyRateClose": 1.1020982542939,
"InstrumentCcyToAccountCcyRateOpen": 1.11308229426434,
"InstrumentSymbol": "GER30.I",
"LongShort": {
"PresentationValue": "Short",
"Value": "Short"
},
"OpeningAssetType": "CfdOnIndex",
"OpeningTradeDate": "2016-07-18",
"OpeningValueDate": "2016-07-18",
"PriceClose": 9998,
"PriceGain": 0.004778021102926538,
"PriceOpen": 10046,
"PricePct": -0.4778021102926538,
"ProfitLoss": 52.87,
"ProfitLossAccountValueFraction": 0.00807437613761156,
"Uic": "1373",
"ValueInAccountCurrencyClose": -11018.778346430412,
"ValueInAccountCurrencyOpen": -11182.02472817956
}
]
}
},
}
|
"""Responses.
responses serve both testing purpose aswell as dynamic docstring replacement.
"""
responses = {'_v3_HistoricalPositions': {'url': '/openapi/hist/v3/positions/{ClientKey}', 'params': {'FromDate': '2019-03-01', 'ToDate': '2019-03-10'}, 'response': {'Data': [{'AccountId': '112209INET', 'AccountValueEndOfDay': {'AccountBalance': 7526.17183, 'CashTransfers': 0, 'Date': '2016-07-19', 'PositionsValue': -978.29753, 'SecurityTransfers': 0, 'TotalValue': 6547.8743}, 'Amount': -1, 'AmountAccountValueCloseRatio': '2:1', 'AmountAccountValueOpenRatio': '2:1', 'ClosingAssetType': 'CfdOnIndex', 'ClosingTradeDate': '2016-07-19', 'ClosingValueDate': '2016-07-19', 'CopiedFrom': '1', 'CorrelationType': 'None', 'Decimals': 2, 'ExecutionTimeClose': '2016-07-19T07:25:37.000000Z', 'ExecutionTimeOpen': '2016-07-18T10:38:06.000000Z', 'FigureValue': 1, 'InstrumentCcyToAccountCcyRateClose': 1.1020982542939, 'InstrumentCcyToAccountCcyRateOpen': 1.11308229426434, 'InstrumentSymbol': 'GER30.I', 'LongShort': {'PresentationValue': 'Short', 'Value': 'Short'}, 'OpeningAssetType': 'CfdOnIndex', 'OpeningTradeDate': '2016-07-18', 'OpeningValueDate': '2016-07-18', 'PriceClose': 9998, 'PriceGain': 0.004778021102926538, 'PriceOpen': 10046, 'PricePct': -0.4778021102926538, 'ProfitLoss': 52.87, 'ProfitLossAccountValueFraction': 0.00807437613761156, 'Uic': '1373', 'ValueInAccountCurrencyClose': -11018.778346430412, 'ValueInAccountCurrencyOpen': -11182.02472817956}]}}}
|
#!/usr/bin/env python3
#!/usr/bin/env python
LIMIT = 32
dict1 = {}
def main():
squares()
a1 = 0
while a1 < LIMIT:
sums(a1)
a1 += 1
results()
def squares():
global dict1
for i1 in range(1, LIMIT * 2):
# print "%s" % str(i1)
s1 = i1 * i1
if not s1 in dict1:
dict1[s1] = []
dict1[s1].append(i1)
def results():
r1 = sorted(dict1.keys())
for k1 in r1:
v1 = dict1[k1]
print("%s %s" % (str(k1), str(sorted(v1))))
print("\nnot found")
l1 = len(r1)
lim1 = r1[l1 - 1]
for x1 in range(lim1):
if not x1 in r1:
print("%s not found" % str(x1))
def sums(l0):
global dict1
ret1 = False
for k1 in sorted(dict1.keys()):
v1 = dict1[k1]
for i1 in range(1, l0):
s1 = i1 * i1
t1 = s1 + k1
if not t1 in dict1 and not i1 in v1:
ret1 = True
dict1[t1] = []
dict1[t1].append(i1)
for p1 in v1:
dict1[t1].append(p1)
return ret1
main()
print("")
|
limit = 32
dict1 = {}
def main():
squares()
a1 = 0
while a1 < LIMIT:
sums(a1)
a1 += 1
results()
def squares():
global dict1
for i1 in range(1, LIMIT * 2):
s1 = i1 * i1
if not s1 in dict1:
dict1[s1] = []
dict1[s1].append(i1)
def results():
r1 = sorted(dict1.keys())
for k1 in r1:
v1 = dict1[k1]
print('%s %s' % (str(k1), str(sorted(v1))))
print('\nnot found')
l1 = len(r1)
lim1 = r1[l1 - 1]
for x1 in range(lim1):
if not x1 in r1:
print('%s not found' % str(x1))
def sums(l0):
global dict1
ret1 = False
for k1 in sorted(dict1.keys()):
v1 = dict1[k1]
for i1 in range(1, l0):
s1 = i1 * i1
t1 = s1 + k1
if not t1 in dict1 and (not i1 in v1):
ret1 = True
dict1[t1] = []
dict1[t1].append(i1)
for p1 in v1:
dict1[t1].append(p1)
return ret1
main()
print('\x07')
|
# -*-coding:utf-8-*-
__author__ = "Allen Woo"
DB_CONFIG = {
"redis": {
"host": [
"127.0.0.1"
],
"password": "<Your password>",
"port": [
"6379"
]
},
"mongodb": {
"web": {
"dbname": "osr_web",
"password": "<Your password>",
"config": {
"fsync": False,
"replica_set": None
},
"host": [
"127.0.0.1:27017"
],
"username": "root"
},
"user": {
"dbname": "osr_user",
"password": "<Your password>",
"config": {
"fsync": False,
"replica_set": None
},
"host": [
"127.0.0.1:27017"
],
"username": "root"
},
"sys": {
"dbname": "osr_sys",
"password": "<Your password>",
"config": {
"fsync": False,
"replica_set": None
},
"host": [
"127.0.0.1:27017"
],
"username": "root"
}
}
}
|
__author__ = 'Allen Woo'
db_config = {'redis': {'host': ['127.0.0.1'], 'password': '<Your password>', 'port': ['6379']}, 'mongodb': {'web': {'dbname': 'osr_web', 'password': '<Your password>', 'config': {'fsync': False, 'replica_set': None}, 'host': ['127.0.0.1:27017'], 'username': 'root'}, 'user': {'dbname': 'osr_user', 'password': '<Your password>', 'config': {'fsync': False, 'replica_set': None}, 'host': ['127.0.0.1:27017'], 'username': 'root'}, 'sys': {'dbname': 'osr_sys', 'password': '<Your password>', 'config': {'fsync': False, 'replica_set': None}, 'host': ['127.0.0.1:27017'], 'username': 'root'}}}
|
class NumArray:
def __init__(self):
self.__values = []
def __length_hint__(self):
print('__length_hint__', len(self.__values))
return len(self.__values)
n = NumArray()
print(len(n)) # TypeError: object of type 'NumArray' has no len()
|
class Numarray:
def __init__(self):
self.__values = []
def __length_hint__(self):
print('__length_hint__', len(self.__values))
return len(self.__values)
n = num_array()
print(len(n))
|
#!/usr/bin/env python
'''XML Namespace Constants'''
#
# This should actually check for a value error
#
def xs_bool(in_string):
'''Takes an XSD boolean value and converts it to a Python bool'''
if in_string in ['true', '1']:
return True
return False
|
"""XML Namespace Constants"""
def xs_bool(in_string):
"""Takes an XSD boolean value and converts it to a Python bool"""
if in_string in ['true', '1']:
return True
return False
|
''' teachers and centers are lists of Teacher objects and ExamCenter objects respectively
class Teacher and class ExamCentre and defined in locatable.py
Both are subclass of Locatable class
Link : https://github.com/aahnik/mapTeachersToCenters/blob/master/locatable.py '''
def sort(locatables, focal_centre):
# sorts the list of objects of type Locatable in ascending order of distance from a given focal_centre
# by using Insertion Sort algorithm
for i in range(1, len(locatables)):
key = locatables[i]
key_dist = key.get_distance(focal_centre)
j = i - 1
while j >= 0 and key_dist < locatables[j].get_distance(focal_centre):
locatables[j+1] = locatables[j]
j -= 1
locatables[j+1] = key
def connect(teachers, centers): # algorithm v2.0
for center in centers:
active_teachers = [t for t in teachers if t.allocated == False]
sort(active_teachers, center)
for teacher in active_teachers:
if center.vacancy == 0:
break
teacher.allocated = True
center.allocated_teachers.append(teacher)
center.vacancy -= 1
# def optimize(centers):
pass
# AAHNIK 2020
|
""" teachers and centers are lists of Teacher objects and ExamCenter objects respectively
class Teacher and class ExamCentre and defined in locatable.py
Both are subclass of Locatable class
Link : https://github.com/aahnik/mapTeachersToCenters/blob/master/locatable.py """
def sort(locatables, focal_centre):
for i in range(1, len(locatables)):
key = locatables[i]
key_dist = key.get_distance(focal_centre)
j = i - 1
while j >= 0 and key_dist < locatables[j].get_distance(focal_centre):
locatables[j + 1] = locatables[j]
j -= 1
locatables[j + 1] = key
def connect(teachers, centers):
for center in centers:
active_teachers = [t for t in teachers if t.allocated == False]
sort(active_teachers, center)
for teacher in active_teachers:
if center.vacancy == 0:
break
teacher.allocated = True
center.allocated_teachers.append(teacher)
center.vacancy -= 1
pass
|
list=[1,2,3.5,4,5]
print(list)
sum=0
for i in list:
sum=sum+i
sum/=i
print(sum)
|
list = [1, 2, 3.5, 4, 5]
print(list)
sum = 0
for i in list:
sum = sum + i
sum /= i
print(sum)
|
'''
PURPOSE
Analyze a string to check if it contains two of the same letter
in a row. Your function must return True if there are two identical
letters in a row in the string, and False otherwise.
EXAMPLE
The string "hello" has l twice in a row, while the string "nono"
does not have two identical letters in a row.
'''
def double_letters(input_str):
print('String: {}'.format(input_str))
# load in two letters at a time in for loop
for x in range(len(input_str)):
# check there are still two letters left to grab
if x+1 != len(input_str):
# get two letters
two_letters_str = input_str[x] + input_str[x+1]
# check for matching letters
if two_letters_str[0] == two_letters_str[1]:
print('This pair of letters match: {}'.format(two_letters_str))
return True
break
# if function actually makes it out of the loop without breaking
# no double letters have matched
print('String does not contain two of the same letter in a row')
return False
input_str = "hello"
# run the function
double_letters(input_str)
|
"""
PURPOSE
Analyze a string to check if it contains two of the same letter
in a row. Your function must return True if there are two identical
letters in a row in the string, and False otherwise.
EXAMPLE
The string "hello" has l twice in a row, while the string "nono"
does not have two identical letters in a row.
"""
def double_letters(input_str):
print('String: {}'.format(input_str))
for x in range(len(input_str)):
if x + 1 != len(input_str):
two_letters_str = input_str[x] + input_str[x + 1]
if two_letters_str[0] == two_letters_str[1]:
print('This pair of letters match: {}'.format(two_letters_str))
return True
break
print('String does not contain two of the same letter in a row')
return False
input_str = 'hello'
double_letters(input_str)
|
# Python Program to check if there is a
# negative weight cycle using Floyd Warshall Algorithm
# Number of vertices in the graph
V = 4
# Define Infinite as a large enough value. This
# value will be used for vertices not connected to each other
INF = 99999
# Returns true if graph has negative weight cycle else false.
def negCyclefloydWarshall(graph):
# dist[][] will be the output matrix that will
# finally have the shortest distances between every pair of vertices
dist=[[0 for i in range(V)]for j in range(V)]
# Initialize the solution matrix same as input
# graph matrix. Or we can say the initial values
# of shortest distances are based on shortest
# paths considering no intermediate vertex.
for i in range(4):
for j in range(V):
dist[i][j] = graph[i][j]
for item in dist:
print(item)
""" Add all vertices one by one to the set of
intermediate vertices.
---> Before start of a iteration,
we have shortest distances between all pairs
of vertices such that the shortest distances
consider only the vertices in set {0, 1, 2, .. k-1}
as intermediate vertices.
----> After the end of a iteration, vertex no. k is
added to the set of intermediate vertices and
the set becomes {0, 1, 2, .. k}"""
for k in range(V):
# Pick all vertices as source one by one
for i in range(V):
# Pick all vertices as destination for the
# above picked source
for j in range(V):
# If vertex k is on the shortest path from
# i to j, then update the value of dist[i][j]
if (dist[i][k] + dist[k][j]) < dist[i][j]:
dist[i][j] = dist[i][k] + dist[k][j]
# print(dist[i][j])
# print(dist)
# print('changed', dist[i][k])
# If distance of any vertex from itself
# becomes negative, then there is a negative weight cycle.
for item in dist:
print(item)
for i in range(V):
if (dist[i][i] < 0):
return True
return False
graph = [[0, 1, INF, INF], [INF, 0, -1, INF], [INF, INF, 0, -1], [-1, INF, INF, 0]]
if (negCyclefloydWarshall(graph)):
print("Yes")
else:
print("No")
|
v = 4
inf = 99999
def neg_cyclefloyd_warshall(graph):
dist = [[0 for i in range(V)] for j in range(V)]
for i in range(4):
for j in range(V):
dist[i][j] = graph[i][j]
for item in dist:
print(item)
' Add all vertices one by one to the set of \n intermediate vertices.\n ---> Before start of a iteration,\n we have shortest distances between all pairs\n of vertices such that the shortest distances\n consider only the vertices in set {0, 1, 2, .. k-1}\n as intermediate vertices.\n ----> After the end of a iteration, vertex no. k is \n added to the set of intermediate vertices and \n the set becomes {0, 1, 2, .. k}'
for k in range(V):
for i in range(V):
for j in range(V):
if dist[i][k] + dist[k][j] < dist[i][j]:
dist[i][j] = dist[i][k] + dist[k][j]
for item in dist:
print(item)
for i in range(V):
if dist[i][i] < 0:
return True
return False
graph = [[0, 1, INF, INF], [INF, 0, -1, INF], [INF, INF, 0, -1], [-1, INF, INF, 0]]
if neg_cyclefloyd_warshall(graph):
print('Yes')
else:
print('No')
|
limit = int(input())
current = int(input())
multiply = int(input())
day = 0
total = current
while total <= limit:
day += 1
current *= multiply
total += current
# print('on day', day, ',', current, 'people are infected. and the total is', total)
print(day)
|
limit = int(input())
current = int(input())
multiply = int(input())
day = 0
total = current
while total <= limit:
day += 1
current *= multiply
total += current
print(day)
|
train_sequence = ReportSequence(X_train, y_train)
validation_sequence = ReportSequence(X_valid, y_valid)
model = Sequential()
forward_layer = LSTM(300, return_sequences=True)
backward_layer = LSTM(300, go_backwards=True, return_sequences=True)
model.add(Bidirectional(forward_layer,
backward_layer=backward_layer,
input_shape=(None, feature_vector_dimension)))
model.add(Bidirectional(LSTM(30, return_sequences=True),
backward_layer=LSTM(30, go_backwards=True, return_sequences=True)))
model.add(Bidirectional(LSTM(3, return_sequences=True),
backward_layer=LSTM(3, go_backwards=True, return_sequences=True)))
model.add(GlobalAveragePooling1D())
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
accuracy_measurement = AccuracyMeasurement(model,
train_sequence,
validation_sequence,
accuracy_results_cv)
model.fit_generator(train_sequence,
epochs=20,
callbacks=[accuracy_measurement],
validation_data=validation_sequence)
|
train_sequence = report_sequence(X_train, y_train)
validation_sequence = report_sequence(X_valid, y_valid)
model = sequential()
forward_layer = lstm(300, return_sequences=True)
backward_layer = lstm(300, go_backwards=True, return_sequences=True)
model.add(bidirectional(forward_layer, backward_layer=backward_layer, input_shape=(None, feature_vector_dimension)))
model.add(bidirectional(lstm(30, return_sequences=True), backward_layer=lstm(30, go_backwards=True, return_sequences=True)))
model.add(bidirectional(lstm(3, return_sequences=True), backward_layer=lstm(3, go_backwards=True, return_sequences=True)))
model.add(global_average_pooling1_d())
model.add(dense(1, activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
accuracy_measurement = accuracy_measurement(model, train_sequence, validation_sequence, accuracy_results_cv)
model.fit_generator(train_sequence, epochs=20, callbacks=[accuracy_measurement], validation_data=validation_sequence)
|
# Code generated by font-to-py.py.
# Font: dsmb.ttf
version = '0.26'
def height():
return 16
def max_width():
return 9
def hmap():
return True
def reverse():
return False
def monospaced():
return False
def min_ch():
return 32
def max_ch():
return 126
_font =\
b'\x09\x00\x00\x00\x78\x00\x8c\x00\x0c\x00\x1c\x00\x38\x00\x30\x00'\
b'\x30\x00\x30\x00\x00\x00\x30\x00\x30\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\xc0\x00\xc0\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xcc\x00\xcc\x00\xcc\x00'\
b'\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x19\x00\x1b\x00'\
b'\x1b\x00\x7f\x80\x36\x00\x36\x00\x36\x00\xff\x00\x64\x00\x6c\x00'\
b'\x6c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x10\x00\x10\x00'\
b'\x7c\x00\xd4\x00\xd0\x00\xf0\x00\x7c\x00\x1e\x00\x16\x00\x16\x00'\
b'\xd6\x00\x7c\x00\x10\x00\x10\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x70\x00\x88\x00\x88\x00\x88\x00\x71\x80\x1e\x00\xe7\x00\x08\x80'\
b'\x08\x80\x08\x80\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x38\x00\x60\x00\x60\x00\x20\x00\x70\x00\x76\x00\xde\x00'\
b'\xde\x00\xdc\x00\xec\x00\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x30\x00\x60\x00\x60\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x60\x00\x60\x00\x30\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\xc0\x00\x60\x00\x60\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x60\x00\x60\x00'\
b'\xc0\x00\x00\x00\x00\x00\x09\x00\x00\x00\x10\x00\xd6\x00\x7c\x00'\
b'\x7c\x00\xd6\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00'\
b'\x18\x00\x18\x00\x18\x00\xff\x00\xff\x00\x18\x00\x18\x00\x18\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x00'\
b'\x60\x00\x60\x00\x60\x00\xc0\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\xf8\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x03\x00\x06\x00\x06\x00\x0c\x00\x0c\x00\x18\x00'\
b'\x18\x00\x30\x00\x30\x00\x60\x00\x60\x00\xc0\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x38\x00\x6c\x00\xc6\x00\xc6\x00\xd6\x00'\
b'\xd6\x00\xc6\x00\xc6\x00\xc6\x00\x6c\x00\x38\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\x70\x00\xb0\x00\x30\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\xfc\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x78\x00\x86\x00\x06\x00'\
b'\x06\x00\x0e\x00\x0c\x00\x1c\x00\x38\x00\x70\x00\xe0\x00\xfe\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x7c\x00\x86\x00'\
b'\x06\x00\x06\x00\x38\x00\x0c\x00\x06\x00\x06\x00\x06\x00\x8e\x00'\
b'\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x0c\x00'\
b'\x1c\x00\x3c\x00\x2c\x00\x6c\x00\xcc\x00\x8c\x00\xfe\x00\x0c\x00'\
b'\x0c\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xf8\x00\x8c\x00\x06\x00\x06\x00'\
b'\x06\x00\x8c\x00\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x38\x00\x64\x00\xc0\x00\xc0\x00\xfc\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\x46\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\xfe\x00\x06\x00\x0e\x00\x0c\x00\x0c\x00\x18\x00'\
b'\x18\x00\x38\x00\x30\x00\x30\x00\x60\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x7c\x00\xc6\x00\xc6\x00\xc6\x00\x38\x00'\
b'\x6c\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\x7c\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\x78\x00\xc4\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\x7e\x00\x06\x00\x06\x00\x4c\x00\x38\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x60\x00\x60\x00\x60\x00\x00\x00\x00\x00\x60\x00\x60\x00'\
b'\x60\x00\x60\x00\xc0\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00'\
b'\x00\x00\x01\x00\x0f\x00\x3c\x00\xe0\x00\xe0\x00\x3c\x00\x0f\x00'\
b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\xff\x00\xff\x00\x00\x00\x00\x00\xff\x00'\
b'\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x00\x00\x00\x00\x80\x00\xf0\x00\x3c\x00\x07\x00\x07\x00'\
b'\x3c\x00\xf0\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x78\x00\x8c\x00\x0c\x00\x1c\x00\x38\x00\x30\x00'\
b'\x30\x00\x30\x00\x00\x00\x30\x00\x30\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x00\x00\x1e\x00\x23\x00\x63\x00\xcf\x00'\
b'\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xcf\x00\x60\x00\x32\x00'\
b'\x1f\x00\x00\x00\x09\x00\x00\x00\x38\x00\x38\x00\x38\x00\x38\x00'\
b'\x6c\x00\x6c\x00\x6c\x00\x7c\x00\x6c\x00\xee\x00\xc6\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xf8\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xfc\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x3c\x00\x62\x00'\
b'\x40\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x40\x00\x62\x00'\
b'\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xf8\x00'\
b'\xcc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xcc\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\xfe\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\xfe\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x3c\x00\x62\x00\x40\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xce\x00\xc6\x00\xc6\x00\x66\x00\x3e\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xfe\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\xfc\x00\x30\x00\x30\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\xfc\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x3e\x00\x06\x00\x06\x00'\
b'\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x86\x00\x7c\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xc6\x00\xce\x00'\
b'\xdc\x00\xd8\x00\xf0\x00\xf8\x00\xfc\x00\xcc\x00\xce\x00\xc6\x00'\
b'\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\xee\x00\xee\x00\xee\x00\xee\x00\xee\x00\xfe\x00\xd6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\xe6\x00\xe6\x00\xe6\x00\xf6\x00\xf6\x00\xd6\x00\xde\x00'\
b'\xde\x00\xce\x00\xce\x00\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x38\x00\x6c\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\x6c\x00\x38\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\xfc\x00\xce\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xce\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\x38\x00\x6c\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x6c\x00\x3c\x00\x0c\x00'\
b'\x04\x00\x00\x00\x00\x00\x09\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xf8\x00\xcc\x00\xce\x00\xc6\x00\xc7\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x3c\x00\xc2\x00'\
b'\xc0\x00\xc0\x00\xf0\x00\x7c\x00\x1e\x00\x06\x00\x06\x00\x86\x00'\
b'\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xff\x00'\
b'\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00'\
b'\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\xc6\x00\xc6\x00\x6c\x00\x6c\x00\x6c\x00\x6c\x00\x6c\x00'\
b'\x28\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\xc1\x80\xc1\x80\xc1\x80\xdd\x80\xdd\x80\x5d\x00'\
b'\x55\x00\x55\x00\x77\x00\x63\x00\x63\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\xc6\x00\x6c\x00\x6c\x00\x38\x00\x38\x00'\
b'\x10\x00\x38\x00\x38\x00\x6c\x00\x6c\x00\xc6\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\xe7\x00\x66\x00\x66\x00\x3c\x00'\
b'\x3c\x00\x3c\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xfe\x00\x06\x00\x0e\x00'\
b'\x1c\x00\x18\x00\x38\x00\x30\x00\x60\x00\xe0\x00\xc0\x00\xfe\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xf0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xf0\x00\x00\x00\x00\x00\x09\x00\x00\x00\xc0\x00'\
b'\x40\x00\x60\x00\x20\x00\x30\x00\x30\x00\x18\x00\x18\x00\x08\x00'\
b'\x0c\x00\x04\x00\x06\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\xf0\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\xf0\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x18\x00\x3c\x00\x66\x00\xc3\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\xc0\x00\x60\x00\x30\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x00'\
b'\x46\x00\x06\x00\x7e\x00\xc6\x00\xc6\x00\xce\x00\x7e\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xfc\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\xfc\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x3c\x00\x62\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x62\x00'\
b'\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x06\x00'\
b'\x06\x00\x06\x00\x7e\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xee\x00\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x3c\x00\x46\x00\xc6\x00\xfe\x00\xc0\x00'\
b'\xc0\x00\x62\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x1e\x00\x30\x00\x30\x00\xfe\x00\x30\x00\x30\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7e\x00\x6e\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\x6e\x00\x7e\x00\x06\x00\x46\x00\x3c\x00'\
b'\x00\x00\x09\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x18\x00\x18\x00\x18\x00\x00\x00\x78\x00'\
b'\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\xff\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x09\x00\x18\x00\x18\x00\x18\x00\x00\x00'\
b'\x78\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00'\
b'\x18\x00\x18\x00\xf0\x00\x00\x00\x09\x00\x00\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xcc\x00\xd8\x00\xf0\x00\xf0\x00\xd8\x00\xd8\x00\xcc\x00'\
b'\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\xf0\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00'\
b'\x30\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\xff\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00'\
b'\xdb\x00\xdb\x00\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x6c\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\x6c\x00\x38\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\xee\x00'\
b'\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\xfc\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7e\x00'\
b'\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\x7e\x00\x06\x00'\
b'\x06\x00\x06\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\xfc\x00\xe0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x7c\x00\xc2\x00\xc0\x00\xf8\x00\x3e\x00\x06\x00\x86\x00'\
b'\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00'\
b'\x30\x00\x30\x00\xfe\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00'\
b'\x30\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00'\
b'\xc6\x00\xc6\x00\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00\xee\x00\x6c\x00\x6c\x00'\
b'\x6c\x00\x28\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc1\x80\xc1\x80\xc9\x80'\
b'\x5d\x00\x77\x00\x77\x00\x63\x00\x63\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\xee\x00\x6c\x00'\
b'\x38\x00\x38\x00\x38\x00\x3c\x00\x6c\x00\xee\x00\x00\x00\x00\x00'\
b'\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00'\
b'\x6e\x00\x6c\x00\x6c\x00\x3c\x00\x38\x00\x18\x00\x18\x00\x18\x00'\
b'\x30\x00\x70\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\xfe\x00\x06\x00\x0c\x00\x18\x00\x30\x00\x60\x00\xc0\x00\xfe\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x1c\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\xc0\x00\x30\x00\x30\x00'\
b'\x30\x00\x30\x00\x30\x00\x1c\x00\x00\x00\x09\x00\x00\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00'\
b'\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x09\x00\x00\x00'\
b'\xe0\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x0c\x00'\
b'\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\xe0\x00\x00\x00\x09\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x71\x00\xff\x00'\
b'\x8e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
_index =\
b'\x00\x00\x22\x00\x22\x00\x44\x00\x44\x00\x66\x00\x66\x00\x88\x00'\
b'\x88\x00\xaa\x00\xaa\x00\xcc\x00\xcc\x00\xee\x00\xee\x00\x10\x01'\
b'\x10\x01\x32\x01\x32\x01\x54\x01\x54\x01\x76\x01\x76\x01\x98\x01'\
b'\x98\x01\xba\x01\xba\x01\xdc\x01\xdc\x01\xfe\x01\xfe\x01\x20\x02'\
b'\x20\x02\x42\x02\x42\x02\x64\x02\x64\x02\x86\x02\x86\x02\xa8\x02'\
b'\xa8\x02\xca\x02\xca\x02\xec\x02\xec\x02\x0e\x03\x0e\x03\x30\x03'\
b'\x30\x03\x52\x03\x52\x03\x74\x03\x74\x03\x96\x03\x96\x03\xb8\x03'\
b'\xb8\x03\xda\x03\xda\x03\xfc\x03\xfc\x03\x1e\x04\x1e\x04\x40\x04'\
b'\x40\x04\x62\x04\x62\x04\x84\x04\x84\x04\xa6\x04\xa6\x04\xc8\x04'\
b'\xc8\x04\xea\x04\xea\x04\x0c\x05\x0c\x05\x2e\x05\x2e\x05\x50\x05'\
b'\x50\x05\x72\x05\x72\x05\x94\x05\x94\x05\xb6\x05\xb6\x05\xd8\x05'\
b'\xd8\x05\xfa\x05\xfa\x05\x1c\x06\x1c\x06\x3e\x06\x3e\x06\x60\x06'\
b'\x60\x06\x82\x06\x82\x06\xa4\x06\xa4\x06\xc6\x06\xc6\x06\xe8\x06'\
b'\xe8\x06\x0a\x07\x0a\x07\x2c\x07\x2c\x07\x4e\x07\x4e\x07\x70\x07'\
b'\x70\x07\x92\x07\x92\x07\xb4\x07\xb4\x07\xd6\x07\xd6\x07\xf8\x07'\
b'\xf8\x07\x1a\x08\x1a\x08\x3c\x08\x3c\x08\x5e\x08\x5e\x08\x80\x08'\
b'\x80\x08\xa2\x08\xa2\x08\xc4\x08\xc4\x08\xe6\x08\xe6\x08\x08\x09'\
b'\x08\x09\x2a\x09\x2a\x09\x4c\x09\x4c\x09\x6e\x09\x6e\x09\x90\x09'\
b'\x90\x09\xb2\x09\xb2\x09\xd4\x09\xd4\x09\xf6\x09\xf6\x09\x18\x0a'\
b'\x18\x0a\x3a\x0a\x3a\x0a\x5c\x0a\x5c\x0a\x7e\x0a\x7e\x0a\xa0\x0a'\
b'\xa0\x0a\xc2\x0a\xc2\x0a\xe4\x0a\xe4\x0a\x06\x0b\x06\x0b\x28\x0b'\
b'\x28\x0b\x4a\x0b\x4a\x0b\x6c\x0b\x6c\x0b\x8e\x0b\x8e\x0b\xb0\x0b'\
b'\xb0\x0b\xd2\x0b\xd2\x0b\xf4\x0b\xf4\x0b\x16\x0c\x16\x0c\x38\x0c'\
b'\x38\x0c\x5a\x0c\x5a\x0c\x7c\x0c\x7c\x0c\x9e\x0c\x9e\x0c\xc0\x0c'\
_mvfont = memoryview(_font)
def get_ch(ch):
ordch = ord(ch)
ordch = ordch + 1 if ordch >= 32 and ordch <= 126 else 63
idx_offs = 4 * (ordch - 32)
offset = int.from_bytes(_index[idx_offs : idx_offs + 2], 'little')
next_offs = int.from_bytes(_index[idx_offs + 2 : idx_offs + 4], 'little')
width = int.from_bytes(_font[offset:offset + 2], 'little')
return _mvfont[offset + 2:next_offs], 16, width
|
version = '0.26'
def height():
return 16
def max_width():
return 9
def hmap():
return True
def reverse():
return False
def monospaced():
return False
def min_ch():
return 32
def max_ch():
return 126
_font = b'\t\x00\x00\x00x\x00\x8c\x00\x0c\x00\x1c\x008\x000\x000\x000\x00\x00\x000\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xcc\x00\xcc\x00\xcc\x00\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x19\x00\x1b\x00\x1b\x00\x7f\x806\x006\x006\x00\xff\x00d\x00l\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x10\x00\x10\x00|\x00\xd4\x00\xd0\x00\xf0\x00|\x00\x1e\x00\x16\x00\x16\x00\xd6\x00|\x00\x10\x00\x10\x00\x00\x00\x00\x00\t\x00\x00\x00p\x00\x88\x00\x88\x00\x88\x00q\x80\x1e\x00\xe7\x00\x08\x80\x08\x80\x08\x80\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x008\x00`\x00`\x00 \x00p\x00v\x00\xde\x00\xde\x00\xdc\x00\xec\x00~\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x000\x00`\x00`\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00`\x00`\x000\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00`\x00`\x000\x000\x000\x000\x000\x000\x000\x00`\x00`\x00\xc0\x00\x00\x00\x00\x00\t\x00\x00\x00\x10\x00\xd6\x00|\x00|\x00\xd6\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\xff\x00\xff\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00`\x00`\x00`\x00\xc0\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x03\x00\x06\x00\x06\x00\x0c\x00\x0c\x00\x18\x00\x18\x000\x000\x00`\x00`\x00\xc0\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x008\x00l\x00\xc6\x00\xc6\x00\xd6\x00\xd6\x00\xc6\x00\xc6\x00\xc6\x00l\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00p\x00\xb0\x000\x000\x000\x000\x000\x000\x000\x000\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00x\x00\x86\x00\x06\x00\x06\x00\x0e\x00\x0c\x00\x1c\x008\x00p\x00\xe0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00|\x00\x86\x00\x06\x00\x06\x008\x00\x0c\x00\x06\x00\x06\x00\x06\x00\x8e\x00x\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x0c\x00\x1c\x00<\x00,\x00l\x00\xcc\x00\x8c\x00\xfe\x00\x0c\x00\x0c\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xf8\x00\x8c\x00\x06\x00\x06\x00\x06\x00\x8c\x00x\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x008\x00d\x00\xc0\x00\xc0\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00F\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfe\x00\x06\x00\x0e\x00\x0c\x00\x0c\x00\x18\x00\x18\x008\x000\x000\x00`\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00|\x00\xc6\x00\xc6\x00\xc6\x008\x00l\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00x\x00\xc4\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00~\x00\x06\x00\x06\x00L\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00`\x00`\x00\x00\x00\x00\x00`\x00`\x00`\x00`\x00\xc0\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x01\x00\x0f\x00<\x00\xe0\x00\xe0\x00<\x00\x0f\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xff\x00\x00\x00\x00\x00\xff\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x80\x00\xf0\x00<\x00\x07\x00\x07\x00<\x00\xf0\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00x\x00\x8c\x00\x0c\x00\x1c\x008\x000\x000\x000\x00\x00\x000\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x1e\x00#\x00c\x00\xcf\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xcf\x00`\x002\x00\x1f\x00\x00\x00\t\x00\x00\x008\x008\x008\x008\x00l\x00l\x00l\x00|\x00l\x00\xee\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xf8\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00<\x00b\x00@\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00@\x00b\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xf8\x00\xcc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xcc\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfe\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfe\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00<\x00b\x00@\x00\xc0\x00\xc0\x00\xc0\x00\xce\x00\xc6\x00\xc6\x00f\x00>\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xfe\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfc\x000\x000\x000\x000\x000\x000\x000\x000\x000\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00>\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x86\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc6\x00\xce\x00\xdc\x00\xd8\x00\xf0\x00\xf8\x00\xfc\x00\xcc\x00\xce\x00\xc6\x00\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xee\x00\xee\x00\xee\x00\xee\x00\xee\x00\xfe\x00\xd6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xe6\x00\xe6\x00\xe6\x00\xf6\x00\xf6\x00\xd6\x00\xde\x00\xde\x00\xce\x00\xce\x00\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x008\x00l\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00l\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfc\x00\xce\x00\xc6\x00\xc6\x00\xc6\x00\xce\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x008\x00l\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00l\x00<\x00\x0c\x00\x04\x00\x00\x00\x00\x00\t\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xf8\x00\xcc\x00\xce\x00\xc6\x00\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00<\x00\xc2\x00\xc0\x00\xc0\x00\xf0\x00|\x00\x1e\x00\x06\x00\x06\x00\x86\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xff\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc6\x00\xc6\x00l\x00l\x00l\x00l\x00l\x00(\x008\x008\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc1\x80\xc1\x80\xc1\x80\xdd\x80\xdd\x80]\x00U\x00U\x00w\x00c\x00c\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc6\x00l\x00l\x008\x008\x00\x10\x008\x008\x00l\x00l\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xe7\x00f\x00f\x00<\x00<\x00<\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xfe\x00\x06\x00\x0e\x00\x1c\x00\x18\x008\x000\x00`\x00\xe0\x00\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xf0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xf0\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00@\x00`\x00 \x000\x000\x00\x18\x00\x18\x00\x08\x00\x0c\x00\x04\x00\x06\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xf0\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x00\xf0\x00\x00\x00\x00\x00\t\x00\x00\x00\x18\x00<\x00f\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x00\x00\t\x00\xc0\x00`\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00F\x00\x06\x00~\x00\xc6\x00\xc6\x00\xce\x00~\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00b\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00b\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x06\x00\x06\x00\x06\x00~\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00~\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00F\x00\xc6\x00\xfe\x00\xc0\x00\xc0\x00b\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x1e\x000\x000\x00\xfe\x000\x000\x000\x000\x000\x000\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00~\x00n\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00n\x00~\x00\x06\x00F\x00<\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x18\x00\x18\x00\x18\x00\x00\x00x\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x18\x00\x18\x00\x18\x00\x00\x00x\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\xf0\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xcc\x00\xd8\x00\xf0\x00\xf0\x00\xd8\x00\xd8\x00\xcc\x00\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\xf0\x000\x000\x000\x000\x000\x000\x000\x000\x000\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x008\x00l\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00l\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00\xfc\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00~\x00\xee\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xee\x00~\x00\x06\x00\x06\x00\x06\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\xe0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00|\x00\xc2\x00\xc0\x00\xf8\x00>\x00\x06\x00\x86\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x000\x000\x00\xfe\x000\x000\x000\x000\x000\x000\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00\xc6\x00~\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00\xee\x00l\x00l\x00l\x00(\x008\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc1\x80\xc1\x80\xc9\x80]\x00w\x00w\x00c\x00c\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xee\x00l\x008\x008\x008\x00<\x00l\x00\xee\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00n\x00l\x00l\x00<\x008\x00\x18\x00\x18\x00\x18\x000\x00p\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\x00\x06\x00\x0c\x00\x18\x000\x00`\x00\xc0\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x1c\x000\x000\x000\x000\x000\x000\x00\xc0\x000\x000\x000\x000\x000\x00\x1c\x00\x00\x00\t\x00\x00\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\xc0\x00\t\x00\x00\x00\xe0\x000\x000\x000\x000\x000\x000\x00\x0c\x000\x000\x000\x000\x000\x00\xe0\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00q\x00\xff\x00\x8e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
_index = b'\x00\x00"\x00"\x00D\x00D\x00f\x00f\x00\x88\x00\x88\x00\xaa\x00\xaa\x00\xcc\x00\xcc\x00\xee\x00\xee\x00\x10\x01\x10\x012\x012\x01T\x01T\x01v\x01v\x01\x98\x01\x98\x01\xba\x01\xba\x01\xdc\x01\xdc\x01\xfe\x01\xfe\x01 \x02 \x02B\x02B\x02d\x02d\x02\x86\x02\x86\x02\xa8\x02\xa8\x02\xca\x02\xca\x02\xec\x02\xec\x02\x0e\x03\x0e\x030\x030\x03R\x03R\x03t\x03t\x03\x96\x03\x96\x03\xb8\x03\xb8\x03\xda\x03\xda\x03\xfc\x03\xfc\x03\x1e\x04\x1e\x04@\x04@\x04b\x04b\x04\x84\x04\x84\x04\xa6\x04\xa6\x04\xc8\x04\xc8\x04\xea\x04\xea\x04\x0c\x05\x0c\x05.\x05.\x05P\x05P\x05r\x05r\x05\x94\x05\x94\x05\xb6\x05\xb6\x05\xd8\x05\xd8\x05\xfa\x05\xfa\x05\x1c\x06\x1c\x06>\x06>\x06`\x06`\x06\x82\x06\x82\x06\xa4\x06\xa4\x06\xc6\x06\xc6\x06\xe8\x06\xe8\x06\n\x07\n\x07,\x07,\x07N\x07N\x07p\x07p\x07\x92\x07\x92\x07\xb4\x07\xb4\x07\xd6\x07\xd6\x07\xf8\x07\xf8\x07\x1a\x08\x1a\x08<\x08<\x08^\x08^\x08\x80\x08\x80\x08\xa2\x08\xa2\x08\xc4\x08\xc4\x08\xe6\x08\xe6\x08\x08\t\x08\t*\t*\tL\tL\tn\tn\t\x90\t\x90\t\xb2\t\xb2\t\xd4\t\xd4\t\xf6\t\xf6\t\x18\n\x18\n:\n:\n\\\n\\\n~\n~\n\xa0\n\xa0\n\xc2\n\xc2\n\xe4\n\xe4\n\x06\x0b\x06\x0b(\x0b(\x0bJ\x0bJ\x0bl\x0bl\x0b\x8e\x0b\x8e\x0b\xb0\x0b\xb0\x0b\xd2\x0b\xd2\x0b\xf4\x0b\xf4\x0b\x16\x0c\x16\x0c8\x0c8\x0cZ\x0cZ\x0c|\x0c|\x0c\x9e\x0c\x9e\x0c\xc0\x0c'
_mvfont = memoryview(_font)
def get_ch(ch):
ordch = ord(ch)
ordch = ordch + 1 if ordch >= 32 and ordch <= 126 else 63
idx_offs = 4 * (ordch - 32)
offset = int.from_bytes(_index[idx_offs:idx_offs + 2], 'little')
next_offs = int.from_bytes(_index[idx_offs + 2:idx_offs + 4], 'little')
width = int.from_bytes(_font[offset:offset + 2], 'little')
return (_mvfont[offset + 2:next_offs], 16, width)
|
orgM = cmds.ls(sl=1,fl=1)
newM = cmds.ls(sl=1,fl=1)
for nm in newM:
for om in orgM:
if nm.split(':')[0] == om.split(':')[0]+'1':
trans = cmds.xform(om,ws=1,piv=1,q=1)
rot = cmds.xform(om,ws=1,ro=1,q=1)
cmds.xform(nm,t=trans[0:3],ro=rot)
cmds.namespace(ren=((nm.split(':')[0]),(nm.split(':')[1])))
|
org_m = cmds.ls(sl=1, fl=1)
new_m = cmds.ls(sl=1, fl=1)
for nm in newM:
for om in orgM:
if nm.split(':')[0] == om.split(':')[0] + '1':
trans = cmds.xform(om, ws=1, piv=1, q=1)
rot = cmds.xform(om, ws=1, ro=1, q=1)
cmds.xform(nm, t=trans[0:3], ro=rot)
cmds.namespace(ren=(nm.split(':')[0], nm.split(':')[1]))
|
class Solution:
def isValid(self, s: str):
count = 0
for i in s:
if i == '(':
count += 1
if i == ')':
count -=1
if count < 0:
return False
return count == 0
def removeInvalidParentheses(self, s: str) -> List[str]:
answers = set()
queue = [s]
visited = set()
while len(queue) > 0:
item = queue.pop(0)
if item in visited:
continue
if self.isValid(item):
answers.add(item)
if len(answers)>0:
continue
for i in range(len(item)):
if item[i] not in '()':
continue
l = list(item)
del(l[i])
string = "".join(l)
queue.append(string)
visited.add(item)
return list(answers)
|
class Solution:
def is_valid(self, s: str):
count = 0
for i in s:
if i == '(':
count += 1
if i == ')':
count -= 1
if count < 0:
return False
return count == 0
def remove_invalid_parentheses(self, s: str) -> List[str]:
answers = set()
queue = [s]
visited = set()
while len(queue) > 0:
item = queue.pop(0)
if item in visited:
continue
if self.isValid(item):
answers.add(item)
if len(answers) > 0:
continue
for i in range(len(item)):
if item[i] not in '()':
continue
l = list(item)
del l[i]
string = ''.join(l)
queue.append(string)
visited.add(item)
return list(answers)
|
"""
Let's reverse engineer the process.
Imagine you are standing at the last index i
index i-1 will need the value>=1 to go to i (step_need=1)
index i-2 will need the value>=2 to go to i (step_need=2)
...
At a certain index x, the value>=step_need
This means that, from x, we can go to i no problem.
Now we are standing at x and reset step_need to 0.
See if we can repeat the process until we reach the first index.
"""
class Solution(object):
def canJump(self, nums):
step_need = 0
for num in reversed(nums[:-1]):
step_need+=1
if num>=step_need:
step_need = 0
return step_need==0
|
"""
Let's reverse engineer the process.
Imagine you are standing at the last index i
index i-1 will need the value>=1 to go to i (step_need=1)
index i-2 will need the value>=2 to go to i (step_need=2)
...
At a certain index x, the value>=step_need
This means that, from x, we can go to i no problem.
Now we are standing at x and reset step_need to 0.
See if we can repeat the process until we reach the first index.
"""
class Solution(object):
def can_jump(self, nums):
step_need = 0
for num in reversed(nums[:-1]):
step_need += 1
if num >= step_need:
step_need = 0
return step_need == 0
|
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'chromium_tests',
'depot_tools/tryserver',
'recipe_engine/platform',
'recipe_engine/properties',
]
def RunSteps(api):
tests = []
if api.properties.get('local_gtest'):
tests.append(api.chromium_tests.steps.LocalGTestTest('base_unittests'))
if api.properties.get('swarming_gtest'):
tests.append(api.chromium_tests.steps.SwarmingGTestTest('base_unittests'))
if api.tryserver.is_tryserver:
bot_config = api.chromium_tests.trybots[
api.properties['mastername']]['builders'][api.properties['buildername']]
bot_config_object = api.chromium_tests.create_generalized_bot_config_object(
bot_config['bot_ids'])
else:
bot_config_object = api.chromium_tests.create_bot_config_object(
api.properties['mastername'], api.properties['buildername'])
api.chromium_tests.configure_build(bot_config_object)
with api.chromium_tests.wrap_chromium_tests(bot_config_object, tests=tests):
pass
def GenTests(api):
yield (
api.test('require_device_steps') +
api.properties.tryserver(
mastername='tryserver.chromium.android',
buildername='android_blink_rel',
local_gtest=True)
)
yield (
api.test('no_require_device_steps') +
api.properties.generic(
mastername='chromium.linux',
buildername='Android Tests')
)
yield (
api.test('win') +
api.platform.name('win') +
api.properties.tryserver(
mastername='tryserver.chromium.win',
buildername='win_chromium_rel_ng')
)
yield (
api.test('isolated_targets') +
api.properties.generic(
mastername='chromium.linux',
buildername='Linux Tests',
swarming_gtest=True)
)
|
deps = ['chromium_tests', 'depot_tools/tryserver', 'recipe_engine/platform', 'recipe_engine/properties']
def run_steps(api):
tests = []
if api.properties.get('local_gtest'):
tests.append(api.chromium_tests.steps.LocalGTestTest('base_unittests'))
if api.properties.get('swarming_gtest'):
tests.append(api.chromium_tests.steps.SwarmingGTestTest('base_unittests'))
if api.tryserver.is_tryserver:
bot_config = api.chromium_tests.trybots[api.properties['mastername']]['builders'][api.properties['buildername']]
bot_config_object = api.chromium_tests.create_generalized_bot_config_object(bot_config['bot_ids'])
else:
bot_config_object = api.chromium_tests.create_bot_config_object(api.properties['mastername'], api.properties['buildername'])
api.chromium_tests.configure_build(bot_config_object)
with api.chromium_tests.wrap_chromium_tests(bot_config_object, tests=tests):
pass
def gen_tests(api):
yield (api.test('require_device_steps') + api.properties.tryserver(mastername='tryserver.chromium.android', buildername='android_blink_rel', local_gtest=True))
yield (api.test('no_require_device_steps') + api.properties.generic(mastername='chromium.linux', buildername='Android Tests'))
yield (api.test('win') + api.platform.name('win') + api.properties.tryserver(mastername='tryserver.chromium.win', buildername='win_chromium_rel_ng'))
yield (api.test('isolated_targets') + api.properties.generic(mastername='chromium.linux', buildername='Linux Tests', swarming_gtest=True))
|
# -*- coding: utf-8 -*-
description = 'detectors'
group = 'lowlevel' # is included by panda.py
devices = dict(
mcstas = device('nicos_virt_mlz.panda.devices.mcstas.PandaSimulation',
description = 'McStas simulation',
),
timer = device('nicos.devices.mcstas.McStasTimer',
mcstas = 'mcstas',
visibility = (),
),
mon1 = device('nicos.devices.mcstas.McStasCounter',
type = 'monitor',
mcstas = 'mcstas',
mcstasfile = 'PSD_mon1.psd',
fmtstr = '%d',
visibility = (),
),
mon2 = device('nicos.devices.mcstas.McStasCounter',
type = 'monitor',
mcstas = 'mcstas',
mcstasfile = 'PSD_mon2.psd',
fmtstr = '%d',
visibility = (),
),
det1 = device('nicos.devices.mcstas.McStasCounter',
type = 'counter',
mcstas = 'mcstas',
mcstasfile = 'PSD_det2.psd', # correct: in reality det1 is behind det2
fmtstr = '%d',
visibility = (),
),
det2 = device('nicos.devices.mcstas.McStasCounter',
type = 'counter',
mcstas = 'mcstas',
mcstasfile = 'PSD_det1.psd',
fmtstr = '%d',
visibility = (),
),
det = device('nicos.devices.generic.Detector',
description = 'combined four channel single counter detector',
timers = ['timer'],
monitors = ['mon1', 'mon2'],
counters = ['det1', 'det2'],
images = [],
maxage = 1,
pollinterval = 1,
),
)
startupcode = '''
SetDetectors(det)
'''
|
description = 'detectors'
group = 'lowlevel'
devices = dict(mcstas=device('nicos_virt_mlz.panda.devices.mcstas.PandaSimulation', description='McStas simulation'), timer=device('nicos.devices.mcstas.McStasTimer', mcstas='mcstas', visibility=()), mon1=device('nicos.devices.mcstas.McStasCounter', type='monitor', mcstas='mcstas', mcstasfile='PSD_mon1.psd', fmtstr='%d', visibility=()), mon2=device('nicos.devices.mcstas.McStasCounter', type='monitor', mcstas='mcstas', mcstasfile='PSD_mon2.psd', fmtstr='%d', visibility=()), det1=device('nicos.devices.mcstas.McStasCounter', type='counter', mcstas='mcstas', mcstasfile='PSD_det2.psd', fmtstr='%d', visibility=()), det2=device('nicos.devices.mcstas.McStasCounter', type='counter', mcstas='mcstas', mcstasfile='PSD_det1.psd', fmtstr='%d', visibility=()), det=device('nicos.devices.generic.Detector', description='combined four channel single counter detector', timers=['timer'], monitors=['mon1', 'mon2'], counters=['det1', 'det2'], images=[], maxage=1, pollinterval=1))
startupcode = '\nSetDetectors(det)\n'
|
n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
# Add your function here
def flatten(lists):
results = []
for i in range(len(lists)):
for j in range(len(lists[i])):
results.append(lists[i][j])
return results
print(flatten(n))
|
n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
def flatten(lists):
results = []
for i in range(len(lists)):
for j in range(len(lists[i])):
results.append(lists[i][j])
return results
print(flatten(n))
|
age=int(input())
washing_machine_price=float(input())
toys_price=float(input())
toys_count = 0
money_amount = 0
for years in range(1,age+1):
if years % 2 == 0:
#price
money_amount += years / 2 * 10
money_amount-=1
else:
#toy
toys_count+=1
toys_price=toys_count*toys_price
total_amount = toys_price+money_amount
if total_amount>=washing_machine_price:
print(f'Yes! {total_amount - washing_machine_price:.2f}')
else:
print(f'No! {washing_machine_price- total_amount:.2f}')
|
age = int(input())
washing_machine_price = float(input())
toys_price = float(input())
toys_count = 0
money_amount = 0
for years in range(1, age + 1):
if years % 2 == 0:
money_amount += years / 2 * 10
money_amount -= 1
else:
toys_count += 1
toys_price = toys_count * toys_price
total_amount = toys_price + money_amount
if total_amount >= washing_machine_price:
print(f'Yes! {total_amount - washing_machine_price:.2f}')
else:
print(f'No! {washing_machine_price - total_amount:.2f}')
|
#!/usr/bin/env python
"""Parse arguments for functions in the wmem package.
"""
def parse_common(parser):
parser.add_argument(
'-D', '--dataslices',
nargs='*',
type=int,
help="""
Data slices, specified as triplets of <start> <stop> <step>;
setting any <stop> to 0 or will select the full extent;
provide triplets in the order of the input dataset.
"""
)
parser.add_argument(
'-M', '--usempi',
action='store_true',
help='use mpi4py'
)
parser.add_argument(
'-S', '--save_steps',
action='store_true',
help='save intermediate results'
)
parser.add_argument(
'-P', '--protective',
action='store_true',
help='protect against overwriting data'
)
parser.add_argument(
'--blocksize',
nargs='*',
type=int,
default=[],
help='size of the datablock'
)
parser.add_argument(
'--blockmargin',
nargs='*',
type=int,
default=[],
help='the datablock overlap used'
)
parser.add_argument(
'--blockrange',
nargs=2,
type=int,
default=[],
help='a range of blocks to process'
)
return parser
def parse_downsample_slices(parser):
parser.add_argument(
'inputdir',
help='a directory with images'
)
parser.add_argument(
'outputdir',
help='the output directory'
)
parser.add_argument(
'-r', '--regex',
default='*.tif',
help='regular expression to select files'
)
parser.add_argument(
'-f', '--downsample_factor',
type=int,
default=4,
help='the factor to downsample the images by'
)
return parser
def parse_series2stack(parser):
parser.add_argument(
'inputpath',
help='a directory with images'
)
parser.add_argument(
'outputpath',
help='the path to the output dataset'
)
parser.add_argument(
'-d', '--datatype',
default=None,
help='the numpy-style output datatype'
)
parser.add_argument(
'-i', '--inlayout',
default=None,
help='the data layout of the input'
)
parser.add_argument(
'-o', '--outlayout',
default=None,
help='the data layout for output'
)
parser.add_argument(
'-e', '--element_size_um',
nargs='*',
type=float,
default=[],
help='dataset element sizes in the order of outlayout'
)
parser.add_argument(
'-s', '--chunksize',
type=int,
nargs='*',
default=[],
help='hdf5 chunk sizes in the order of outlayout'
)
return parser
def parse_stack2stack(parser):
parser.add_argument(
'inputpath',
help='the inputfile'
)
parser.add_argument(
'outputpath',
help='the outputfile'
)
parser.add_argument(
'-p', '--dset_name',
default='',
help='the identifier of the datablock'
)
parser.add_argument(
'-b', '--blockoffset',
type=int,
default=[0, 0, 0],
nargs='*',
help='...'
)
parser.add_argument(
'-s', '--chunksize',
type=int,
nargs='*',
help='hdf5 chunk sizes (in order of outlayout)'
)
parser.add_argument(
'-e', '--element_size_um',
type=float,
nargs='*',
help='dataset element sizes (in order of outlayout)'
)
parser.add_argument(
'-i', '--inlayout',
default=None,
help='the data layout of the input'
)
parser.add_argument(
'-o', '--outlayout',
default=None,
help='the data layout for output'
)
parser.add_argument(
'-d', '--datatype',
default=None,
help='the numpy-style output datatype'
)
parser.add_argument(
'-u', '--uint8conv',
action='store_true',
help='convert data to uint8'
)
return parser
def parse_prob2mask(parser):
parser.add_argument(
'inputpath',
help='the path to the input dataset'
)
parser.add_argument(
'outputpath',
default='',
help='the path to the output dataset'
)
# parser.add_argument(
# '-i', '--inputmask',
# nargs=2,
# default=None,
# help='additional mask to apply to the output'
# )
parser.add_argument(
'-l', '--lower_threshold',
type=float,
default=0,
help='the lower threshold to apply to the dataset'
)
parser.add_argument(
'-u', '--upper_threshold',
type=float,
default=1,
help='the lower threshold to apply to the dataset'
)
parser.add_argument(
'-j', '--step',
type=float,
default=0.0,
help='multiple lower thresholds between 0 and 1 using this step'
)
parser.add_argument(
'-s', '--size',
type=int,
default=0,
help='remove any components smaller than this number of voxels'
)
parser.add_argument(
'-d', '--dilation',
type=int,
default=0,
help='perform a mask dilation with a disk/ball-shaped selem of this size'
)
parser.add_argument(
'-g', '--go2D',
action='store_true',
help='process as 2D slices'
)
return parser
def parse_splitblocks(parser):
parser.add_argument(
'inputpath',
help='the path to the input dataset'
)
parser.add_argument(
'-d', '--dset_name',
default='',
help='the name of the input dataset'
)
parser.add_argument(
'-s', '--chunksize',
type=int,
nargs='*',
help='hdf5 chunk sizes (in order of outlayout)'
)
parser.add_argument(
'-o', '--outlayout',
default=None,
help='the data layout for output'
)
parser.add_argument(
'--outputpath',
default='',
help="""path to the output directory"""
)
return parser
def parse_mergeblocks(parser):
parser.add_argument(
'inputfiles',
nargs='*',
help="""paths to hdf5 datasets <filepath>.h5/<...>/<dataset>:
datasets to merge together"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
merged dataset"""
)
parser.add_argument(
'-b', '--blockoffset',
nargs=3,
type=int,
default=[0, 0, 0],
help='offset of the datablock'
)
parser.add_argument(
'-s', '--fullsize',
nargs=3,
type=int,
default=[],
help='the size of the full dataset'
)
parser.add_argument(
'-l', '--is_labelimage',
action='store_true',
help='flag to indicate labelimage'
)
parser.add_argument(
'-r', '--relabel',
action='store_true',
help='apply incremental labeling to each block'
)
parser.add_argument(
'-n', '--neighbourmerge',
action='store_true',
help='merge overlapping labels'
)
parser.add_argument(
'-F', '--save_fwmap',
action='store_true',
help='save the forward map (.npy)'
)
parser.add_argument(
'-B', '--blockreduce',
nargs=3,
type=int,
default=[],
help='downsample the datablocks'
)
parser.add_argument(
'-f', '--func',
default='np.amax',
help='function used for downsampling'
)
parser.add_argument(
'-d', '--datatype',
default='',
help='the numpy-style output datatype'
)
return parser
def parse_downsample_blockwise(parser):
parser.add_argument(
'inputpath',
help='the path to the input dataset'
)
parser.add_argument(
'outputpath',
help='the path to the output dataset'
)
parser.add_argument(
'-B', '--blockreduce',
nargs='*',
type=int,
help='the blocksize'
)
parser.add_argument(
'-f', '--func',
default='np.amax',
help='the function to use for blockwise reduction'
)
parser.add_argument(
'-s', '--fullsize',
nargs=3,
type=int,
default=[],
help='the size of the full dataset'
)
return parser
def parse_connected_components(parser):
parser.add_argument(
'inputfile',
help='the path to the input dataset'
)
parser.add_argument(
'outputfile',
default='',
help='the path to the output dataset'
)
parser.add_argument(
'-m', '--mode',
help='...'
)
parser.add_argument(
'-b', '--basename',
default='',
help='...'
)
parser.add_argument(
'--maskDS',
default='',
help='...'
)
parser.add_argument(
'--maskMM',
default='',
help='...'
)
parser.add_argument(
'--maskMB',
default='',
help='...'
)
parser.add_argument(
'-d', '--slicedim',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-p', '--map_propnames',
nargs='*',
help='...'
)
parser.add_argument(
'-q', '--min_size_maskMM',
type=int,
default=None,
help='...'
)
parser.add_argument(
'-a', '--min_area',
type=int,
default=None,
help='...'
)
parser.add_argument(
'-A', '--max_area',
type=int,
default=None,
help='...'
)
parser.add_argument(
'-I', '--max_intensity_mb',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-E', '--max_eccentricity',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-e', '--min_euler_number',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-s', '--min_solidity',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-n', '--min_extent',
type=float,
default=None,
help='...'
)
return parser
def parse_connected_components_clf(parser):
parser.add_argument(
'classifierpath',
help='the path to the classifier'
)
parser.add_argument(
'scalerpath',
help='the path to the scaler'
)
parser.add_argument(
'-m', '--mode',
default='test',
help='...'
)
parser.add_argument(
'-i', '--inputfile',
default='',
help='the path to the input dataset'
)
parser.add_argument(
'-o', '--outputfile',
default='',
help='the path to the output dataset'
)
parser.add_argument(
'-a', '--maskfile',
default='',
help='the path to the output dataset'
)
parser.add_argument(
'-A', '--max_area',
type=int,
default=None,
help='...'
)
parser.add_argument(
'-I', '--max_intensity_mb',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-b', '--basename',
default='',
help='...'
)
parser.add_argument(
'-p', '--map_propnames',
nargs='*',
help='...'
)
return parser
def parse_merge_labels(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-d', '--slicedim',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-m', '--merge_method',
default='neighbours',
help='neighbours, conncomp, and/or watershed'
)
parser.add_argument(
'-s', '--min_labelsize',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-R', '--remove_small_labels',
action='store_true',
help='remove the small labels before further processing'
)
parser.add_argument(
'-q', '--offsets',
type=int,
default=2,
help='...'
)
parser.add_argument(
'-o', '--overlap_threshold',
type=float,
default=0.50,
help='for neighbours'
)
parser.add_argument(
'-r', '--searchradius',
nargs=3,
type=int,
default=[100, 30, 30],
help='for watershed'
)
parser.add_argument(
'--data',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--maskMM',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--maskDS',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_merge_slicelabels(parser):
parser.add_argument(
'inputfile',
help='the path to the input dataset'
)
parser.add_argument(
'outputfile',
default='',
help='the path to the output dataset'
)
parser.add_argument(
'--maskMM',
default='',
help='...'
)
parser.add_argument(
'-d', '--slicedim',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-m', '--mode',
help='...'
)
parser.add_argument(
'-p', '--do_map_labels',
action='store_true',
help='...'
)
parser.add_argument(
'-q', '--offsets',
type=int,
default=2,
help='...'
)
parser.add_argument(
'-o', '--threshold_overlap',
type=float,
default=None,
help='...'
)
parser.add_argument(
'-s', '--min_labelsize',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-l', '--close',
nargs='*',
type=int,
default=None,
help='...'
)
parser.add_argument(
'-r', '--relabel_from',
type=int,
default=0,
help='...'
)
return parser
def parse_fill_holes(parser):
parser.add_argument(
'inputfile',
help='the path to the input dataset'
)
parser.add_argument(
'outputfile',
default='',
help='the path to the output dataset'
)
parser.add_argument(
'-m', '--methods',
default="2",
help='method(s) used for filling holes'
) # TODO: document methods
parser.add_argument(
'-s', '--selem',
nargs='*',
type=int,
default=[3, 3, 3],
help='the structuring element used in methods 1, 2 & 3'
)
parser.add_argument(
'-l', '--labelmask',
default='',
help='the path to a mask: labelvolume[~labelmask] = 0'
)
parser.add_argument(
'--maskDS',
default='',
help='the path to a dataset mask'
)
parser.add_argument(
'--maskMM',
default='',
help='the path to a mask of the myelin compartment'
)
parser.add_argument(
'--maskMX',
default='',
help='the path to a mask of a low-thresholded myelin compartment'
)
parser.add_argument(
'--outputholes',
default='',
help='the path to the output dataset (filled holes)'
)
parser.add_argument(
'--outputMA',
default='',
help='the path to the output dataset (updated myel. axon mask)'
) # TODO: then need to update labelvolume as well?!
parser.add_argument(
'--outputMM',
default='',
help='the path to the output dataset (updated myelin mask)'
)
return parser
def parse_separate_sheaths(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with myelinated axon labels
used as seeds for watershed dilated with scipy's
<grey_dilation(<dataset>, size=[3, 3, 3])>"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with separated myelin sheaths"""
)
parser.add_argument(
'--maskWS',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
maskvolume of the myelin space
to which the watershed will be constrained"""
)
parser.add_argument(
'--maskDS',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
maskvolume of the data"""
)
parser.add_argument(
'--maskMM',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
maskvolume of the myelin compartment"""
)
parser.add_argument(
'-d', '--dilation_iterations',
type=int,
nargs='*',
default=[1, 7, 7],
help="""number of iterations for binary dilation
of the myelinated axon compartment
(as derived from inputfile):
it determines the maximal extent
the myelin sheath can be from the axon"""
)
parser.add_argument(
'--distance',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
distance map volume used in for watershed"""
)
parser.add_argument(
'--labelMM',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume used in calculating the median sheath thickness
of each sheath for the sigmoid-weighted distance map"""
)
parser.add_argument(
'-w', '--sigmoidweighting',
type=float,
help="""the steepness of the sigmoid
<scipy.special.expit(w * np.median(sheath_thickness)>"""
)
parser.add_argument(
'-m', '--margin',
type=int,
default=50,
help="""margin of the box used when calculating
the sigmoid-weighted distance map"""
)
parser.add_argument(
'--medwidth_file',
default='',
help="""pickle of dictionary with median widths {label: medwidth}"""
)
return parser
def parse_agglo_from_labelsets(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume of oversegmented supervoxels"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with agglomerated labels"""
)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
'-l', '--labelset_files',
nargs='*',
default=[],
help="""files with label mappings, either
A.) pickled python dictionary
{label_new1: [<label_1>, <label_2>, <...>],
label_new2: [<label_6>, <label_3>, <...>]}
B.) ascii files with on each line:
<label_new1>: <label_1> <label_2> <...>
<label_new2>: <label_6> <label_3> <...>"""
)
group.add_argument(
'-f', '--fwmap',
help="""numpy .npy file with vector of length np.amax(<labels>) + 1
representing the forward map to apply, e.g.
fwmap = np.array([0, 0, 4, 8, 8]) will map
the values 0, 1, 2, 3, 4 in the labelvolume
to the new values 0, 0, 4, 8, 8;
i.e. it will delete label 1, relabel label 2 to 4,
and merge labels 3 & 4 to new label value 8
"""
)
return parser
def parse_watershed_ics(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
input to the watershed algorithm"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with watershed oversegmentation"""
)
parser.add_argument(
'--mask_in',
default='',
help=""""""
)
parser.add_argument(
'--seedimage',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with seeds to the watershed"""
)
parser.add_argument(
'-l', '--lower_threshold',
type=float,
default=0.00,
help='the lower threshold for generating seeds from the dataset'
)
parser.add_argument(
'-u', '--upper_threshold',
type=float,
default=1.00,
help='the upper threshold for generating seeds from the dataset'
)
parser.add_argument(
'-s', '--seed_size',
type=int,
default=64,
help='the minimal size of a seed label'
)
parser.add_argument(
'-i', '--invert',
action='store_true',
help='invert the input volume'
)
return parser
def parse_agglo_from_labelmask(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume"""
)
parser.add_argument(
'oversegmentation',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume of oversegmented supervoxels"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with agglomerated labels"""
)
parser.add_argument(
'-r', '--ratio_threshold',
type=float,
default=0,
help='...'
)
parser.add_argument(
'-m', '--axon_mask',
action='store_true',
help='use axons as output mask'
)
return parser
def parse_remap_labels(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume with deleted/merged/split labels"""
)
parser.add_argument(
'-B', '--delete_labels',
nargs='*',
type=int,
default=[],
help='list of labels to delete'
)
parser.add_argument(
'-d', '--delete_files',
nargs='*',
default=[],
help='list of files with labelsets to delete'
)
parser.add_argument(
'--except_files',
nargs='*',
default=[],
help='...'
)
parser.add_argument(
'-E', '--merge_labels',
nargs='*',
type=int,
default=[],
help='list with pairs of labels to merge'
)
parser.add_argument(
'-e', '--merge_files',
nargs='*',
default=[],
help='list of files with labelsets to merge'
)
parser.add_argument(
'-F', '--split_labels',
nargs='*',
type=int,
default=[],
help='list of labels to split'
)
parser.add_argument(
'-f', '--split_files',
nargs='*',
default=[],
help='list of files with labelsets to split'
)
parser.add_argument(
'-A', '--aux_labelvolume',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
labelvolume from which to take alternative labels"""
)
parser.add_argument(
'-q', '--min_labelsize',
type=int,
default=0,
help='the minimum size of the labels'
)
parser.add_argument(
'-p', '--min_segmentsize',
type=int,
default=0,
help='the minimum segment size of non-contiguous labels'
)
parser.add_argument(
'-k', '--keep_only_largest',
action='store_true',
help='keep only the largest segment of a split label'
)
parser.add_argument(
'-O', '--conncomp',
action='store_true',
help='relabel split labels with connected component labeling'
)
parser.add_argument(
'-n', '--nifti_output',
action='store_true',
help='also write output to nifti'
)
parser.add_argument(
'-m', '--nifti_transpose',
action='store_true',
help='transpose the output before writing to nifti'
)
return parser
def parse_nodes_of_ranvier(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-s', '--min_labelsize',
type=int,
default=0,
help='...'
)
parser.add_argument(
'-R', '--remove_small_labels',
action='store_true',
help='remove the small labels before further processing'
)
parser.add_argument(
'--boundarymask',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-m', '--merge_methods',
nargs='*',
default=['neighbours'],
help='neighbours, conncomp, and/or watershed'
)
parser.add_argument(
'-o', '--overlap_threshold',
type=int,
default=20,
help='for neighbours'
)
parser.add_argument(
'-r', '--searchradius',
nargs=3,
type=int,
default=[100, 30, 30],
help='for watershed'
)
parser.add_argument(
'--data',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--maskMM',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_filter_NoR(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--input2D',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_convert_dm3(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--input2D',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_seg_stats(parser):
parser.add_argument(
'--h5path_labelMA',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--h5path_labelMF',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--h5path_labelUA',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--stats',
nargs='*',
default=['area', 'AD', 'centroid', 'eccentricity', 'solidity'],
help="""the statistics to export"""
)
parser.add_argument(
'--outputbasename',
help="""basename for the output"""
)
return parser
def parse_correct_attributes(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'auxfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_combine_vols(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-i', '--volidxs',
nargs='*',
type=int,
default=[],
help="""indices to the volumes"""
)
parser.add_argument(
'--bias_image',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_slicvoxels(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'--masks',
nargs='*',
default=[],
help="""string of paths to hdf5 datasets <filepath>.h5/<...>/<dataset>
and logical functions (NOT, AND, OR, XOR)
to add the hdf5 masks together
(NOT operates on the following dataset), e.g.
NOT <f1>.h5/<m1> AND <f1>.h5/<m2> will first invert m1,
then combine the result with m2 through the AND operator
starting point is np.ones(<in>.shape[:3], dtype='bool')"""
)
parser.add_argument(
'-l', '--slicvoxelsize',
type=int,
default=500,
help="""target size of the slicvoxels""",
)
parser.add_argument(
'-c', '--compactness',
type=float,
default=0.2,
help="""compactness of the slicvoxels""",
)
parser.add_argument(
'-s', '--sigma',
type=float,
default=1,
help='Gaussian smoothing sigma for preprocessing',
)
parser.add_argument(
'-e', '--enforce_connectivity',
action='store_true',
help='enforce connectivity of the slicvoxels',
)
return parser
def parse_image_ops(parser):
parser.add_argument(
'inputfile',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-s', '--sigma',
nargs='*',
type=float,
default=[0.0],
help='Gaussian smoothing sigma (in um)',
)
return parser
def parse_combine_labels(parser):
parser.add_argument(
'inputfile1',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'inputfile2',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
parser.add_argument(
'-m', '--method',
help="""add/subtract/merge/..."""
)
parser.add_argument(
'outputfile',
default='',
help="""path to hdf5 dataset <filepath>.h5/<...>/<dataset>:
"""
)
return parser
def parse_neuroblender(parser):
return parser
|
"""Parse arguments for functions in the wmem package.
"""
def parse_common(parser):
parser.add_argument('-D', '--dataslices', nargs='*', type=int, help='\n Data slices, specified as triplets of <start> <stop> <step>;\n setting any <stop> to 0 or will select the full extent;\n provide triplets in the order of the input dataset.\n ')
parser.add_argument('-M', '--usempi', action='store_true', help='use mpi4py')
parser.add_argument('-S', '--save_steps', action='store_true', help='save intermediate results')
parser.add_argument('-P', '--protective', action='store_true', help='protect against overwriting data')
parser.add_argument('--blocksize', nargs='*', type=int, default=[], help='size of the datablock')
parser.add_argument('--blockmargin', nargs='*', type=int, default=[], help='the datablock overlap used')
parser.add_argument('--blockrange', nargs=2, type=int, default=[], help='a range of blocks to process')
return parser
def parse_downsample_slices(parser):
parser.add_argument('inputdir', help='a directory with images')
parser.add_argument('outputdir', help='the output directory')
parser.add_argument('-r', '--regex', default='*.tif', help='regular expression to select files')
parser.add_argument('-f', '--downsample_factor', type=int, default=4, help='the factor to downsample the images by')
return parser
def parse_series2stack(parser):
parser.add_argument('inputpath', help='a directory with images')
parser.add_argument('outputpath', help='the path to the output dataset')
parser.add_argument('-d', '--datatype', default=None, help='the numpy-style output datatype')
parser.add_argument('-i', '--inlayout', default=None, help='the data layout of the input')
parser.add_argument('-o', '--outlayout', default=None, help='the data layout for output')
parser.add_argument('-e', '--element_size_um', nargs='*', type=float, default=[], help='dataset element sizes in the order of outlayout')
parser.add_argument('-s', '--chunksize', type=int, nargs='*', default=[], help='hdf5 chunk sizes in the order of outlayout')
return parser
def parse_stack2stack(parser):
parser.add_argument('inputpath', help='the inputfile')
parser.add_argument('outputpath', help='the outputfile')
parser.add_argument('-p', '--dset_name', default='', help='the identifier of the datablock')
parser.add_argument('-b', '--blockoffset', type=int, default=[0, 0, 0], nargs='*', help='...')
parser.add_argument('-s', '--chunksize', type=int, nargs='*', help='hdf5 chunk sizes (in order of outlayout)')
parser.add_argument('-e', '--element_size_um', type=float, nargs='*', help='dataset element sizes (in order of outlayout)')
parser.add_argument('-i', '--inlayout', default=None, help='the data layout of the input')
parser.add_argument('-o', '--outlayout', default=None, help='the data layout for output')
parser.add_argument('-d', '--datatype', default=None, help='the numpy-style output datatype')
parser.add_argument('-u', '--uint8conv', action='store_true', help='convert data to uint8')
return parser
def parse_prob2mask(parser):
parser.add_argument('inputpath', help='the path to the input dataset')
parser.add_argument('outputpath', default='', help='the path to the output dataset')
parser.add_argument('-l', '--lower_threshold', type=float, default=0, help='the lower threshold to apply to the dataset')
parser.add_argument('-u', '--upper_threshold', type=float, default=1, help='the lower threshold to apply to the dataset')
parser.add_argument('-j', '--step', type=float, default=0.0, help='multiple lower thresholds between 0 and 1 using this step')
parser.add_argument('-s', '--size', type=int, default=0, help='remove any components smaller than this number of voxels')
parser.add_argument('-d', '--dilation', type=int, default=0, help='perform a mask dilation with a disk/ball-shaped selem of this size')
parser.add_argument('-g', '--go2D', action='store_true', help='process as 2D slices')
return parser
def parse_splitblocks(parser):
parser.add_argument('inputpath', help='the path to the input dataset')
parser.add_argument('-d', '--dset_name', default='', help='the name of the input dataset')
parser.add_argument('-s', '--chunksize', type=int, nargs='*', help='hdf5 chunk sizes (in order of outlayout)')
parser.add_argument('-o', '--outlayout', default=None, help='the data layout for output')
parser.add_argument('--outputpath', default='', help='path to the output directory')
return parser
def parse_mergeblocks(parser):
parser.add_argument('inputfiles', nargs='*', help='paths to hdf5 datasets <filepath>.h5/<...>/<dataset>:\n datasets to merge together')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n merged dataset')
parser.add_argument('-b', '--blockoffset', nargs=3, type=int, default=[0, 0, 0], help='offset of the datablock')
parser.add_argument('-s', '--fullsize', nargs=3, type=int, default=[], help='the size of the full dataset')
parser.add_argument('-l', '--is_labelimage', action='store_true', help='flag to indicate labelimage')
parser.add_argument('-r', '--relabel', action='store_true', help='apply incremental labeling to each block')
parser.add_argument('-n', '--neighbourmerge', action='store_true', help='merge overlapping labels')
parser.add_argument('-F', '--save_fwmap', action='store_true', help='save the forward map (.npy)')
parser.add_argument('-B', '--blockreduce', nargs=3, type=int, default=[], help='downsample the datablocks')
parser.add_argument('-f', '--func', default='np.amax', help='function used for downsampling')
parser.add_argument('-d', '--datatype', default='', help='the numpy-style output datatype')
return parser
def parse_downsample_blockwise(parser):
parser.add_argument('inputpath', help='the path to the input dataset')
parser.add_argument('outputpath', help='the path to the output dataset')
parser.add_argument('-B', '--blockreduce', nargs='*', type=int, help='the blocksize')
parser.add_argument('-f', '--func', default='np.amax', help='the function to use for blockwise reduction')
parser.add_argument('-s', '--fullsize', nargs=3, type=int, default=[], help='the size of the full dataset')
return parser
def parse_connected_components(parser):
parser.add_argument('inputfile', help='the path to the input dataset')
parser.add_argument('outputfile', default='', help='the path to the output dataset')
parser.add_argument('-m', '--mode', help='...')
parser.add_argument('-b', '--basename', default='', help='...')
parser.add_argument('--maskDS', default='', help='...')
parser.add_argument('--maskMM', default='', help='...')
parser.add_argument('--maskMB', default='', help='...')
parser.add_argument('-d', '--slicedim', type=int, default=0, help='...')
parser.add_argument('-p', '--map_propnames', nargs='*', help='...')
parser.add_argument('-q', '--min_size_maskMM', type=int, default=None, help='...')
parser.add_argument('-a', '--min_area', type=int, default=None, help='...')
parser.add_argument('-A', '--max_area', type=int, default=None, help='...')
parser.add_argument('-I', '--max_intensity_mb', type=float, default=None, help='...')
parser.add_argument('-E', '--max_eccentricity', type=float, default=None, help='...')
parser.add_argument('-e', '--min_euler_number', type=float, default=None, help='...')
parser.add_argument('-s', '--min_solidity', type=float, default=None, help='...')
parser.add_argument('-n', '--min_extent', type=float, default=None, help='...')
return parser
def parse_connected_components_clf(parser):
parser.add_argument('classifierpath', help='the path to the classifier')
parser.add_argument('scalerpath', help='the path to the scaler')
parser.add_argument('-m', '--mode', default='test', help='...')
parser.add_argument('-i', '--inputfile', default='', help='the path to the input dataset')
parser.add_argument('-o', '--outputfile', default='', help='the path to the output dataset')
parser.add_argument('-a', '--maskfile', default='', help='the path to the output dataset')
parser.add_argument('-A', '--max_area', type=int, default=None, help='...')
parser.add_argument('-I', '--max_intensity_mb', type=float, default=None, help='...')
parser.add_argument('-b', '--basename', default='', help='...')
parser.add_argument('-p', '--map_propnames', nargs='*', help='...')
return parser
def parse_merge_labels(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-d', '--slicedim', type=int, default=0, help='...')
parser.add_argument('-m', '--merge_method', default='neighbours', help='neighbours, conncomp, and/or watershed')
parser.add_argument('-s', '--min_labelsize', type=int, default=0, help='...')
parser.add_argument('-R', '--remove_small_labels', action='store_true', help='remove the small labels before further processing')
parser.add_argument('-q', '--offsets', type=int, default=2, help='...')
parser.add_argument('-o', '--overlap_threshold', type=float, default=0.5, help='for neighbours')
parser.add_argument('-r', '--searchradius', nargs=3, type=int, default=[100, 30, 30], help='for watershed')
parser.add_argument('--data', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--maskMM', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--maskDS', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_merge_slicelabels(parser):
parser.add_argument('inputfile', help='the path to the input dataset')
parser.add_argument('outputfile', default='', help='the path to the output dataset')
parser.add_argument('--maskMM', default='', help='...')
parser.add_argument('-d', '--slicedim', type=int, default=0, help='...')
parser.add_argument('-m', '--mode', help='...')
parser.add_argument('-p', '--do_map_labels', action='store_true', help='...')
parser.add_argument('-q', '--offsets', type=int, default=2, help='...')
parser.add_argument('-o', '--threshold_overlap', type=float, default=None, help='...')
parser.add_argument('-s', '--min_labelsize', type=int, default=0, help='...')
parser.add_argument('-l', '--close', nargs='*', type=int, default=None, help='...')
parser.add_argument('-r', '--relabel_from', type=int, default=0, help='...')
return parser
def parse_fill_holes(parser):
parser.add_argument('inputfile', help='the path to the input dataset')
parser.add_argument('outputfile', default='', help='the path to the output dataset')
parser.add_argument('-m', '--methods', default='2', help='method(s) used for filling holes')
parser.add_argument('-s', '--selem', nargs='*', type=int, default=[3, 3, 3], help='the structuring element used in methods 1, 2 & 3')
parser.add_argument('-l', '--labelmask', default='', help='the path to a mask: labelvolume[~labelmask] = 0')
parser.add_argument('--maskDS', default='', help='the path to a dataset mask')
parser.add_argument('--maskMM', default='', help='the path to a mask of the myelin compartment')
parser.add_argument('--maskMX', default='', help='the path to a mask of a low-thresholded myelin compartment')
parser.add_argument('--outputholes', default='', help='the path to the output dataset (filled holes)')
parser.add_argument('--outputMA', default='', help='the path to the output dataset (updated myel. axon mask)')
parser.add_argument('--outputMM', default='', help='the path to the output dataset (updated myelin mask)')
return parser
def parse_separate_sheaths(parser):
parser.add_argument('inputfile', help="path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with myelinated axon labels\n used as seeds for watershed dilated with scipy's\n <grey_dilation(<dataset>, size=[3, 3, 3])>")
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with separated myelin sheaths')
parser.add_argument('--maskWS', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n maskvolume of the myelin space\n to which the watershed will be constrained')
parser.add_argument('--maskDS', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n maskvolume of the data')
parser.add_argument('--maskMM', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n maskvolume of the myelin compartment')
parser.add_argument('-d', '--dilation_iterations', type=int, nargs='*', default=[1, 7, 7], help='number of iterations for binary dilation\n of the myelinated axon compartment\n (as derived from inputfile):\n it determines the maximal extent\n the myelin sheath can be from the axon')
parser.add_argument('--distance', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n distance map volume used in for watershed')
parser.add_argument('--labelMM', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume used in calculating the median sheath thickness\n of each sheath for the sigmoid-weighted distance map')
parser.add_argument('-w', '--sigmoidweighting', type=float, help='the steepness of the sigmoid\n <scipy.special.expit(w * np.median(sheath_thickness)>')
parser.add_argument('-m', '--margin', type=int, default=50, help='margin of the box used when calculating\n the sigmoid-weighted distance map')
parser.add_argument('--medwidth_file', default='', help='pickle of dictionary with median widths {label: medwidth}')
return parser
def parse_agglo_from_labelsets(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume of oversegmented supervoxels')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with agglomerated labels')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('-l', '--labelset_files', nargs='*', default=[], help='files with label mappings, either\n A.) pickled python dictionary\n {label_new1: [<label_1>, <label_2>, <...>],\n label_new2: [<label_6>, <label_3>, <...>]}\n B.) ascii files with on each line:\n <label_new1>: <label_1> <label_2> <...>\n <label_new2>: <label_6> <label_3> <...>')
group.add_argument('-f', '--fwmap', help='numpy .npy file with vector of length np.amax(<labels>) + 1\n representing the forward map to apply, e.g.\n fwmap = np.array([0, 0, 4, 8, 8]) will map\n the values 0, 1, 2, 3, 4 in the labelvolume\n to the new values 0, 0, 4, 8, 8;\n i.e. it will delete label 1, relabel label 2 to 4,\n and merge labels 3 & 4 to new label value 8\n ')
return parser
def parse_watershed_ics(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n input to the watershed algorithm')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with watershed oversegmentation')
parser.add_argument('--mask_in', default='', help='')
parser.add_argument('--seedimage', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with seeds to the watershed')
parser.add_argument('-l', '--lower_threshold', type=float, default=0.0, help='the lower threshold for generating seeds from the dataset')
parser.add_argument('-u', '--upper_threshold', type=float, default=1.0, help='the upper threshold for generating seeds from the dataset')
parser.add_argument('-s', '--seed_size', type=int, default=64, help='the minimal size of a seed label')
parser.add_argument('-i', '--invert', action='store_true', help='invert the input volume')
return parser
def parse_agglo_from_labelmask(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume')
parser.add_argument('oversegmentation', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume of oversegmented supervoxels')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with agglomerated labels')
parser.add_argument('-r', '--ratio_threshold', type=float, default=0, help='...')
parser.add_argument('-m', '--axon_mask', action='store_true', help='use axons as output mask')
return parser
def parse_remap_labels(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume with deleted/merged/split labels')
parser.add_argument('-B', '--delete_labels', nargs='*', type=int, default=[], help='list of labels to delete')
parser.add_argument('-d', '--delete_files', nargs='*', default=[], help='list of files with labelsets to delete')
parser.add_argument('--except_files', nargs='*', default=[], help='...')
parser.add_argument('-E', '--merge_labels', nargs='*', type=int, default=[], help='list with pairs of labels to merge')
parser.add_argument('-e', '--merge_files', nargs='*', default=[], help='list of files with labelsets to merge')
parser.add_argument('-F', '--split_labels', nargs='*', type=int, default=[], help='list of labels to split')
parser.add_argument('-f', '--split_files', nargs='*', default=[], help='list of files with labelsets to split')
parser.add_argument('-A', '--aux_labelvolume', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n labelvolume from which to take alternative labels')
parser.add_argument('-q', '--min_labelsize', type=int, default=0, help='the minimum size of the labels')
parser.add_argument('-p', '--min_segmentsize', type=int, default=0, help='the minimum segment size of non-contiguous labels')
parser.add_argument('-k', '--keep_only_largest', action='store_true', help='keep only the largest segment of a split label')
parser.add_argument('-O', '--conncomp', action='store_true', help='relabel split labels with connected component labeling')
parser.add_argument('-n', '--nifti_output', action='store_true', help='also write output to nifti')
parser.add_argument('-m', '--nifti_transpose', action='store_true', help='transpose the output before writing to nifti')
return parser
def parse_nodes_of_ranvier(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-s', '--min_labelsize', type=int, default=0, help='...')
parser.add_argument('-R', '--remove_small_labels', action='store_true', help='remove the small labels before further processing')
parser.add_argument('--boundarymask', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-m', '--merge_methods', nargs='*', default=['neighbours'], help='neighbours, conncomp, and/or watershed')
parser.add_argument('-o', '--overlap_threshold', type=int, default=20, help='for neighbours')
parser.add_argument('-r', '--searchradius', nargs=3, type=int, default=[100, 30, 30], help='for watershed')
parser.add_argument('--data', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--maskMM', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_filter__no_r(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--input2D', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_convert_dm3(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--input2D', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_seg_stats(parser):
parser.add_argument('--h5path_labelMA', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--h5path_labelMF', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--h5path_labelUA', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--stats', nargs='*', default=['area', 'AD', 'centroid', 'eccentricity', 'solidity'], help='the statistics to export')
parser.add_argument('--outputbasename', help='basename for the output')
return parser
def parse_correct_attributes(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('auxfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_combine_vols(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-i', '--volidxs', nargs='*', type=int, default=[], help='indices to the volumes')
parser.add_argument('--bias_image', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_slicvoxels(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('--masks', nargs='*', default=[], help="string of paths to hdf5 datasets <filepath>.h5/<...>/<dataset>\n and logical functions (NOT, AND, OR, XOR)\n to add the hdf5 masks together\n (NOT operates on the following dataset), e.g.\n NOT <f1>.h5/<m1> AND <f1>.h5/<m2> will first invert m1,\n then combine the result with m2 through the AND operator\n starting point is np.ones(<in>.shape[:3], dtype='bool')")
parser.add_argument('-l', '--slicvoxelsize', type=int, default=500, help='target size of the slicvoxels')
parser.add_argument('-c', '--compactness', type=float, default=0.2, help='compactness of the slicvoxels')
parser.add_argument('-s', '--sigma', type=float, default=1, help='Gaussian smoothing sigma for preprocessing')
parser.add_argument('-e', '--enforce_connectivity', action='store_true', help='enforce connectivity of the slicvoxels')
return parser
def parse_image_ops(parser):
parser.add_argument('inputfile', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-s', '--sigma', nargs='*', type=float, default=[0.0], help='Gaussian smoothing sigma (in um)')
return parser
def parse_combine_labels(parser):
parser.add_argument('inputfile1', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('inputfile2', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
parser.add_argument('-m', '--method', help='add/subtract/merge/...')
parser.add_argument('outputfile', default='', help='path to hdf5 dataset <filepath>.h5/<...>/<dataset>:\n ')
return parser
def parse_neuroblender(parser):
return parser
|
#Ejercicio
precio = float(input("Ingrese el precio: "))
descuento = precio * 0.15
precio_final = precio - descuento
print (f"el precio final a pagar es: {precio_final:.2f}")
print (descuento)
|
precio = float(input('Ingrese el precio: '))
descuento = precio * 0.15
precio_final = precio - descuento
print(f'el precio final a pagar es: {precio_final:.2f}')
print(descuento)
|
# write your code here
user_field = input("Enter cells: ")
game_board = []
player_1 = "X"
player_2 = "O"
def print_field(field):
global game_board
coordinates = list()
game_board = [[field[0], field[1], field[2]],
[field[3], field[4], field[5]],
[field[6], field[7], field[8]]]
def printer(board):
print("---------")
print("| " + " ".join(board[0]) + " |")
print("| " + " ".join(board[1]) + " |")
print("| " + " ".join(board[2]) + " |")
print("---------")
printer(game_board)
field = input("Enter the coordinates: ").split()
def validation(user_input):
# validate input type
for item in user_input:
if item.isnumeric():
if 1 <= int(item) <= 3:
# - 1 to match matrix coordinate (0-2 vs 1-3)
coordinates.append(int(item) - 1)
else:
print("Coordinates should be from 1 to 3!")
coordinates.clear()
return False
else:
print("You should enter numbers!")
coordinates.clear()
return False
del coordinates[2:]
# adjust coordinates for matrix output
coordinates[1] = abs(coordinates[1] - 2)
coordinates.reverse()
print("CALCULATED coordinates ", coordinates)
if game_board[coordinates[0]][coordinates[1]] == "_":
# trim extra input items if coordinate list is too long
return coordinates, True
else:
print("This cell is occupied! Choose another one!")
coordinates.clear()
return False
while validation(field) is False:
field = input("Enter the NEW coordinates: ").split()
# update game board with new move
game_board[coordinates[0]][coordinates[1]] = player_1
printer(game_board)
return field
def print_game_status():
def win_status(player):
# check rows
for row in game_board:
if row.count(player) == 3:
return True
# check columns
column = [[], [], []]
for x in range(0, 3):
for row in game_board:
column[x].append(row[x])
if column[x].count(player) == 3:
return True
# check diagonals
diagonal_1 = [game_board[0][0], game_board[1][1], game_board[2][2]]
diagonal_2 = [game_board[0][2], game_board[1][1], game_board[2][0]]
if diagonal_1.count(player) == 3 or diagonal_2.count(player) == 3:
return True
def finished(board):
for i in range(len(board)):
if "_" in board[i]:
return True
def too_many(x, o):
num_x = [square for row in game_board for square in row if square == x]
num_y = [square for row in game_board for square in row if square == o]
if abs(len(num_x) - len(num_y)) >= 2:
return True
def print_outcome(x, o):
win_status(x)
win_status(o)
if win_status(x) and win_status(o):
print("Impossible")
elif too_many(x, o) is True:
print("Impossible")
elif win_status(x):
print(f"{x} wins")
elif win_status(o):
print(f"{o} wins")
elif win_status(x) is not True and win_status(o) is not True:
if finished(game_board) is True:
print("Game not finished")
else:
print("Draw")
print_outcome(player_1, player_2)
print_field(user_field)
print_game_status()
|
user_field = input('Enter cells: ')
game_board = []
player_1 = 'X'
player_2 = 'O'
def print_field(field):
global game_board
coordinates = list()
game_board = [[field[0], field[1], field[2]], [field[3], field[4], field[5]], [field[6], field[7], field[8]]]
def printer(board):
print('---------')
print('| ' + ' '.join(board[0]) + ' |')
print('| ' + ' '.join(board[1]) + ' |')
print('| ' + ' '.join(board[2]) + ' |')
print('---------')
printer(game_board)
field = input('Enter the coordinates: ').split()
def validation(user_input):
for item in user_input:
if item.isnumeric():
if 1 <= int(item) <= 3:
coordinates.append(int(item) - 1)
else:
print('Coordinates should be from 1 to 3!')
coordinates.clear()
return False
else:
print('You should enter numbers!')
coordinates.clear()
return False
del coordinates[2:]
coordinates[1] = abs(coordinates[1] - 2)
coordinates.reverse()
print('CALCULATED coordinates ', coordinates)
if game_board[coordinates[0]][coordinates[1]] == '_':
return (coordinates, True)
else:
print('This cell is occupied! Choose another one!')
coordinates.clear()
return False
while validation(field) is False:
field = input('Enter the NEW coordinates: ').split()
game_board[coordinates[0]][coordinates[1]] = player_1
printer(game_board)
return field
def print_game_status():
def win_status(player):
for row in game_board:
if row.count(player) == 3:
return True
column = [[], [], []]
for x in range(0, 3):
for row in game_board:
column[x].append(row[x])
if column[x].count(player) == 3:
return True
diagonal_1 = [game_board[0][0], game_board[1][1], game_board[2][2]]
diagonal_2 = [game_board[0][2], game_board[1][1], game_board[2][0]]
if diagonal_1.count(player) == 3 or diagonal_2.count(player) == 3:
return True
def finished(board):
for i in range(len(board)):
if '_' in board[i]:
return True
def too_many(x, o):
num_x = [square for row in game_board for square in row if square == x]
num_y = [square for row in game_board for square in row if square == o]
if abs(len(num_x) - len(num_y)) >= 2:
return True
def print_outcome(x, o):
win_status(x)
win_status(o)
if win_status(x) and win_status(o):
print('Impossible')
elif too_many(x, o) is True:
print('Impossible')
elif win_status(x):
print(f'{x} wins')
elif win_status(o):
print(f'{o} wins')
elif win_status(x) is not True and win_status(o) is not True:
if finished(game_board) is True:
print('Game not finished')
else:
print('Draw')
print_outcome(player_1, player_2)
print_field(user_field)
print_game_status()
|
# takes two inputs and adds them together as ints;
# outputs solution
print(int(input()) + int(input()))
|
print(int(input()) + int(input()))
|
"""
PASSENGERS
"""
numPassengers = 2757
passenger_arriving = (
(3, 9, 6, 2, 3, 0, 9, 5, 3, 3, 1, 0), # 0
(2, 11, 10, 1, 1, 0, 2, 4, 2, 2, 0, 0), # 1
(1, 10, 5, 3, 2, 0, 5, 12, 6, 3, 1, 0), # 2
(5, 8, 7, 2, 1, 0, 6, 7, 5, 5, 1, 0), # 3
(3, 5, 5, 3, 2, 0, 9, 8, 4, 0, 1, 0), # 4
(1, 9, 11, 4, 1, 0, 7, 7, 6, 4, 0, 0), # 5
(3, 8, 5, 3, 0, 0, 6, 9, 1, 6, 1, 0), # 6
(3, 6, 7, 2, 1, 0, 2, 2, 5, 1, 1, 0), # 7
(4, 4, 2, 2, 0, 0, 7, 8, 2, 5, 1, 0), # 8
(8, 7, 4, 4, 1, 0, 1, 9, 4, 6, 4, 0), # 9
(2, 5, 8, 5, 3, 0, 7, 8, 2, 6, 0, 0), # 10
(4, 10, 2, 2, 1, 0, 7, 7, 6, 4, 6, 0), # 11
(5, 10, 5, 4, 4, 0, 3, 10, 8, 6, 3, 0), # 12
(4, 11, 7, 5, 0, 0, 10, 9, 4, 4, 2, 0), # 13
(4, 11, 5, 4, 2, 0, 7, 7, 5, 5, 3, 0), # 14
(1, 8, 3, 3, 0, 0, 3, 7, 3, 4, 2, 0), # 15
(1, 10, 8, 1, 3, 0, 8, 7, 7, 9, 3, 0), # 16
(8, 9, 7, 3, 4, 0, 7, 6, 5, 2, 1, 0), # 17
(4, 11, 6, 1, 0, 0, 5, 4, 7, 3, 2, 0), # 18
(3, 10, 7, 5, 2, 0, 5, 4, 5, 4, 0, 0), # 19
(5, 10, 6, 4, 2, 0, 1, 13, 8, 7, 3, 0), # 20
(4, 4, 7, 5, 1, 0, 7, 8, 1, 9, 5, 0), # 21
(4, 6, 4, 3, 2, 0, 7, 10, 1, 6, 2, 0), # 22
(1, 5, 6, 7, 2, 0, 4, 5, 6, 3, 2, 0), # 23
(4, 10, 10, 0, 1, 0, 8, 4, 2, 6, 3, 0), # 24
(4, 8, 4, 3, 1, 0, 4, 6, 5, 2, 5, 0), # 25
(3, 13, 9, 5, 4, 0, 3, 10, 5, 4, 1, 0), # 26
(2, 10, 5, 6, 3, 0, 8, 6, 3, 1, 2, 0), # 27
(6, 9, 8, 5, 6, 0, 4, 10, 8, 3, 1, 0), # 28
(2, 9, 5, 3, 3, 0, 4, 11, 3, 5, 0, 0), # 29
(6, 7, 7, 2, 1, 0, 5, 8, 7, 4, 1, 0), # 30
(5, 3, 5, 3, 1, 0, 4, 5, 7, 6, 2, 0), # 31
(3, 9, 7, 4, 0, 0, 5, 5, 8, 3, 1, 0), # 32
(3, 6, 7, 1, 3, 0, 4, 5, 2, 4, 2, 0), # 33
(2, 8, 13, 5, 1, 0, 8, 4, 9, 4, 5, 0), # 34
(5, 11, 5, 3, 4, 0, 4, 6, 9, 5, 1, 0), # 35
(3, 9, 8, 3, 2, 0, 7, 9, 7, 3, 5, 0), # 36
(2, 8, 0, 2, 2, 0, 7, 10, 11, 4, 3, 0), # 37
(1, 13, 5, 4, 0, 0, 5, 6, 1, 5, 1, 0), # 38
(4, 10, 5, 3, 2, 0, 13, 7, 5, 5, 4, 0), # 39
(5, 6, 10, 4, 3, 0, 2, 10, 4, 2, 1, 0), # 40
(4, 9, 4, 1, 2, 0, 5, 10, 3, 1, 3, 0), # 41
(3, 7, 7, 5, 1, 0, 3, 9, 7, 2, 6, 0), # 42
(4, 7, 9, 2, 2, 0, 4, 8, 4, 4, 1, 0), # 43
(3, 9, 7, 3, 4, 0, 5, 9, 6, 1, 2, 0), # 44
(1, 10, 5, 2, 3, 0, 10, 7, 5, 0, 1, 0), # 45
(5, 8, 8, 2, 2, 0, 6, 4, 6, 5, 4, 0), # 46
(3, 5, 8, 1, 1, 0, 2, 7, 1, 3, 3, 0), # 47
(1, 3, 6, 3, 2, 0, 7, 9, 6, 7, 2, 0), # 48
(4, 8, 5, 6, 0, 0, 5, 5, 3, 6, 4, 0), # 49
(8, 1, 6, 9, 3, 0, 5, 5, 3, 3, 4, 0), # 50
(4, 7, 4, 4, 2, 0, 6, 5, 5, 5, 5, 0), # 51
(6, 6, 7, 1, 3, 0, 10, 3, 6, 2, 0, 0), # 52
(5, 7, 5, 4, 3, 0, 5, 5, 7, 3, 1, 0), # 53
(4, 6, 0, 3, 2, 0, 9, 11, 2, 1, 2, 0), # 54
(6, 9, 6, 1, 3, 0, 3, 6, 7, 4, 1, 0), # 55
(3, 7, 7, 4, 2, 0, 7, 8, 5, 4, 2, 0), # 56
(3, 10, 5, 4, 1, 0, 5, 7, 6, 1, 0, 0), # 57
(3, 12, 4, 3, 2, 0, 4, 6, 7, 10, 0, 0), # 58
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 59
)
station_arriving_intensity = (
(3.1795818700614573, 8.15575284090909, 9.59308322622108, 7.603532608695652, 8.571634615384614, 5.708152173913044), # 0
(3.20942641205736, 8.246449918455387, 9.644898645029993, 7.6458772644927535, 8.635879807692307, 5.706206567028985), # 1
(3.238930172666081, 8.335801683501682, 9.695484147386459, 7.687289855072463, 8.69876923076923, 5.704201449275362), # 2
(3.268068107989464, 8.42371171875, 9.744802779562981, 7.727735054347824, 8.760245192307693, 5.702137092391305), # 3
(3.296815174129353, 8.510083606902358, 9.792817587832047, 7.767177536231884, 8.82025, 5.700013768115941), # 4
(3.3251463271875914, 8.594820930660775, 9.839491618466152, 7.805581974637681, 8.87872596153846, 5.697831748188405), # 5
(3.353036523266023, 8.677827272727273, 9.88478791773779, 7.842913043478261, 8.935615384615383, 5.695591304347826), # 6
(3.380460718466491, 8.75900621580387, 9.92866953191945, 7.879135416666666, 8.990860576923078, 5.693292708333334), # 7
(3.40739386889084, 8.83826134259259, 9.971099507283634, 7.914213768115941, 9.044403846153847, 5.6909362318840575), # 8
(3.4338109306409126, 8.915496235795453, 10.012040890102828, 7.9481127717391304, 9.0961875, 5.68852214673913), # 9
(3.459686859818554, 8.990614478114479, 10.051456726649528, 7.980797101449276, 9.146153846153846, 5.68605072463768), # 10
(3.4849966125256073, 9.063519652251683, 10.089310063196228, 8.012231431159421, 9.194245192307692, 5.683522237318841), # 11
(3.509715144863916, 9.134115340909089, 10.125563946015424, 8.042380434782608, 9.240403846153844, 5.680936956521738), # 12
(3.5338174129353224, 9.20230512678872, 10.160181421379605, 8.071208786231884, 9.284572115384616, 5.678295153985506), # 13
(3.5572783728416737, 9.267992592592593, 10.193125535561265, 8.098681159420288, 9.326692307692307, 5.6755971014492745), # 14
(3.5800729806848106, 9.331081321022726, 10.224359334832902, 8.124762228260868, 9.36670673076923, 5.672843070652174), # 15
(3.6021761925665783, 9.391474894781144, 10.25384586546701, 8.149416666666665, 9.404557692307693, 5.6700333333333335), # 16
(3.6235629645888205, 9.449076896569863, 10.281548173736075, 8.172609148550725, 9.4401875, 5.667168161231884), # 17
(3.64420825285338, 9.503790909090908, 10.307429305912597, 8.194304347826087, 9.473538461538464, 5.664247826086956), # 18
(3.664087013462101, 9.555520515046295, 10.331452308269066, 8.214466938405796, 9.504552884615384, 5.661272599637681), # 19
(3.683174202516827, 9.604169297138045, 10.353580227077975, 8.2330615942029, 9.533173076923077, 5.658242753623187), # 20
(3.7014447761194034, 9.649640838068178, 10.373776108611827, 8.250052989130435, 9.559341346153845, 5.655158559782609), # 21
(3.7188736903716704, 9.69183872053872, 10.3920029991431, 8.26540579710145, 9.582999999999998, 5.652020289855073), # 22
(3.7354359013754754, 9.730666527251683, 10.408223944944302, 8.279084692028986, 9.604091346153846, 5.6488282155797105), # 23
(3.75110636523266, 9.76602784090909, 10.422401992287917, 8.291054347826087, 9.62255769230769, 5.645582608695652), # 24
(3.7658600380450684, 9.797826244212962, 10.434500187446444, 8.301279438405798, 9.638341346153844, 5.642283740942029), # 25
(3.779671875914545, 9.825965319865318, 10.444481576692374, 8.309724637681159, 9.651384615384615, 5.63893188405797), # 26
(3.792516834942932, 9.85034865056818, 10.452309206298198, 8.316354619565217, 9.661629807692309, 5.635527309782609), # 27
(3.804369871232075, 9.870879819023568, 10.457946122536418, 8.321134057971014, 9.66901923076923, 5.632070289855072), # 28
(3.815205940883816, 9.887462407933501, 10.461355371679518, 8.324027626811594, 9.673495192307692, 5.628561096014493), # 29
(3.8249999999999997, 9.9, 10.4625, 8.325, 9.674999999999999, 5.625), # 30
(3.834164434143222, 9.910414559659088, 10.461641938405796, 8.324824387254901, 9.674452393617022, 5.620051511744128), # 31
(3.843131010230179, 9.920691477272728, 10.459092028985506, 8.324300980392156, 9.672821276595744, 5.612429710144928), # 32
(3.8519037563938614, 9.930829474431818, 10.45488668478261, 8.323434926470588, 9.670124202127658, 5.6022092203898035), # 33
(3.860486700767263, 9.940827272727272, 10.449062318840578, 8.32223137254902, 9.666378723404256, 5.589464667666167), # 34
(3.8688838714833755, 9.950683593749998, 10.441655344202898, 8.320695465686274, 9.661602393617022, 5.574270677161419), # 35
(3.8770992966751923, 9.96039715909091, 10.432702173913043, 8.318832352941177, 9.655812765957448, 5.556701874062968), # 36
(3.885137004475703, 9.96996669034091, 10.422239221014491, 8.316647181372549, 9.64902739361702, 5.536832883558221), # 37
(3.893001023017902, 9.979390909090908, 10.410302898550723, 8.314145098039214, 9.641263829787233, 5.514738330834581), # 38
(3.900695380434782, 9.988668536931817, 10.396929619565215, 8.31133125, 9.632539627659574, 5.490492841079459), # 39
(3.908224104859335, 9.997798295454546, 10.382155797101449, 8.308210784313726, 9.62287234042553, 5.464171039480259), # 40
(3.915591224424552, 10.006778906249998, 10.366017844202899, 8.304788848039216, 9.612279521276594, 5.435847551224389), # 41
(3.9228007672634266, 10.015609090909093, 10.348552173913044, 8.301070588235293, 9.600778723404256, 5.40559700149925), # 42
(3.929856761508952, 10.024287571022725, 10.329795199275361, 8.297061151960785, 9.5883875, 5.373494015492254), # 43
(3.936763235294117, 10.032813068181818, 10.309783333333334, 8.292765686274508, 9.575123404255319, 5.339613218390804), # 44
(3.9435242167519178, 10.041184303977271, 10.288552989130435, 8.288189338235293, 9.561003989361701, 5.304029235382309), # 45
(3.9501437340153456, 10.0494, 10.266140579710147, 8.28333725490196, 9.546046808510638, 5.266816691654173), # 46
(3.956625815217391, 10.05745887784091, 10.24258251811594, 8.278214583333332, 9.530269414893617, 5.228050212393803), # 47
(3.962974488491049, 10.065359659090909, 10.217915217391303, 8.272826470588234, 9.513689361702127, 5.187804422788607), # 48
(3.9691937819693086, 10.073101065340907, 10.19217509057971, 8.26717806372549, 9.49632420212766, 5.146153948025987), # 49
(3.9752877237851663, 10.080681818181816, 10.165398550724637, 8.261274509803922, 9.478191489361702, 5.103173413293353), # 50
(3.9812603420716113, 10.088100639204544, 10.137622010869565, 8.255120955882353, 9.459308776595744, 5.0589374437781105), # 51
(3.987115664961637, 10.09535625, 10.10888188405797, 8.248722549019607, 9.439693617021277, 5.013520664667666), # 52
(3.992857720588235, 10.10244737215909, 10.079214583333332, 8.24208443627451, 9.419363563829787, 4.966997701149425), # 53
(3.9984905370843995, 10.109372727272726, 10.04865652173913, 8.235211764705882, 9.398336170212765, 4.919443178410794), # 54
(4.00401814258312, 10.116131036931817, 10.017244112318838, 8.22810968137255, 9.376628989361702, 4.87093172163918), # 55
(4.0094445652173905, 10.122721022727271, 9.985013768115941, 8.220783333333333, 9.354259574468085, 4.821537956021989), # 56
(4.014773833120205, 10.129141406250001, 9.952001902173912, 8.213237867647058, 9.331245478723403, 4.771336506746626), # 57
(4.0200099744245525, 10.135390909090907, 9.91824492753623, 8.20547843137255, 9.307604255319148, 4.7204019990005), # 58
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59
)
passenger_arriving_acc = (
(3, 9, 6, 2, 3, 0, 9, 5, 3, 3, 1, 0), # 0
(5, 20, 16, 3, 4, 0, 11, 9, 5, 5, 1, 0), # 1
(6, 30, 21, 6, 6, 0, 16, 21, 11, 8, 2, 0), # 2
(11, 38, 28, 8, 7, 0, 22, 28, 16, 13, 3, 0), # 3
(14, 43, 33, 11, 9, 0, 31, 36, 20, 13, 4, 0), # 4
(15, 52, 44, 15, 10, 0, 38, 43, 26, 17, 4, 0), # 5
(18, 60, 49, 18, 10, 0, 44, 52, 27, 23, 5, 0), # 6
(21, 66, 56, 20, 11, 0, 46, 54, 32, 24, 6, 0), # 7
(25, 70, 58, 22, 11, 0, 53, 62, 34, 29, 7, 0), # 8
(33, 77, 62, 26, 12, 0, 54, 71, 38, 35, 11, 0), # 9
(35, 82, 70, 31, 15, 0, 61, 79, 40, 41, 11, 0), # 10
(39, 92, 72, 33, 16, 0, 68, 86, 46, 45, 17, 0), # 11
(44, 102, 77, 37, 20, 0, 71, 96, 54, 51, 20, 0), # 12
(48, 113, 84, 42, 20, 0, 81, 105, 58, 55, 22, 0), # 13
(52, 124, 89, 46, 22, 0, 88, 112, 63, 60, 25, 0), # 14
(53, 132, 92, 49, 22, 0, 91, 119, 66, 64, 27, 0), # 15
(54, 142, 100, 50, 25, 0, 99, 126, 73, 73, 30, 0), # 16
(62, 151, 107, 53, 29, 0, 106, 132, 78, 75, 31, 0), # 17
(66, 162, 113, 54, 29, 0, 111, 136, 85, 78, 33, 0), # 18
(69, 172, 120, 59, 31, 0, 116, 140, 90, 82, 33, 0), # 19
(74, 182, 126, 63, 33, 0, 117, 153, 98, 89, 36, 0), # 20
(78, 186, 133, 68, 34, 0, 124, 161, 99, 98, 41, 0), # 21
(82, 192, 137, 71, 36, 0, 131, 171, 100, 104, 43, 0), # 22
(83, 197, 143, 78, 38, 0, 135, 176, 106, 107, 45, 0), # 23
(87, 207, 153, 78, 39, 0, 143, 180, 108, 113, 48, 0), # 24
(91, 215, 157, 81, 40, 0, 147, 186, 113, 115, 53, 0), # 25
(94, 228, 166, 86, 44, 0, 150, 196, 118, 119, 54, 0), # 26
(96, 238, 171, 92, 47, 0, 158, 202, 121, 120, 56, 0), # 27
(102, 247, 179, 97, 53, 0, 162, 212, 129, 123, 57, 0), # 28
(104, 256, 184, 100, 56, 0, 166, 223, 132, 128, 57, 0), # 29
(110, 263, 191, 102, 57, 0, 171, 231, 139, 132, 58, 0), # 30
(115, 266, 196, 105, 58, 0, 175, 236, 146, 138, 60, 0), # 31
(118, 275, 203, 109, 58, 0, 180, 241, 154, 141, 61, 0), # 32
(121, 281, 210, 110, 61, 0, 184, 246, 156, 145, 63, 0), # 33
(123, 289, 223, 115, 62, 0, 192, 250, 165, 149, 68, 0), # 34
(128, 300, 228, 118, 66, 0, 196, 256, 174, 154, 69, 0), # 35
(131, 309, 236, 121, 68, 0, 203, 265, 181, 157, 74, 0), # 36
(133, 317, 236, 123, 70, 0, 210, 275, 192, 161, 77, 0), # 37
(134, 330, 241, 127, 70, 0, 215, 281, 193, 166, 78, 0), # 38
(138, 340, 246, 130, 72, 0, 228, 288, 198, 171, 82, 0), # 39
(143, 346, 256, 134, 75, 0, 230, 298, 202, 173, 83, 0), # 40
(147, 355, 260, 135, 77, 0, 235, 308, 205, 174, 86, 0), # 41
(150, 362, 267, 140, 78, 0, 238, 317, 212, 176, 92, 0), # 42
(154, 369, 276, 142, 80, 0, 242, 325, 216, 180, 93, 0), # 43
(157, 378, 283, 145, 84, 0, 247, 334, 222, 181, 95, 0), # 44
(158, 388, 288, 147, 87, 0, 257, 341, 227, 181, 96, 0), # 45
(163, 396, 296, 149, 89, 0, 263, 345, 233, 186, 100, 0), # 46
(166, 401, 304, 150, 90, 0, 265, 352, 234, 189, 103, 0), # 47
(167, 404, 310, 153, 92, 0, 272, 361, 240, 196, 105, 0), # 48
(171, 412, 315, 159, 92, 0, 277, 366, 243, 202, 109, 0), # 49
(179, 413, 321, 168, 95, 0, 282, 371, 246, 205, 113, 0), # 50
(183, 420, 325, 172, 97, 0, 288, 376, 251, 210, 118, 0), # 51
(189, 426, 332, 173, 100, 0, 298, 379, 257, 212, 118, 0), # 52
(194, 433, 337, 177, 103, 0, 303, 384, 264, 215, 119, 0), # 53
(198, 439, 337, 180, 105, 0, 312, 395, 266, 216, 121, 0), # 54
(204, 448, 343, 181, 108, 0, 315, 401, 273, 220, 122, 0), # 55
(207, 455, 350, 185, 110, 0, 322, 409, 278, 224, 124, 0), # 56
(210, 465, 355, 189, 111, 0, 327, 416, 284, 225, 124, 0), # 57
(213, 477, 359, 192, 113, 0, 331, 422, 291, 235, 124, 0), # 58
(213, 477, 359, 192, 113, 0, 331, 422, 291, 235, 124, 0), # 59
)
passenger_arriving_rate = (
(3.1795818700614573, 6.524602272727271, 5.755849935732647, 3.0414130434782605, 1.7143269230769227, 0.0, 5.708152173913044, 6.857307692307691, 4.562119565217391, 3.8372332904884314, 1.6311505681818177, 0.0), # 0
(3.20942641205736, 6.597159934764309, 5.786939187017996, 3.0583509057971012, 1.7271759615384612, 0.0, 5.706206567028985, 6.908703846153845, 4.587526358695652, 3.857959458011997, 1.6492899836910773, 0.0), # 1
(3.238930172666081, 6.668641346801345, 5.817290488431875, 3.074915942028985, 1.7397538461538458, 0.0, 5.704201449275362, 6.959015384615383, 4.612373913043478, 3.8781936589545833, 1.6671603367003363, 0.0), # 2
(3.268068107989464, 6.738969375, 5.846881667737788, 3.091094021739129, 1.7520490384615384, 0.0, 5.702137092391305, 7.0081961538461535, 4.636641032608694, 3.897921111825192, 1.68474234375, 0.0), # 3
(3.296815174129353, 6.808066885521885, 5.875690552699228, 3.106871014492753, 1.76405, 0.0, 5.700013768115941, 7.0562, 4.66030652173913, 3.9171270351328187, 1.7020167213804713, 0.0), # 4
(3.3251463271875914, 6.87585674452862, 5.903694971079691, 3.122232789855072, 1.775745192307692, 0.0, 5.697831748188405, 7.102980769230768, 4.6833491847826085, 3.9357966473864603, 1.718964186132155, 0.0), # 5
(3.353036523266023, 6.942261818181818, 5.930872750642674, 3.137165217391304, 1.7871230769230766, 0.0, 5.695591304347826, 7.148492307692306, 4.705747826086957, 3.953915167095116, 1.7355654545454544, 0.0), # 6
(3.380460718466491, 7.007204972643096, 5.95720171915167, 3.1516541666666664, 1.7981721153846155, 0.0, 5.693292708333334, 7.192688461538462, 4.727481249999999, 3.97146781276778, 1.751801243160774, 0.0), # 7
(3.40739386889084, 7.0706090740740715, 5.982659704370181, 3.165685507246376, 1.8088807692307691, 0.0, 5.6909362318840575, 7.2355230769230765, 4.7485282608695645, 3.9884398029134536, 1.7676522685185179, 0.0), # 8
(3.4338109306409126, 7.132396988636362, 6.007224534061696, 3.179245108695652, 1.8192374999999996, 0.0, 5.68852214673913, 7.2769499999999985, 4.768867663043478, 4.004816356041131, 1.7830992471590905, 0.0), # 9
(3.459686859818554, 7.1924915824915825, 6.030874035989717, 3.19231884057971, 1.829230769230769, 0.0, 5.68605072463768, 7.316923076923076, 4.7884782608695655, 4.020582690659811, 1.7981228956228956, 0.0), # 10
(3.4849966125256073, 7.250815721801346, 6.053586037917737, 3.204892572463768, 1.8388490384615384, 0.0, 5.683522237318841, 7.355396153846153, 4.807338858695652, 4.0357240252784905, 1.8127039304503365, 0.0), # 11
(3.509715144863916, 7.30729227272727, 6.0753383676092545, 3.2169521739130427, 1.8480807692307688, 0.0, 5.680936956521738, 7.392323076923075, 4.825428260869565, 4.050225578406169, 1.8268230681818176, 0.0), # 12
(3.5338174129353224, 7.361844101430976, 6.096108852827762, 3.228483514492753, 1.8569144230769232, 0.0, 5.678295153985506, 7.427657692307693, 4.84272527173913, 4.0640725685518415, 1.840461025357744, 0.0), # 13
(3.5572783728416737, 7.414394074074074, 6.115875321336759, 3.2394724637681147, 1.8653384615384612, 0.0, 5.6755971014492745, 7.461353846153845, 4.859208695652172, 4.077250214224506, 1.8535985185185184, 0.0), # 14
(3.5800729806848106, 7.46486505681818, 6.134615600899742, 3.249904891304347, 1.873341346153846, 0.0, 5.672843070652174, 7.493365384615384, 4.874857336956521, 4.089743733933161, 1.866216264204545, 0.0), # 15
(3.6021761925665783, 7.513179915824915, 6.152307519280206, 3.259766666666666, 1.8809115384615382, 0.0, 5.6700333333333335, 7.523646153846153, 4.889649999999999, 4.101538346186803, 1.8782949789562287, 0.0), # 16
(3.6235629645888205, 7.55926151725589, 6.168928904241645, 3.26904365942029, 1.8880374999999998, 0.0, 5.667168161231884, 7.552149999999999, 4.903565489130435, 4.11261926949443, 1.8898153793139725, 0.0), # 17
(3.64420825285338, 7.603032727272725, 6.184457583547558, 3.2777217391304343, 1.8947076923076926, 0.0, 5.664247826086956, 7.578830769230771, 4.916582608695652, 4.122971722365039, 1.9007581818181813, 0.0), # 18
(3.664087013462101, 7.644416412037035, 6.198871384961439, 3.285786775362318, 1.9009105769230765, 0.0, 5.661272599637681, 7.603642307692306, 4.928680163043477, 4.132580923307626, 1.9111041030092588, 0.0), # 19
(3.683174202516827, 7.683335437710435, 6.2121481362467845, 3.2932246376811594, 1.9066346153846152, 0.0, 5.658242753623187, 7.626538461538461, 4.93983695652174, 4.14143209083119, 1.9208338594276086, 0.0), # 20
(3.7014447761194034, 7.719712670454542, 6.224265665167096, 3.3000211956521737, 1.911868269230769, 0.0, 5.655158559782609, 7.647473076923076, 4.950031793478261, 4.14951044344473, 1.9299281676136355, 0.0), # 21
(3.7188736903716704, 7.753470976430976, 6.23520179948586, 3.3061623188405793, 1.9165999999999994, 0.0, 5.652020289855073, 7.666399999999998, 4.959243478260869, 4.15680119965724, 1.938367744107744, 0.0), # 22
(3.7354359013754754, 7.784533221801346, 6.244934366966581, 3.311633876811594, 1.920818269230769, 0.0, 5.6488282155797105, 7.683273076923076, 4.967450815217392, 4.163289577977721, 1.9461333054503365, 0.0), # 23
(3.75110636523266, 7.812822272727271, 6.25344119537275, 3.3164217391304347, 1.9245115384615379, 0.0, 5.645582608695652, 7.6980461538461515, 4.974632608695652, 4.168960796915166, 1.9532055681818177, 0.0), # 24
(3.7658600380450684, 7.838260995370368, 6.260700112467866, 3.320511775362319, 1.9276682692307685, 0.0, 5.642283740942029, 7.710673076923074, 4.980767663043479, 4.173800074978577, 1.959565248842592, 0.0), # 25
(3.779671875914545, 7.860772255892254, 6.266688946015424, 3.3238898550724634, 1.9302769230769228, 0.0, 5.63893188405797, 7.721107692307691, 4.985834782608695, 4.177792630676949, 1.9651930639730635, 0.0), # 26
(3.792516834942932, 7.8802789204545425, 6.2713855237789184, 3.326541847826087, 1.9323259615384616, 0.0, 5.635527309782609, 7.729303846153846, 4.98981277173913, 4.180923682519278, 1.9700697301136356, 0.0), # 27
(3.804369871232075, 7.8967038552188535, 6.2747676735218505, 3.328453623188405, 1.9338038461538458, 0.0, 5.632070289855072, 7.735215384615383, 4.992680434782608, 4.183178449014567, 1.9741759638047134, 0.0), # 28
(3.815205940883816, 7.9099699263468, 6.276813223007711, 3.3296110507246373, 1.9346990384615383, 0.0, 5.628561096014493, 7.738796153846153, 4.994416576086956, 4.184542148671807, 1.9774924815867, 0.0), # 29
(3.8249999999999997, 7.92, 6.2775, 3.3299999999999996, 1.9349999999999996, 0.0, 5.625, 7.739999999999998, 4.994999999999999, 4.185, 1.98, 0.0), # 30
(3.834164434143222, 7.92833164772727, 6.276985163043477, 3.3299297549019604, 1.9348904787234043, 0.0, 5.620051511744128, 7.739561914893617, 4.994894632352941, 4.184656775362318, 1.9820829119318175, 0.0), # 31
(3.843131010230179, 7.936553181818182, 6.275455217391303, 3.329720392156862, 1.9345642553191487, 0.0, 5.612429710144928, 7.738257021276595, 4.994580588235293, 4.1836368115942015, 1.9841382954545455, 0.0), # 32
(3.8519037563938614, 7.944663579545454, 6.272932010869566, 3.329373970588235, 1.9340248404255314, 0.0, 5.6022092203898035, 7.736099361702125, 4.994060955882353, 4.181954673913044, 1.9861658948863634, 0.0), # 33
(3.860486700767263, 7.952661818181817, 6.269437391304347, 3.3288925490196077, 1.9332757446808508, 0.0, 5.589464667666167, 7.733102978723403, 4.993338823529411, 4.179624927536231, 1.9881654545454543, 0.0), # 34
(3.8688838714833755, 7.960546874999998, 6.264993206521739, 3.328278186274509, 1.9323204787234043, 0.0, 5.574270677161419, 7.729281914893617, 4.9924172794117645, 4.176662137681159, 1.9901367187499994, 0.0), # 35
(3.8770992966751923, 7.968317727272727, 6.259621304347825, 3.3275329411764707, 1.9311625531914893, 0.0, 5.556701874062968, 7.724650212765957, 4.9912994117647065, 4.173080869565217, 1.9920794318181818, 0.0), # 36
(3.885137004475703, 7.975973352272726, 6.253343532608695, 3.3266588725490194, 1.9298054787234038, 0.0, 5.536832883558221, 7.719221914893615, 4.989988308823529, 4.168895688405796, 1.9939933380681816, 0.0), # 37
(3.893001023017902, 7.983512727272726, 6.246181739130434, 3.325658039215685, 1.9282527659574464, 0.0, 5.514738330834581, 7.713011063829786, 4.988487058823528, 4.164121159420289, 1.9958781818181814, 0.0), # 38
(3.900695380434782, 7.990934829545453, 6.238157771739129, 3.3245324999999997, 1.9265079255319146, 0.0, 5.490492841079459, 7.7060317021276585, 4.98679875, 4.1587718478260856, 1.9977337073863632, 0.0), # 39
(3.908224104859335, 7.998238636363636, 6.229293478260869, 3.32328431372549, 1.924574468085106, 0.0, 5.464171039480259, 7.698297872340424, 4.984926470588236, 4.1528623188405795, 1.999559659090909, 0.0), # 40
(3.915591224424552, 8.005423124999998, 6.219610706521739, 3.321915539215686, 1.9224559042553186, 0.0, 5.435847551224389, 7.689823617021275, 4.982873308823529, 4.146407137681159, 2.0013557812499996, 0.0), # 41
(3.9228007672634266, 8.012487272727274, 6.209131304347826, 3.320428235294117, 1.920155744680851, 0.0, 5.40559700149925, 7.680622978723404, 4.980642352941175, 4.1394208695652175, 2.0031218181818184, 0.0), # 42
(3.929856761508952, 8.01943005681818, 6.1978771195652165, 3.3188244607843136, 1.9176774999999997, 0.0, 5.373494015492254, 7.670709999999999, 4.978236691176471, 4.131918079710144, 2.004857514204545, 0.0), # 43
(3.936763235294117, 8.026250454545455, 6.18587, 3.317106274509803, 1.9150246808510636, 0.0, 5.339613218390804, 7.660098723404254, 4.975659411764705, 4.123913333333333, 2.0065626136363637, 0.0), # 44
(3.9435242167519178, 8.032947443181817, 6.1731317934782615, 3.315275735294117, 1.91220079787234, 0.0, 5.304029235382309, 7.64880319148936, 4.972913602941175, 4.115421195652174, 2.008236860795454, 0.0), # 45
(3.9501437340153456, 8.03952, 6.159684347826087, 3.313334901960784, 1.9092093617021275, 0.0, 5.266816691654173, 7.63683744680851, 4.970002352941176, 4.106456231884058, 2.00988, 0.0), # 46
(3.956625815217391, 8.045967102272726, 6.1455495108695635, 3.3112858333333324, 1.9060538829787232, 0.0, 5.228050212393803, 7.624215531914893, 4.966928749999999, 4.097033007246376, 2.0114917755681816, 0.0), # 47
(3.962974488491049, 8.052287727272727, 6.130749130434782, 3.309130588235293, 1.9027378723404254, 0.0, 5.187804422788607, 7.610951489361701, 4.96369588235294, 4.087166086956521, 2.013071931818182, 0.0), # 48
(3.9691937819693086, 8.058480852272725, 6.115305054347826, 3.306871225490196, 1.899264840425532, 0.0, 5.146153948025987, 7.597059361702128, 4.960306838235294, 4.076870036231884, 2.014620213068181, 0.0), # 49
(3.9752877237851663, 8.064545454545453, 6.099239130434782, 3.3045098039215683, 1.8956382978723403, 0.0, 5.103173413293353, 7.582553191489361, 4.956764705882353, 4.066159420289854, 2.016136363636363, 0.0), # 50
(3.9812603420716113, 8.070480511363634, 6.082573206521739, 3.302048382352941, 1.8918617553191486, 0.0, 5.0589374437781105, 7.567447021276594, 4.953072573529411, 4.055048804347826, 2.0176201278409085, 0.0), # 51
(3.987115664961637, 8.076284999999999, 6.065329130434782, 3.299489019607843, 1.8879387234042553, 0.0, 5.013520664667666, 7.551754893617021, 4.949233529411765, 4.043552753623188, 2.0190712499999997, 0.0), # 52
(3.992857720588235, 8.081957897727271, 6.047528749999999, 3.2968337745098037, 1.8838727127659571, 0.0, 4.966997701149425, 7.5354908510638285, 4.945250661764706, 4.0316858333333325, 2.020489474431818, 0.0), # 53
(3.9984905370843995, 8.08749818181818, 6.0291939130434775, 3.294084705882353, 1.8796672340425529, 0.0, 4.919443178410794, 7.5186689361702115, 4.941127058823529, 4.019462608695651, 2.021874545454545, 0.0), # 54
(4.00401814258312, 8.092904829545454, 6.010346467391303, 3.2912438725490194, 1.8753257978723403, 0.0, 4.87093172163918, 7.501303191489361, 4.936865808823529, 4.006897644927535, 2.0232262073863634, 0.0), # 55
(4.0094445652173905, 8.098176818181816, 5.991008260869564, 3.288313333333333, 1.8708519148936167, 0.0, 4.821537956021989, 7.483407659574467, 4.9324699999999995, 3.994005507246376, 2.024544204545454, 0.0), # 56
(4.014773833120205, 8.103313125, 5.971201141304347, 3.285295147058823, 1.8662490957446805, 0.0, 4.771336506746626, 7.464996382978722, 4.927942720588234, 3.980800760869564, 2.02582828125, 0.0), # 57
(4.0200099744245525, 8.108312727272725, 5.950946956521738, 3.2821913725490197, 1.8615208510638295, 0.0, 4.7204019990005, 7.446083404255318, 4.923287058823529, 3.9672979710144918, 2.0270781818181813, 0.0), # 58
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59
)
passenger_allighting_rate = (
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 0
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 1
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 2
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 3
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 4
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 5
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 6
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 7
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 8
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 9
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 10
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 11
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 12
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 13
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 14
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 15
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 16
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 17
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 18
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 19
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 20
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 21
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 22
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 23
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 24
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 25
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 26
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 27
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 28
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 29
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 30
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 31
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 32
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 33
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 34
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 35
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 36
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 37
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 38
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 39
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 40
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 41
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 42
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 43
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 44
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 45
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 46
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 47
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 48
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 49
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 50
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 51
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 52
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 53
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 54
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 55
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 56
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 57
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 58
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 59
)
"""
parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html
"""
#initial entropy
entropy = 258194110137029475889902652135037600173
#index for seed sequence child
child_seed_index = (
1, # 0
44, # 1
)
|
"""
PASSENGERS
"""
num_passengers = 2757
passenger_arriving = ((3, 9, 6, 2, 3, 0, 9, 5, 3, 3, 1, 0), (2, 11, 10, 1, 1, 0, 2, 4, 2, 2, 0, 0), (1, 10, 5, 3, 2, 0, 5, 12, 6, 3, 1, 0), (5, 8, 7, 2, 1, 0, 6, 7, 5, 5, 1, 0), (3, 5, 5, 3, 2, 0, 9, 8, 4, 0, 1, 0), (1, 9, 11, 4, 1, 0, 7, 7, 6, 4, 0, 0), (3, 8, 5, 3, 0, 0, 6, 9, 1, 6, 1, 0), (3, 6, 7, 2, 1, 0, 2, 2, 5, 1, 1, 0), (4, 4, 2, 2, 0, 0, 7, 8, 2, 5, 1, 0), (8, 7, 4, 4, 1, 0, 1, 9, 4, 6, 4, 0), (2, 5, 8, 5, 3, 0, 7, 8, 2, 6, 0, 0), (4, 10, 2, 2, 1, 0, 7, 7, 6, 4, 6, 0), (5, 10, 5, 4, 4, 0, 3, 10, 8, 6, 3, 0), (4, 11, 7, 5, 0, 0, 10, 9, 4, 4, 2, 0), (4, 11, 5, 4, 2, 0, 7, 7, 5, 5, 3, 0), (1, 8, 3, 3, 0, 0, 3, 7, 3, 4, 2, 0), (1, 10, 8, 1, 3, 0, 8, 7, 7, 9, 3, 0), (8, 9, 7, 3, 4, 0, 7, 6, 5, 2, 1, 0), (4, 11, 6, 1, 0, 0, 5, 4, 7, 3, 2, 0), (3, 10, 7, 5, 2, 0, 5, 4, 5, 4, 0, 0), (5, 10, 6, 4, 2, 0, 1, 13, 8, 7, 3, 0), (4, 4, 7, 5, 1, 0, 7, 8, 1, 9, 5, 0), (4, 6, 4, 3, 2, 0, 7, 10, 1, 6, 2, 0), (1, 5, 6, 7, 2, 0, 4, 5, 6, 3, 2, 0), (4, 10, 10, 0, 1, 0, 8, 4, 2, 6, 3, 0), (4, 8, 4, 3, 1, 0, 4, 6, 5, 2, 5, 0), (3, 13, 9, 5, 4, 0, 3, 10, 5, 4, 1, 0), (2, 10, 5, 6, 3, 0, 8, 6, 3, 1, 2, 0), (6, 9, 8, 5, 6, 0, 4, 10, 8, 3, 1, 0), (2, 9, 5, 3, 3, 0, 4, 11, 3, 5, 0, 0), (6, 7, 7, 2, 1, 0, 5, 8, 7, 4, 1, 0), (5, 3, 5, 3, 1, 0, 4, 5, 7, 6, 2, 0), (3, 9, 7, 4, 0, 0, 5, 5, 8, 3, 1, 0), (3, 6, 7, 1, 3, 0, 4, 5, 2, 4, 2, 0), (2, 8, 13, 5, 1, 0, 8, 4, 9, 4, 5, 0), (5, 11, 5, 3, 4, 0, 4, 6, 9, 5, 1, 0), (3, 9, 8, 3, 2, 0, 7, 9, 7, 3, 5, 0), (2, 8, 0, 2, 2, 0, 7, 10, 11, 4, 3, 0), (1, 13, 5, 4, 0, 0, 5, 6, 1, 5, 1, 0), (4, 10, 5, 3, 2, 0, 13, 7, 5, 5, 4, 0), (5, 6, 10, 4, 3, 0, 2, 10, 4, 2, 1, 0), (4, 9, 4, 1, 2, 0, 5, 10, 3, 1, 3, 0), (3, 7, 7, 5, 1, 0, 3, 9, 7, 2, 6, 0), (4, 7, 9, 2, 2, 0, 4, 8, 4, 4, 1, 0), (3, 9, 7, 3, 4, 0, 5, 9, 6, 1, 2, 0), (1, 10, 5, 2, 3, 0, 10, 7, 5, 0, 1, 0), (5, 8, 8, 2, 2, 0, 6, 4, 6, 5, 4, 0), (3, 5, 8, 1, 1, 0, 2, 7, 1, 3, 3, 0), (1, 3, 6, 3, 2, 0, 7, 9, 6, 7, 2, 0), (4, 8, 5, 6, 0, 0, 5, 5, 3, 6, 4, 0), (8, 1, 6, 9, 3, 0, 5, 5, 3, 3, 4, 0), (4, 7, 4, 4, 2, 0, 6, 5, 5, 5, 5, 0), (6, 6, 7, 1, 3, 0, 10, 3, 6, 2, 0, 0), (5, 7, 5, 4, 3, 0, 5, 5, 7, 3, 1, 0), (4, 6, 0, 3, 2, 0, 9, 11, 2, 1, 2, 0), (6, 9, 6, 1, 3, 0, 3, 6, 7, 4, 1, 0), (3, 7, 7, 4, 2, 0, 7, 8, 5, 4, 2, 0), (3, 10, 5, 4, 1, 0, 5, 7, 6, 1, 0, 0), (3, 12, 4, 3, 2, 0, 4, 6, 7, 10, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
station_arriving_intensity = ((3.1795818700614573, 8.15575284090909, 9.59308322622108, 7.603532608695652, 8.571634615384614, 5.708152173913044), (3.20942641205736, 8.246449918455387, 9.644898645029993, 7.6458772644927535, 8.635879807692307, 5.706206567028985), (3.238930172666081, 8.335801683501682, 9.695484147386459, 7.687289855072463, 8.69876923076923, 5.704201449275362), (3.268068107989464, 8.42371171875, 9.744802779562981, 7.727735054347824, 8.760245192307693, 5.702137092391305), (3.296815174129353, 8.510083606902358, 9.792817587832047, 7.767177536231884, 8.82025, 5.700013768115941), (3.3251463271875914, 8.594820930660775, 9.839491618466152, 7.805581974637681, 8.87872596153846, 5.697831748188405), (3.353036523266023, 8.677827272727273, 9.88478791773779, 7.842913043478261, 8.935615384615383, 5.695591304347826), (3.380460718466491, 8.75900621580387, 9.92866953191945, 7.879135416666666, 8.990860576923078, 5.693292708333334), (3.40739386889084, 8.83826134259259, 9.971099507283634, 7.914213768115941, 9.044403846153847, 5.6909362318840575), (3.4338109306409126, 8.915496235795453, 10.012040890102828, 7.9481127717391304, 9.0961875, 5.68852214673913), (3.459686859818554, 8.990614478114479, 10.051456726649528, 7.980797101449276, 9.146153846153846, 5.68605072463768), (3.4849966125256073, 9.063519652251683, 10.089310063196228, 8.012231431159421, 9.194245192307692, 5.683522237318841), (3.509715144863916, 9.134115340909089, 10.125563946015424, 8.042380434782608, 9.240403846153844, 5.680936956521738), (3.5338174129353224, 9.20230512678872, 10.160181421379605, 8.071208786231884, 9.284572115384616, 5.678295153985506), (3.5572783728416737, 9.267992592592593, 10.193125535561265, 8.098681159420288, 9.326692307692307, 5.6755971014492745), (3.5800729806848106, 9.331081321022726, 10.224359334832902, 8.124762228260868, 9.36670673076923, 5.672843070652174), (3.6021761925665783, 9.391474894781144, 10.25384586546701, 8.149416666666665, 9.404557692307693, 5.6700333333333335), (3.6235629645888205, 9.449076896569863, 10.281548173736075, 8.172609148550725, 9.4401875, 5.667168161231884), (3.64420825285338, 9.503790909090908, 10.307429305912597, 8.194304347826087, 9.473538461538464, 5.664247826086956), (3.664087013462101, 9.555520515046295, 10.331452308269066, 8.214466938405796, 9.504552884615384, 5.661272599637681), (3.683174202516827, 9.604169297138045, 10.353580227077975, 8.2330615942029, 9.533173076923077, 5.658242753623187), (3.7014447761194034, 9.649640838068178, 10.373776108611827, 8.250052989130435, 9.559341346153845, 5.655158559782609), (3.7188736903716704, 9.69183872053872, 10.3920029991431, 8.26540579710145, 9.582999999999998, 5.652020289855073), (3.7354359013754754, 9.730666527251683, 10.408223944944302, 8.279084692028986, 9.604091346153846, 5.6488282155797105), (3.75110636523266, 9.76602784090909, 10.422401992287917, 8.291054347826087, 9.62255769230769, 5.645582608695652), (3.7658600380450684, 9.797826244212962, 10.434500187446444, 8.301279438405798, 9.638341346153844, 5.642283740942029), (3.779671875914545, 9.825965319865318, 10.444481576692374, 8.309724637681159, 9.651384615384615, 5.63893188405797), (3.792516834942932, 9.85034865056818, 10.452309206298198, 8.316354619565217, 9.661629807692309, 5.635527309782609), (3.804369871232075, 9.870879819023568, 10.457946122536418, 8.321134057971014, 9.66901923076923, 5.632070289855072), (3.815205940883816, 9.887462407933501, 10.461355371679518, 8.324027626811594, 9.673495192307692, 5.628561096014493), (3.8249999999999997, 9.9, 10.4625, 8.325, 9.674999999999999, 5.625), (3.834164434143222, 9.910414559659088, 10.461641938405796, 8.324824387254901, 9.674452393617022, 5.620051511744128), (3.843131010230179, 9.920691477272728, 10.459092028985506, 8.324300980392156, 9.672821276595744, 5.612429710144928), (3.8519037563938614, 9.930829474431818, 10.45488668478261, 8.323434926470588, 9.670124202127658, 5.6022092203898035), (3.860486700767263, 9.940827272727272, 10.449062318840578, 8.32223137254902, 9.666378723404256, 5.589464667666167), (3.8688838714833755, 9.950683593749998, 10.441655344202898, 8.320695465686274, 9.661602393617022, 5.574270677161419), (3.8770992966751923, 9.96039715909091, 10.432702173913043, 8.318832352941177, 9.655812765957448, 5.556701874062968), (3.885137004475703, 9.96996669034091, 10.422239221014491, 8.316647181372549, 9.64902739361702, 5.536832883558221), (3.893001023017902, 9.979390909090908, 10.410302898550723, 8.314145098039214, 9.641263829787233, 5.514738330834581), (3.900695380434782, 9.988668536931817, 10.396929619565215, 8.31133125, 9.632539627659574, 5.490492841079459), (3.908224104859335, 9.997798295454546, 10.382155797101449, 8.308210784313726, 9.62287234042553, 5.464171039480259), (3.915591224424552, 10.006778906249998, 10.366017844202899, 8.304788848039216, 9.612279521276594, 5.435847551224389), (3.9228007672634266, 10.015609090909093, 10.348552173913044, 8.301070588235293, 9.600778723404256, 5.40559700149925), (3.929856761508952, 10.024287571022725, 10.329795199275361, 8.297061151960785, 9.5883875, 5.373494015492254), (3.936763235294117, 10.032813068181818, 10.309783333333334, 8.292765686274508, 9.575123404255319, 5.339613218390804), (3.9435242167519178, 10.041184303977271, 10.288552989130435, 8.288189338235293, 9.561003989361701, 5.304029235382309), (3.9501437340153456, 10.0494, 10.266140579710147, 8.28333725490196, 9.546046808510638, 5.266816691654173), (3.956625815217391, 10.05745887784091, 10.24258251811594, 8.278214583333332, 9.530269414893617, 5.228050212393803), (3.962974488491049, 10.065359659090909, 10.217915217391303, 8.272826470588234, 9.513689361702127, 5.187804422788607), (3.9691937819693086, 10.073101065340907, 10.19217509057971, 8.26717806372549, 9.49632420212766, 5.146153948025987), (3.9752877237851663, 10.080681818181816, 10.165398550724637, 8.261274509803922, 9.478191489361702, 5.103173413293353), (3.9812603420716113, 10.088100639204544, 10.137622010869565, 8.255120955882353, 9.459308776595744, 5.0589374437781105), (3.987115664961637, 10.09535625, 10.10888188405797, 8.248722549019607, 9.439693617021277, 5.013520664667666), (3.992857720588235, 10.10244737215909, 10.079214583333332, 8.24208443627451, 9.419363563829787, 4.966997701149425), (3.9984905370843995, 10.109372727272726, 10.04865652173913, 8.235211764705882, 9.398336170212765, 4.919443178410794), (4.00401814258312, 10.116131036931817, 10.017244112318838, 8.22810968137255, 9.376628989361702, 4.87093172163918), (4.0094445652173905, 10.122721022727271, 9.985013768115941, 8.220783333333333, 9.354259574468085, 4.821537956021989), (4.014773833120205, 10.129141406250001, 9.952001902173912, 8.213237867647058, 9.331245478723403, 4.771336506746626), (4.0200099744245525, 10.135390909090907, 9.91824492753623, 8.20547843137255, 9.307604255319148, 4.7204019990005), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
passenger_arriving_acc = ((3, 9, 6, 2, 3, 0, 9, 5, 3, 3, 1, 0), (5, 20, 16, 3, 4, 0, 11, 9, 5, 5, 1, 0), (6, 30, 21, 6, 6, 0, 16, 21, 11, 8, 2, 0), (11, 38, 28, 8, 7, 0, 22, 28, 16, 13, 3, 0), (14, 43, 33, 11, 9, 0, 31, 36, 20, 13, 4, 0), (15, 52, 44, 15, 10, 0, 38, 43, 26, 17, 4, 0), (18, 60, 49, 18, 10, 0, 44, 52, 27, 23, 5, 0), (21, 66, 56, 20, 11, 0, 46, 54, 32, 24, 6, 0), (25, 70, 58, 22, 11, 0, 53, 62, 34, 29, 7, 0), (33, 77, 62, 26, 12, 0, 54, 71, 38, 35, 11, 0), (35, 82, 70, 31, 15, 0, 61, 79, 40, 41, 11, 0), (39, 92, 72, 33, 16, 0, 68, 86, 46, 45, 17, 0), (44, 102, 77, 37, 20, 0, 71, 96, 54, 51, 20, 0), (48, 113, 84, 42, 20, 0, 81, 105, 58, 55, 22, 0), (52, 124, 89, 46, 22, 0, 88, 112, 63, 60, 25, 0), (53, 132, 92, 49, 22, 0, 91, 119, 66, 64, 27, 0), (54, 142, 100, 50, 25, 0, 99, 126, 73, 73, 30, 0), (62, 151, 107, 53, 29, 0, 106, 132, 78, 75, 31, 0), (66, 162, 113, 54, 29, 0, 111, 136, 85, 78, 33, 0), (69, 172, 120, 59, 31, 0, 116, 140, 90, 82, 33, 0), (74, 182, 126, 63, 33, 0, 117, 153, 98, 89, 36, 0), (78, 186, 133, 68, 34, 0, 124, 161, 99, 98, 41, 0), (82, 192, 137, 71, 36, 0, 131, 171, 100, 104, 43, 0), (83, 197, 143, 78, 38, 0, 135, 176, 106, 107, 45, 0), (87, 207, 153, 78, 39, 0, 143, 180, 108, 113, 48, 0), (91, 215, 157, 81, 40, 0, 147, 186, 113, 115, 53, 0), (94, 228, 166, 86, 44, 0, 150, 196, 118, 119, 54, 0), (96, 238, 171, 92, 47, 0, 158, 202, 121, 120, 56, 0), (102, 247, 179, 97, 53, 0, 162, 212, 129, 123, 57, 0), (104, 256, 184, 100, 56, 0, 166, 223, 132, 128, 57, 0), (110, 263, 191, 102, 57, 0, 171, 231, 139, 132, 58, 0), (115, 266, 196, 105, 58, 0, 175, 236, 146, 138, 60, 0), (118, 275, 203, 109, 58, 0, 180, 241, 154, 141, 61, 0), (121, 281, 210, 110, 61, 0, 184, 246, 156, 145, 63, 0), (123, 289, 223, 115, 62, 0, 192, 250, 165, 149, 68, 0), (128, 300, 228, 118, 66, 0, 196, 256, 174, 154, 69, 0), (131, 309, 236, 121, 68, 0, 203, 265, 181, 157, 74, 0), (133, 317, 236, 123, 70, 0, 210, 275, 192, 161, 77, 0), (134, 330, 241, 127, 70, 0, 215, 281, 193, 166, 78, 0), (138, 340, 246, 130, 72, 0, 228, 288, 198, 171, 82, 0), (143, 346, 256, 134, 75, 0, 230, 298, 202, 173, 83, 0), (147, 355, 260, 135, 77, 0, 235, 308, 205, 174, 86, 0), (150, 362, 267, 140, 78, 0, 238, 317, 212, 176, 92, 0), (154, 369, 276, 142, 80, 0, 242, 325, 216, 180, 93, 0), (157, 378, 283, 145, 84, 0, 247, 334, 222, 181, 95, 0), (158, 388, 288, 147, 87, 0, 257, 341, 227, 181, 96, 0), (163, 396, 296, 149, 89, 0, 263, 345, 233, 186, 100, 0), (166, 401, 304, 150, 90, 0, 265, 352, 234, 189, 103, 0), (167, 404, 310, 153, 92, 0, 272, 361, 240, 196, 105, 0), (171, 412, 315, 159, 92, 0, 277, 366, 243, 202, 109, 0), (179, 413, 321, 168, 95, 0, 282, 371, 246, 205, 113, 0), (183, 420, 325, 172, 97, 0, 288, 376, 251, 210, 118, 0), (189, 426, 332, 173, 100, 0, 298, 379, 257, 212, 118, 0), (194, 433, 337, 177, 103, 0, 303, 384, 264, 215, 119, 0), (198, 439, 337, 180, 105, 0, 312, 395, 266, 216, 121, 0), (204, 448, 343, 181, 108, 0, 315, 401, 273, 220, 122, 0), (207, 455, 350, 185, 110, 0, 322, 409, 278, 224, 124, 0), (210, 465, 355, 189, 111, 0, 327, 416, 284, 225, 124, 0), (213, 477, 359, 192, 113, 0, 331, 422, 291, 235, 124, 0), (213, 477, 359, 192, 113, 0, 331, 422, 291, 235, 124, 0))
passenger_arriving_rate = ((3.1795818700614573, 6.524602272727271, 5.755849935732647, 3.0414130434782605, 1.7143269230769227, 0.0, 5.708152173913044, 6.857307692307691, 4.562119565217391, 3.8372332904884314, 1.6311505681818177, 0.0), (3.20942641205736, 6.597159934764309, 5.786939187017996, 3.0583509057971012, 1.7271759615384612, 0.0, 5.706206567028985, 6.908703846153845, 4.587526358695652, 3.857959458011997, 1.6492899836910773, 0.0), (3.238930172666081, 6.668641346801345, 5.817290488431875, 3.074915942028985, 1.7397538461538458, 0.0, 5.704201449275362, 6.959015384615383, 4.612373913043478, 3.8781936589545833, 1.6671603367003363, 0.0), (3.268068107989464, 6.738969375, 5.846881667737788, 3.091094021739129, 1.7520490384615384, 0.0, 5.702137092391305, 7.0081961538461535, 4.636641032608694, 3.897921111825192, 1.68474234375, 0.0), (3.296815174129353, 6.808066885521885, 5.875690552699228, 3.106871014492753, 1.76405, 0.0, 5.700013768115941, 7.0562, 4.66030652173913, 3.9171270351328187, 1.7020167213804713, 0.0), (3.3251463271875914, 6.87585674452862, 5.903694971079691, 3.122232789855072, 1.775745192307692, 0.0, 5.697831748188405, 7.102980769230768, 4.6833491847826085, 3.9357966473864603, 1.718964186132155, 0.0), (3.353036523266023, 6.942261818181818, 5.930872750642674, 3.137165217391304, 1.7871230769230766, 0.0, 5.695591304347826, 7.148492307692306, 4.705747826086957, 3.953915167095116, 1.7355654545454544, 0.0), (3.380460718466491, 7.007204972643096, 5.95720171915167, 3.1516541666666664, 1.7981721153846155, 0.0, 5.693292708333334, 7.192688461538462, 4.727481249999999, 3.97146781276778, 1.751801243160774, 0.0), (3.40739386889084, 7.0706090740740715, 5.982659704370181, 3.165685507246376, 1.8088807692307691, 0.0, 5.6909362318840575, 7.2355230769230765, 4.7485282608695645, 3.9884398029134536, 1.7676522685185179, 0.0), (3.4338109306409126, 7.132396988636362, 6.007224534061696, 3.179245108695652, 1.8192374999999996, 0.0, 5.68852214673913, 7.2769499999999985, 4.768867663043478, 4.004816356041131, 1.7830992471590905, 0.0), (3.459686859818554, 7.1924915824915825, 6.030874035989717, 3.19231884057971, 1.829230769230769, 0.0, 5.68605072463768, 7.316923076923076, 4.7884782608695655, 4.020582690659811, 1.7981228956228956, 0.0), (3.4849966125256073, 7.250815721801346, 6.053586037917737, 3.204892572463768, 1.8388490384615384, 0.0, 5.683522237318841, 7.355396153846153, 4.807338858695652, 4.0357240252784905, 1.8127039304503365, 0.0), (3.509715144863916, 7.30729227272727, 6.0753383676092545, 3.2169521739130427, 1.8480807692307688, 0.0, 5.680936956521738, 7.392323076923075, 4.825428260869565, 4.050225578406169, 1.8268230681818176, 0.0), (3.5338174129353224, 7.361844101430976, 6.096108852827762, 3.228483514492753, 1.8569144230769232, 0.0, 5.678295153985506, 7.427657692307693, 4.84272527173913, 4.0640725685518415, 1.840461025357744, 0.0), (3.5572783728416737, 7.414394074074074, 6.115875321336759, 3.2394724637681147, 1.8653384615384612, 0.0, 5.6755971014492745, 7.461353846153845, 4.859208695652172, 4.077250214224506, 1.8535985185185184, 0.0), (3.5800729806848106, 7.46486505681818, 6.134615600899742, 3.249904891304347, 1.873341346153846, 0.0, 5.672843070652174, 7.493365384615384, 4.874857336956521, 4.089743733933161, 1.866216264204545, 0.0), (3.6021761925665783, 7.513179915824915, 6.152307519280206, 3.259766666666666, 1.8809115384615382, 0.0, 5.6700333333333335, 7.523646153846153, 4.889649999999999, 4.101538346186803, 1.8782949789562287, 0.0), (3.6235629645888205, 7.55926151725589, 6.168928904241645, 3.26904365942029, 1.8880374999999998, 0.0, 5.667168161231884, 7.552149999999999, 4.903565489130435, 4.11261926949443, 1.8898153793139725, 0.0), (3.64420825285338, 7.603032727272725, 6.184457583547558, 3.2777217391304343, 1.8947076923076926, 0.0, 5.664247826086956, 7.578830769230771, 4.916582608695652, 4.122971722365039, 1.9007581818181813, 0.0), (3.664087013462101, 7.644416412037035, 6.198871384961439, 3.285786775362318, 1.9009105769230765, 0.0, 5.661272599637681, 7.603642307692306, 4.928680163043477, 4.132580923307626, 1.9111041030092588, 0.0), (3.683174202516827, 7.683335437710435, 6.2121481362467845, 3.2932246376811594, 1.9066346153846152, 0.0, 5.658242753623187, 7.626538461538461, 4.93983695652174, 4.14143209083119, 1.9208338594276086, 0.0), (3.7014447761194034, 7.719712670454542, 6.224265665167096, 3.3000211956521737, 1.911868269230769, 0.0, 5.655158559782609, 7.647473076923076, 4.950031793478261, 4.14951044344473, 1.9299281676136355, 0.0), (3.7188736903716704, 7.753470976430976, 6.23520179948586, 3.3061623188405793, 1.9165999999999994, 0.0, 5.652020289855073, 7.666399999999998, 4.959243478260869, 4.15680119965724, 1.938367744107744, 0.0), (3.7354359013754754, 7.784533221801346, 6.244934366966581, 3.311633876811594, 1.920818269230769, 0.0, 5.6488282155797105, 7.683273076923076, 4.967450815217392, 4.163289577977721, 1.9461333054503365, 0.0), (3.75110636523266, 7.812822272727271, 6.25344119537275, 3.3164217391304347, 1.9245115384615379, 0.0, 5.645582608695652, 7.6980461538461515, 4.974632608695652, 4.168960796915166, 1.9532055681818177, 0.0), (3.7658600380450684, 7.838260995370368, 6.260700112467866, 3.320511775362319, 1.9276682692307685, 0.0, 5.642283740942029, 7.710673076923074, 4.980767663043479, 4.173800074978577, 1.959565248842592, 0.0), (3.779671875914545, 7.860772255892254, 6.266688946015424, 3.3238898550724634, 1.9302769230769228, 0.0, 5.63893188405797, 7.721107692307691, 4.985834782608695, 4.177792630676949, 1.9651930639730635, 0.0), (3.792516834942932, 7.8802789204545425, 6.2713855237789184, 3.326541847826087, 1.9323259615384616, 0.0, 5.635527309782609, 7.729303846153846, 4.98981277173913, 4.180923682519278, 1.9700697301136356, 0.0), (3.804369871232075, 7.8967038552188535, 6.2747676735218505, 3.328453623188405, 1.9338038461538458, 0.0, 5.632070289855072, 7.735215384615383, 4.992680434782608, 4.183178449014567, 1.9741759638047134, 0.0), (3.815205940883816, 7.9099699263468, 6.276813223007711, 3.3296110507246373, 1.9346990384615383, 0.0, 5.628561096014493, 7.738796153846153, 4.994416576086956, 4.184542148671807, 1.9774924815867, 0.0), (3.8249999999999997, 7.92, 6.2775, 3.3299999999999996, 1.9349999999999996, 0.0, 5.625, 7.739999999999998, 4.994999999999999, 4.185, 1.98, 0.0), (3.834164434143222, 7.92833164772727, 6.276985163043477, 3.3299297549019604, 1.9348904787234043, 0.0, 5.620051511744128, 7.739561914893617, 4.994894632352941, 4.184656775362318, 1.9820829119318175, 0.0), (3.843131010230179, 7.936553181818182, 6.275455217391303, 3.329720392156862, 1.9345642553191487, 0.0, 5.612429710144928, 7.738257021276595, 4.994580588235293, 4.1836368115942015, 1.9841382954545455, 0.0), (3.8519037563938614, 7.944663579545454, 6.272932010869566, 3.329373970588235, 1.9340248404255314, 0.0, 5.6022092203898035, 7.736099361702125, 4.994060955882353, 4.181954673913044, 1.9861658948863634, 0.0), (3.860486700767263, 7.952661818181817, 6.269437391304347, 3.3288925490196077, 1.9332757446808508, 0.0, 5.589464667666167, 7.733102978723403, 4.993338823529411, 4.179624927536231, 1.9881654545454543, 0.0), (3.8688838714833755, 7.960546874999998, 6.264993206521739, 3.328278186274509, 1.9323204787234043, 0.0, 5.574270677161419, 7.729281914893617, 4.9924172794117645, 4.176662137681159, 1.9901367187499994, 0.0), (3.8770992966751923, 7.968317727272727, 6.259621304347825, 3.3275329411764707, 1.9311625531914893, 0.0, 5.556701874062968, 7.724650212765957, 4.9912994117647065, 4.173080869565217, 1.9920794318181818, 0.0), (3.885137004475703, 7.975973352272726, 6.253343532608695, 3.3266588725490194, 1.9298054787234038, 0.0, 5.536832883558221, 7.719221914893615, 4.989988308823529, 4.168895688405796, 1.9939933380681816, 0.0), (3.893001023017902, 7.983512727272726, 6.246181739130434, 3.325658039215685, 1.9282527659574464, 0.0, 5.514738330834581, 7.713011063829786, 4.988487058823528, 4.164121159420289, 1.9958781818181814, 0.0), (3.900695380434782, 7.990934829545453, 6.238157771739129, 3.3245324999999997, 1.9265079255319146, 0.0, 5.490492841079459, 7.7060317021276585, 4.98679875, 4.1587718478260856, 1.9977337073863632, 0.0), (3.908224104859335, 7.998238636363636, 6.229293478260869, 3.32328431372549, 1.924574468085106, 0.0, 5.464171039480259, 7.698297872340424, 4.984926470588236, 4.1528623188405795, 1.999559659090909, 0.0), (3.915591224424552, 8.005423124999998, 6.219610706521739, 3.321915539215686, 1.9224559042553186, 0.0, 5.435847551224389, 7.689823617021275, 4.982873308823529, 4.146407137681159, 2.0013557812499996, 0.0), (3.9228007672634266, 8.012487272727274, 6.209131304347826, 3.320428235294117, 1.920155744680851, 0.0, 5.40559700149925, 7.680622978723404, 4.980642352941175, 4.1394208695652175, 2.0031218181818184, 0.0), (3.929856761508952, 8.01943005681818, 6.1978771195652165, 3.3188244607843136, 1.9176774999999997, 0.0, 5.373494015492254, 7.670709999999999, 4.978236691176471, 4.131918079710144, 2.004857514204545, 0.0), (3.936763235294117, 8.026250454545455, 6.18587, 3.317106274509803, 1.9150246808510636, 0.0, 5.339613218390804, 7.660098723404254, 4.975659411764705, 4.123913333333333, 2.0065626136363637, 0.0), (3.9435242167519178, 8.032947443181817, 6.1731317934782615, 3.315275735294117, 1.91220079787234, 0.0, 5.304029235382309, 7.64880319148936, 4.972913602941175, 4.115421195652174, 2.008236860795454, 0.0), (3.9501437340153456, 8.03952, 6.159684347826087, 3.313334901960784, 1.9092093617021275, 0.0, 5.266816691654173, 7.63683744680851, 4.970002352941176, 4.106456231884058, 2.00988, 0.0), (3.956625815217391, 8.045967102272726, 6.1455495108695635, 3.3112858333333324, 1.9060538829787232, 0.0, 5.228050212393803, 7.624215531914893, 4.966928749999999, 4.097033007246376, 2.0114917755681816, 0.0), (3.962974488491049, 8.052287727272727, 6.130749130434782, 3.309130588235293, 1.9027378723404254, 0.0, 5.187804422788607, 7.610951489361701, 4.96369588235294, 4.087166086956521, 2.013071931818182, 0.0), (3.9691937819693086, 8.058480852272725, 6.115305054347826, 3.306871225490196, 1.899264840425532, 0.0, 5.146153948025987, 7.597059361702128, 4.960306838235294, 4.076870036231884, 2.014620213068181, 0.0), (3.9752877237851663, 8.064545454545453, 6.099239130434782, 3.3045098039215683, 1.8956382978723403, 0.0, 5.103173413293353, 7.582553191489361, 4.956764705882353, 4.066159420289854, 2.016136363636363, 0.0), (3.9812603420716113, 8.070480511363634, 6.082573206521739, 3.302048382352941, 1.8918617553191486, 0.0, 5.0589374437781105, 7.567447021276594, 4.953072573529411, 4.055048804347826, 2.0176201278409085, 0.0), (3.987115664961637, 8.076284999999999, 6.065329130434782, 3.299489019607843, 1.8879387234042553, 0.0, 5.013520664667666, 7.551754893617021, 4.949233529411765, 4.043552753623188, 2.0190712499999997, 0.0), (3.992857720588235, 8.081957897727271, 6.047528749999999, 3.2968337745098037, 1.8838727127659571, 0.0, 4.966997701149425, 7.5354908510638285, 4.945250661764706, 4.0316858333333325, 2.020489474431818, 0.0), (3.9984905370843995, 8.08749818181818, 6.0291939130434775, 3.294084705882353, 1.8796672340425529, 0.0, 4.919443178410794, 7.5186689361702115, 4.941127058823529, 4.019462608695651, 2.021874545454545, 0.0), (4.00401814258312, 8.092904829545454, 6.010346467391303, 3.2912438725490194, 1.8753257978723403, 0.0, 4.87093172163918, 7.501303191489361, 4.936865808823529, 4.006897644927535, 2.0232262073863634, 0.0), (4.0094445652173905, 8.098176818181816, 5.991008260869564, 3.288313333333333, 1.8708519148936167, 0.0, 4.821537956021989, 7.483407659574467, 4.9324699999999995, 3.994005507246376, 2.024544204545454, 0.0), (4.014773833120205, 8.103313125, 5.971201141304347, 3.285295147058823, 1.8662490957446805, 0.0, 4.771336506746626, 7.464996382978722, 4.927942720588234, 3.980800760869564, 2.02582828125, 0.0), (4.0200099744245525, 8.108312727272725, 5.950946956521738, 3.2821913725490197, 1.8615208510638295, 0.0, 4.7204019990005, 7.446083404255318, 4.923287058823529, 3.9672979710144918, 2.0270781818181813, 0.0), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
passenger_allighting_rate = ((0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1))
'\nparameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html\n'
entropy = 258194110137029475889902652135037600173
child_seed_index = (1, 44)
|
triggers = {
'lumos': 'automation.potter_pi_spell_lumos',
'nox': 'automation.potter_pi_spell_nox',
'revelio': 'automation.potter_pi_spell_revelio'
}
|
triggers = {'lumos': 'automation.potter_pi_spell_lumos', 'nox': 'automation.potter_pi_spell_nox', 'revelio': 'automation.potter_pi_spell_revelio'}
|
fh= open("romeo.txt")
lst= list()
for line in fh:
wds= line.split()
for word in wds:
if word in wds:
lst.append(word)
lst.sort()
print(lst)
|
fh = open('romeo.txt')
lst = list()
for line in fh:
wds = line.split()
for word in wds:
if word in wds:
lst.append(word)
lst.sort()
print(lst)
|
OEMBED_URL_SCHEME_REGEXPS = {
'slideshare' : r'https?://(?:www\.)?slideshare\.(?:com|net)/.*',
'soundcloud' : r'https?://soundcloud.com/.*',
'vimeo' : r'https?://(?:www\.)?vimeo\.com/.*',
'youtube' : r'https?://(?:(www\.)?youtube\.com|youtu\.be)/.*',
}
OEMBED_BASE_URLS = {
'slideshare' : 'https://www.slideshare.net/api/oembed/2?url=%(url)s',
'soundcloud' : 'https://soundcloud.com/oembed?url=%(url)s&format=json',
'vimeo' : 'https://vimeo.com/api/oembed.json?url=%(url)s&maxwidth=400&maxheight=350',
'youtube' : 'https://www.youtube.com/oembed?url=%(url)s&format=json',
}
|
oembed_url_scheme_regexps = {'slideshare': 'https?://(?:www\\.)?slideshare\\.(?:com|net)/.*', 'soundcloud': 'https?://soundcloud.com/.*', 'vimeo': 'https?://(?:www\\.)?vimeo\\.com/.*', 'youtube': 'https?://(?:(www\\.)?youtube\\.com|youtu\\.be)/.*'}
oembed_base_urls = {'slideshare': 'https://www.slideshare.net/api/oembed/2?url=%(url)s', 'soundcloud': 'https://soundcloud.com/oembed?url=%(url)s&format=json', 'vimeo': 'https://vimeo.com/api/oembed.json?url=%(url)s&maxwidth=400&maxheight=350', 'youtube': 'https://www.youtube.com/oembed?url=%(url)s&format=json'}
|
X, M = tuple(map(int,input().split()))
while X != 0 or M != 0:
print(X*M)
X, M = tuple(map(int,input().split()))
|
(x, m) = tuple(map(int, input().split()))
while X != 0 or M != 0:
print(X * M)
(x, m) = tuple(map(int, input().split()))
|
##HEADING: [PROBLEM NAME]
#PROBLEM STATEMENT:
"""
[PROBLEM STATEMENT LINE1]
[PROBLEM STATEMENT LINE1]
[PROBLEM STATEMENT LINE1]
"""
#SOLUTION-1: ([METHOD DESCRIPTION LIKE BRUTE_FORCE, DP_ALGORITHM, GREEDY_ALGORITHM, ITERATIVE_ALGORITHM, RECURSIVE_ALGORITHM]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#SOLUTION-2: ([METHOD DESCRIPTION LIKE BRUTE_FORCE, DP_ALGORITHM, GREEDY_ALGORITHM, ITERATIVE_ALGORITHM, RECURSIVE_ALGORITHM]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#SOLUTION-3: ([METHOD DESCRIPTION LIKE BRUTE_FORCE, DP_ALGORITHM, GREEDY_ALGORITHM, ITERATIVE_ALGORITHM, RECURSIVE_ALGORITHM]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#SOLUTION-4: ([METHOD DESCRIPTION LIKE BRUTE_FORCE, DP_ALGORITHM, GREEDY_ALGORITHM, ITERATIVE_ALGORITHM, RECURSIVE_ALGORITHM]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#DESCRIPTION:
"""
[##DISCLAIMER: POINT TO BE NOTED BEFORE JUMPING INTO DESCRIPTION]
[DESCRIPTION LINE1]
[DESCRIPTION LINE2]
[DESCRIPTION LINE3]
[DESCRIPTION LINE4]
[DESCRIPTION LINE5]
[DESCRIPTION LINE6]
[DESCRIPTION LINE7]
[DESCRIPTION LINE8]
[ADDITIONAL POINTS TO BE NOTED]
[FURTHER MODIFICATIONS TO ALGORITHM]
[NOTE: 1]
[NOTE: 2]
"""
#APPLICATION-1: ([APPLICATION PROBLEM STATEMENT]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#APPLICATION-2: ([APPLICATION PROBLEM STATEMENT]) --> [TIME COMPLEXITY LIKE O(n), O(log2(n)), O(n^2), O(sqrt(n)), O(n/2)==O(n), O(n/3)==O(n)]
#DESCRIPTION:
"""
[DESCRIPTION LINE1]
[DESCRIPTION LINE2]
[DESCRIPTION LINE3]
[DESCRIPTION LINE4]
[DESCRIPTION LINE5]
[NOTE: 1]
"""
#RELATED ALGORITHMS:
"""
-[RELATED ALGORITHM1]
-[RELATED ALGORITHM2]
-[RELATED ALGORITHM3]
"""
|
"""
[PROBLEM STATEMENT LINE1]
[PROBLEM STATEMENT LINE1]
[PROBLEM STATEMENT LINE1]
"""
'\n [##DISCLAIMER: POINT TO BE NOTED BEFORE JUMPING INTO DESCRIPTION]\n [DESCRIPTION LINE1]\n [DESCRIPTION LINE2]\n [DESCRIPTION LINE3]\n [DESCRIPTION LINE4]\n [DESCRIPTION LINE5]\n [DESCRIPTION LINE6]\n [DESCRIPTION LINE7]\n [DESCRIPTION LINE8]\n \n [ADDITIONAL POINTS TO BE NOTED]\n \n [FURTHER MODIFICATIONS TO ALGORITHM]\n \n [NOTE: 1]\n \n [NOTE: 2]\n\n'
'\n [DESCRIPTION LINE1]\n [DESCRIPTION LINE2]\n [DESCRIPTION LINE3]\n [DESCRIPTION LINE4]\n [DESCRIPTION LINE5]\n\n [NOTE: 1]\n\n'
'\n -[RELATED ALGORITHM1]\n -[RELATED ALGORITHM2]\n -[RELATED ALGORITHM3]\n'
|
FLAG = 'QCTF{4e94227c6c003c0b6da6f81c9177c7e7}'
def check(attempt, context):
return Checked(attempt.answer == FLAG)
|
flag = 'QCTF{4e94227c6c003c0b6da6f81c9177c7e7}'
def check(attempt, context):
return checked(attempt.answer == FLAG)
|
'''
Created on Mar 3, 2014
@author: rgeorgi
'''
class EvalException(Exception):
'''
classdocs
'''
def __init__(self, msg):
'''
Constructor
'''
self.message = msg
class POSEvalException(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
|
"""
Created on Mar 3, 2014
@author: rgeorgi
"""
class Evalexception(Exception):
"""
classdocs
"""
def __init__(self, msg):
"""
Constructor
"""
self.message = msg
class Posevalexception(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
|
class Solution:
def lengthOfLastWord(self, s: str) -> int:
n=0
last=0
for c in s:
if c==" ":
last=n if n>0 else last
n=0
else:
n=n+1
return n if n>0 else last
|
class Solution:
def length_of_last_word(self, s: str) -> int:
n = 0
last = 0
for c in s:
if c == ' ':
last = n if n > 0 else last
n = 0
else:
n = n + 1
return n if n > 0 else last
|
# -*- coding: utf-8 -*-
# see LICENSE.rst
# ----------------------------------------------------------------------------
#
# TITLE : Data
# AUTHOR : Nathaniel and Qing and Vivian
# PROJECT : JAS1101FinalProject
#
# ----------------------------------------------------------------------------
"""Data Management.
Often data is packaged poorly and it can be difficult to understand how
the data should be read.
DON`T PANIC.
This module provides functions to read the contained data.
Routine Listings
----------------
"""
__author__ = "Nathaniel and Qing and Vivian"
# __credits__ = [""]
# __all__ = [
# ""
# ]
###############################################################################
# IMPORTS
###############################################################################
# CODE
###############################################################################
# ------------------------------------------------------------------------
###############################################################################
# END
|
"""Data Management.
Often data is packaged poorly and it can be difficult to understand how
the data should be read.
DON`T PANIC.
This module provides functions to read the contained data.
Routine Listings
----------------
"""
__author__ = 'Nathaniel and Qing and Vivian'
|
class BaseClause:
def __init__(self):
# call super as these classes will be used as mix-in
# and we want the init chain to reach all extended classes in the user of these mix-in
# Update: Its main purpose is to make IDE hint children constructors to call base one,
# as not calling it in an overridden constructor breaks the chain. But not having a
# constructor at all doesn't break it, it rather continues with the next defined
# constructor in the chain.
super().__init__()
|
class Baseclause:
def __init__(self):
super().__init__()
|
class RandomVariable:
"""
Basic class for random variable distribution
"""
def __init__(self):
"""
self.parameter is a dict for parameters in distribution
"""
self.parameter = {}
def fit(self):
pass
def ml(self):
pass
def map(self):
pass
def bayes(self):
pass
def pdf(self):
pass
def sample(self):
pass
|
class Randomvariable:
"""
Basic class for random variable distribution
"""
def __init__(self):
"""
self.parameter is a dict for parameters in distribution
"""
self.parameter = {}
def fit(self):
pass
def ml(self):
pass
def map(self):
pass
def bayes(self):
pass
def pdf(self):
pass
def sample(self):
pass
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file is part of the Scribee project.
"""
__author__ = 'Emanuele Bertoldi <[email protected]>'
__copyright__ = 'Copyright (c) 2011 Emanuele Bertoldi'
__version__ = '0.0.1'
def filter(block):
block.filtered = '\n'.join([l.strip().replace('/*', "").replace("*/", "").strip(" *") for l in block.filtered.splitlines()])
|
"""This file is part of the Scribee project.
"""
__author__ = 'Emanuele Bertoldi <[email protected]>'
__copyright__ = 'Copyright (c) 2011 Emanuele Bertoldi'
__version__ = '0.0.1'
def filter(block):
block.filtered = '\n'.join([l.strip().replace('/*', '').replace('*/', '').strip(' *') for l in block.filtered.splitlines()])
|
"""
https://leetcode.com/problems/reverse-integer/description/
"""
class Solution:
def reverse(self, x: int) -> int:
# sign = -1 if x < 0 else 1
sign = [1, -1][x < 0]
num = sign * x
num_str = str(num)
out = 0
for i in range(len(num_str))[::-1]:
if out > (2 ** 31 - 1):
return 0
out += 10 ** i * int(num_str[i])
return sign * out
def reverse2(self, x: int) -> int:
sign = [1, -1][x < 0]
out = sign * int(str(abs(x))[::-1])
return out if -(2 ** 31) - 1 < out < 2 ** 31 else 0
if __name__ == '__main__':
s = Solution()
assert s.reverse(123) == 321
assert s.reverse(-123) == -321
assert s.reverse(120) == 21
assert s.reverse(100) == 1
assert s.reverse(2 ** 31) == 0
assert s.reverse(1534236496) == 0
assert s.reverse2(123) == 321
assert s.reverse2(-123) == -321
assert s.reverse2(120) == 21
assert s.reverse2(100) == 1
assert s.reverse2(2 ** 31) == 0
assert s.reverse(1534236496) == 0
|
"""
https://leetcode.com/problems/reverse-integer/description/
"""
class Solution:
def reverse(self, x: int) -> int:
sign = [1, -1][x < 0]
num = sign * x
num_str = str(num)
out = 0
for i in range(len(num_str))[::-1]:
if out > 2 ** 31 - 1:
return 0
out += 10 ** i * int(num_str[i])
return sign * out
def reverse2(self, x: int) -> int:
sign = [1, -1][x < 0]
out = sign * int(str(abs(x))[::-1])
return out if -2 ** 31 - 1 < out < 2 ** 31 else 0
if __name__ == '__main__':
s = solution()
assert s.reverse(123) == 321
assert s.reverse(-123) == -321
assert s.reverse(120) == 21
assert s.reverse(100) == 1
assert s.reverse(2 ** 31) == 0
assert s.reverse(1534236496) == 0
assert s.reverse2(123) == 321
assert s.reverse2(-123) == -321
assert s.reverse2(120) == 21
assert s.reverse2(100) == 1
assert s.reverse2(2 ** 31) == 0
assert s.reverse(1534236496) == 0
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Title """
__author__ = "Hiroshi Kajino <[email protected]>"
__copyright__ = "Copyright IBM Corp. 2019, 2021"
MultipleRun_params = {
'DataPreprocessing_params': {
'in_dim': 50,
'train_size': 100,
'val_size': 100,
'test_size': 500},
'Train_params': {
'model_kwargs': {'@alpha': [1e-4, 1e-3, 1e-2, 1e-1],
'@fit_intercept': [True, False]}
},
'PerformanceEvaluation_params': {}
}
|
""" Title """
__author__ = 'Hiroshi Kajino <[email protected]>'
__copyright__ = 'Copyright IBM Corp. 2019, 2021'
multiple_run_params = {'DataPreprocessing_params': {'in_dim': 50, 'train_size': 100, 'val_size': 100, 'test_size': 500}, 'Train_params': {'model_kwargs': {'@alpha': [0.0001, 0.001, 0.01, 0.1], '@fit_intercept': [True, False]}}, 'PerformanceEvaluation_params': {}}
|
# -*- coding: utf-8 -*-
"""
Name:LAVOE YAWA JENNIFER
Stud. ID: 20653245
"""
class Point ( object ):
def __init__ (self , x, y):
self .x = x
self .y = y
def __str__ ( self ):
return f"({ self .x},{ self .y})"
def __sub__ (self , other ):
dx = self .x - other .x
dy = self .y - other .y
return dx , dy
|
"""
Name:LAVOE YAWA JENNIFER
Stud. ID: 20653245
"""
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __str__(self):
return f'({self.x},{self.y})'
def __sub__(self, other):
dx = self.x - other.x
dy = self.y - other.y
return (dx, dy)
|
def get_breadcrumb(cat3):
cat2 = cat3.parent
cat1 = cat3.parent.parent
cat1.url = cat1.goodschannel_set.all()[0].url
breadcrumb = {
'cat1': cat1,
'cat2': cat2,
'cat3': cat3,
}
return breadcrumb
|
def get_breadcrumb(cat3):
cat2 = cat3.parent
cat1 = cat3.parent.parent
cat1.url = cat1.goodschannel_set.all()[0].url
breadcrumb = {'cat1': cat1, 'cat2': cat2, 'cat3': cat3}
return breadcrumb
|
class DynamicObjectSerializer:
def __init__(self, value, many=False):
self._objects = None
self._object = None
if many:
value = tuple(v for v in value)
self._objects = value
else:
self._object = value
@property
def objects(self):
return self._objects
@property
def object(self):
return self._object
@property
def data(self):
if self.objects:
return [self.to_dict(obj) for obj in self._objects]
else:
return self.to_dict(self._object)
def to_dict(self, entity):
data = {}
for field in self.Meta.fields:
if hasattr(entity, field):
data[field] = getattr(entity, field)
return data
|
class Dynamicobjectserializer:
def __init__(self, value, many=False):
self._objects = None
self._object = None
if many:
value = tuple((v for v in value))
self._objects = value
else:
self._object = value
@property
def objects(self):
return self._objects
@property
def object(self):
return self._object
@property
def data(self):
if self.objects:
return [self.to_dict(obj) for obj in self._objects]
else:
return self.to_dict(self._object)
def to_dict(self, entity):
data = {}
for field in self.Meta.fields:
if hasattr(entity, field):
data[field] = getattr(entity, field)
return data
|
myTup = 0, 2, 4, 5, 6, 7
i1, *i2, i3 = myTup
print(i1)
print(i2, type(i2))
print(i3)
|
my_tup = (0, 2, 4, 5, 6, 7)
(i1, *i2, i3) = myTup
print(i1)
print(i2, type(i2))
print(i3)
|
"""
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).
Example 1:
Input: [1,3,5,4,7]
Output: 3
Explanation: The longest continuous increasing subsequence is [1,3,5], its length is 3.
Even though [1,3,5,7] is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4.
Example 2:
Input: [2,2,2,2,2]
Output: 1
Explanation: The longest continuous increasing subsequence is [2], its length is 1.
Note: Length of the array will not exceed 10,000.
"""
class Solution:
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
"""
Method 1:
* Every (continuous) increasing subsequence is disjoint.
* Keep an index pointer, a main counter and a temp counter
for each subarray
* As long as nums[index-1] < nums[index], keep incrementing
the counter
Your runtime beats 65.05 % of python3 submissions
"""
# #Handle boundary conditions
if not nums:
return 0
# #Initialize variables
index = 1
count = -1
tempCount = 1
while index < len(nums):
if nums[index - 1] < nums[index]:
tempCount += 1
else:
count = max(count, tempCount)
tempCount = 1
index += 1
count = max(count, tempCount)
return count
|
"""
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).
Example 1:
Input: [1,3,5,4,7]
Output: 3
Explanation: The longest continuous increasing subsequence is [1,3,5], its length is 3.
Even though [1,3,5,7] is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4.
Example 2:
Input: [2,2,2,2,2]
Output: 1
Explanation: The longest continuous increasing subsequence is [2], its length is 1.
Note: Length of the array will not exceed 10,000.
"""
class Solution:
def find_length_of_lcis(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
'\n Method 1:\n\n * Every (continuous) increasing subsequence is disjoint.\n\n * Keep an index pointer, a main counter and a temp counter\n for each subarray\n * As long as nums[index-1] < nums[index], keep incrementing\n the counter\n\n Your runtime beats 65.05 % of python3 submissions\n '
if not nums:
return 0
index = 1
count = -1
temp_count = 1
while index < len(nums):
if nums[index - 1] < nums[index]:
temp_count += 1
else:
count = max(count, tempCount)
temp_count = 1
index += 1
count = max(count, tempCount)
return count
|
class Color:
BACKGROUND = 236
FOREGROUND = 195
BUTTON_BACKGROUND = 66
FIELD_BACKGROUND = 238 #241
SCROLL_BAR_BACKGROUND = 242
TEXT = 1
INPUT_FIELD = 2
SCROLL_BAR = 3
BUTTON = 4
# color.py
|
class Color:
background = 236
foreground = 195
button_background = 66
field_background = 238
scroll_bar_background = 242
text = 1
input_field = 2
scroll_bar = 3
button = 4
|
def smallest_positive(arr):
# Find the smallest positive number in the list
min = None
for num in arr:
if num > 0:
if min == None or num < min:
min = num
return min
def when_offered(courses, course):
output = []
for semester in courses:
for course_names in courses[semester]:
if course_names == course:
output.append(semester)
return output
if __name__ == "__main__":
choice = int(input("Which Program to execute? Smallest Positives (1) OR Offered Semester (2) [Numeric entry] "))
if choice == 1:
testcases = dict(test1= [4, -6, 7, 2, -4, 10], test2= [.2, 5, 3, -.1, 7, 7, 6], test3= [-6, -9, -7], test4= [], test5= [88.22, -17.41, -26.53, 18.04, -44.81, 7.52, 0.0, 20.98, 11.76])
for key in testcases:
print("Output for {} : {}". format(key,smallest_positive(testcases[key])))
if choice == 2:
courses = {
'spring2020': {'cs101': {'name': 'Building a Search Engine',
'teacher': 'Dave',
'assistant': 'Peter C.'},
'cs373': {'name': 'Programming a Robotic Car',
'teacher': 'Sebastian',
'assistant': 'Andy'}},
'fall2020': {'cs101': {'name': 'Building a Search Engine',
'teacher': 'Dave',
'assistant': 'Sarah'},
'cs212': {'name': 'The Design of Computer Programs',
'teacher': 'Peter N.',
'assistant': 'Andy',
'prereq': 'cs101'},
'cs253': {'name': 'Web Application Engineering - Building a Blog',
'teacher': 'Steve',
'prereq': 'cs101'},
'cs262': {'name': 'Programming Languages - Building a Web Browser',
'teacher': 'Wes',
'assistant': 'Peter C.',
'prereq': 'cs101'},
'cs373': {'name': 'Programming a Robotic Car',
'teacher': 'Sebastian'},
'cs387': {'name': 'Applied Cryptography',
'teacher': 'Dave'}},
'spring2044': {'cs001': {'name': 'Building a Quantum Holodeck',
'teacher': 'Dorina'},
'cs003': {'name': 'Programming a Robotic Robotics Teacher',
'teacher': 'Jasper'},
}
}
testcase = dict(test1= 'cs101', test2= 'bio893')
for key in testcase:
print("Output for {}: {}".format(key,when_offered(courses, testcase[key])))
|
def smallest_positive(arr):
min = None
for num in arr:
if num > 0:
if min == None or num < min:
min = num
return min
def when_offered(courses, course):
output = []
for semester in courses:
for course_names in courses[semester]:
if course_names == course:
output.append(semester)
return output
if __name__ == '__main__':
choice = int(input('Which Program to execute? Smallest Positives (1) OR Offered Semester (2) [Numeric entry] '))
if choice == 1:
testcases = dict(test1=[4, -6, 7, 2, -4, 10], test2=[0.2, 5, 3, -0.1, 7, 7, 6], test3=[-6, -9, -7], test4=[], test5=[88.22, -17.41, -26.53, 18.04, -44.81, 7.52, 0.0, 20.98, 11.76])
for key in testcases:
print('Output for {} : {}'.format(key, smallest_positive(testcases[key])))
if choice == 2:
courses = {'spring2020': {'cs101': {'name': 'Building a Search Engine', 'teacher': 'Dave', 'assistant': 'Peter C.'}, 'cs373': {'name': 'Programming a Robotic Car', 'teacher': 'Sebastian', 'assistant': 'Andy'}}, 'fall2020': {'cs101': {'name': 'Building a Search Engine', 'teacher': 'Dave', 'assistant': 'Sarah'}, 'cs212': {'name': 'The Design of Computer Programs', 'teacher': 'Peter N.', 'assistant': 'Andy', 'prereq': 'cs101'}, 'cs253': {'name': 'Web Application Engineering - Building a Blog', 'teacher': 'Steve', 'prereq': 'cs101'}, 'cs262': {'name': 'Programming Languages - Building a Web Browser', 'teacher': 'Wes', 'assistant': 'Peter C.', 'prereq': 'cs101'}, 'cs373': {'name': 'Programming a Robotic Car', 'teacher': 'Sebastian'}, 'cs387': {'name': 'Applied Cryptography', 'teacher': 'Dave'}}, 'spring2044': {'cs001': {'name': 'Building a Quantum Holodeck', 'teacher': 'Dorina'}, 'cs003': {'name': 'Programming a Robotic Robotics Teacher', 'teacher': 'Jasper'}}}
testcase = dict(test1='cs101', test2='bio893')
for key in testcase:
print('Output for {}: {}'.format(key, when_offered(courses, testcase[key])))
|
def my_abs(x):
if not isinstance(x, (int, float)):
raise TypeError('bad operand type')
if x >= 0:
return x
else:
return -x
|
def my_abs(x):
if not isinstance(x, (int, float)):
raise type_error('bad operand type')
if x >= 0:
return x
else:
return -x
|
while True:
a, b = map(int, input().split(" "))
if not a and not b:
break
print(a + b)
|
while True:
(a, b) = map(int, input().split(' '))
if not a and (not b):
break
print(a + b)
|
class Solution:
"""
@param x: An integer
@return: The sqrt of x
"""
def sqrt(self, x):
if x < 1:
return 0
l, r = 1, x//2 + 1
while r > l:
mid = (l + r) // 2
square = mid * mid
if square > x:
r = mid - 1
elif square < x:
l = mid + 1
else:
return mid
if r * r > x:
return r - 1
return r
|
class Solution:
"""
@param x: An integer
@return: The sqrt of x
"""
def sqrt(self, x):
if x < 1:
return 0
(l, r) = (1, x // 2 + 1)
while r > l:
mid = (l + r) // 2
square = mid * mid
if square > x:
r = mid - 1
elif square < x:
l = mid + 1
else:
return mid
if r * r > x:
return r - 1
return r
|
class LetterFrequencyPair:
def __init__(self, letter: str, frequency: int):
self.letter: str = letter
self.frequency: int = frequency
def __str__(self):
return '{}:{}'.format(self.letter, self.frequency)
class HTreeNode:
pass
print(LetterFrequencyPair('A', 23))
|
class Letterfrequencypair:
def __init__(self, letter: str, frequency: int):
self.letter: str = letter
self.frequency: int = frequency
def __str__(self):
return '{}:{}'.format(self.letter, self.frequency)
class Htreenode:
pass
print(letter_frequency_pair('A', 23))
|
class HashMap:
def __init__(self, size):
self.array_size = size
self.array = [None] * size
def hash(self, key, count_collisions = 0):
return sum(key.encode()) + count_collisions
def compressor(self, hash_code):
return hash_code % self.array_size
def assign(self, key, value):
chosen_index = self.compressor(self.hash(key))
current_array_value = self.array[chosen_index]
if not current_array_value:
self.array[chosen_index] = [key, value]
else:
if current_array_value[0] == key:
self.array[chosen_index][1] = value
else:
number_of_collisions = 1
while current_array_value != key:
new_hash_code = self.hash(key, number_of_collisions)
new_array_index = self.compressor(new_hash_code)
new_array_value = self.array[new_array_index]
if not new_array_value:
self.array[new_array_index] = [key, value]
return
if new_array_value[0] == key:
new_array_value[1] = value
return
number_of_collisions += 1
def retrieve(self, key):
potential_index = self.compressor(self.hash(key))
possible_return_value = self.array[potential_index]
if not possible_return_value:
return None
else:
if possible_return_value[0] == key:
return possible_return_value[1]
else:
retrieval_collisions = 1
while possible_return_value[0] != key:
new_hash_code = self.hash(key, retrieval_collisions)
retrieving_array_index = self.compressor(new_hash_code)
possible_return_value = self.array[retrieving_array_index]
if not possible_return_value:
return None
if possible_return_value[0] == key:
return possible_return_value[1]
retrieval_collisions += 1
flower_definitions = [['begonia', 'cautiousness'], ['chrysanthemum', 'cheerfulness'],
['carnation', 'memories'], ['daisy', 'innocence'],
['hyacinth', 'playfulness'], ['lavender', 'devotion'],
['magnolia', 'dignity'], ['morning glory', 'unrequited love'],
['periwinkle', 'new friendship'], ['poppy', 'rest'],
['rose', 'love'], ['snapdragon', 'grace'],
['sunflower', 'longevity'], ['wisteria', 'good luck']]
h = HashMap(len(flower_definitions))
for i in flower_definitions:
h.assign(i[0], i[1])
print(h.retrieve("daisy"))
print(h.retrieve("magnolia"))
print(h.retrieve("carnation"))
print(h.retrieve("morning glory"))
|
class Hashmap:
def __init__(self, size):
self.array_size = size
self.array = [None] * size
def hash(self, key, count_collisions=0):
return sum(key.encode()) + count_collisions
def compressor(self, hash_code):
return hash_code % self.array_size
def assign(self, key, value):
chosen_index = self.compressor(self.hash(key))
current_array_value = self.array[chosen_index]
if not current_array_value:
self.array[chosen_index] = [key, value]
elif current_array_value[0] == key:
self.array[chosen_index][1] = value
else:
number_of_collisions = 1
while current_array_value != key:
new_hash_code = self.hash(key, number_of_collisions)
new_array_index = self.compressor(new_hash_code)
new_array_value = self.array[new_array_index]
if not new_array_value:
self.array[new_array_index] = [key, value]
return
if new_array_value[0] == key:
new_array_value[1] = value
return
number_of_collisions += 1
def retrieve(self, key):
potential_index = self.compressor(self.hash(key))
possible_return_value = self.array[potential_index]
if not possible_return_value:
return None
elif possible_return_value[0] == key:
return possible_return_value[1]
else:
retrieval_collisions = 1
while possible_return_value[0] != key:
new_hash_code = self.hash(key, retrieval_collisions)
retrieving_array_index = self.compressor(new_hash_code)
possible_return_value = self.array[retrieving_array_index]
if not possible_return_value:
return None
if possible_return_value[0] == key:
return possible_return_value[1]
retrieval_collisions += 1
flower_definitions = [['begonia', 'cautiousness'], ['chrysanthemum', 'cheerfulness'], ['carnation', 'memories'], ['daisy', 'innocence'], ['hyacinth', 'playfulness'], ['lavender', 'devotion'], ['magnolia', 'dignity'], ['morning glory', 'unrequited love'], ['periwinkle', 'new friendship'], ['poppy', 'rest'], ['rose', 'love'], ['snapdragon', 'grace'], ['sunflower', 'longevity'], ['wisteria', 'good luck']]
h = hash_map(len(flower_definitions))
for i in flower_definitions:
h.assign(i[0], i[1])
print(h.retrieve('daisy'))
print(h.retrieve('magnolia'))
print(h.retrieve('carnation'))
print(h.retrieve('morning glory'))
|
"""
Contains a collection of useful functions when working
with strings.
"""
def shorten_to(string: str, length: int, extension: bool = False):
"""
When a user uploaded a plugin with a pretty long file/URL name,
it is useful to crop this file name to avoid weird UI behavior.
This method takes a string (in this example the file name) and
shortens it to the given length.
If your string is a URL or link name,
it will be cut to the given length and '...' will be appended indicating
that this string has been shortened.
If your string is a file name, only the middle part will be replaced
by '...', so that the user is able to see the file extension of the
file they are about to download.
:param string: The string to shorten.
:param length: The length to shorten the string to.
:param extension: Whether this string represents a file name that
contains a file extension. In this case, the file
extension won't be cropped so that the user can
see which file they are about to download.
:return: The shortened string ("SuperNicePlugin.jar" -> 'Super...in.jar')
"""
if len(string) > length:
if extension:
ext = string.split(".")[-1]
str_only = ".".join(string.split(".")[0:-1])
parts_len = round((length - 3 - len(ext)) / 2)
return f"{str_only[0:parts_len]}...{str_only[-parts_len:]}.{ext}"
return f"{string[0:length-3]}..."
return string
|
"""
Contains a collection of useful functions when working
with strings.
"""
def shorten_to(string: str, length: int, extension: bool=False):
"""
When a user uploaded a plugin with a pretty long file/URL name,
it is useful to crop this file name to avoid weird UI behavior.
This method takes a string (in this example the file name) and
shortens it to the given length.
If your string is a URL or link name,
it will be cut to the given length and '...' will be appended indicating
that this string has been shortened.
If your string is a file name, only the middle part will be replaced
by '...', so that the user is able to see the file extension of the
file they are about to download.
:param string: The string to shorten.
:param length: The length to shorten the string to.
:param extension: Whether this string represents a file name that
contains a file extension. In this case, the file
extension won't be cropped so that the user can
see which file they are about to download.
:return: The shortened string ("SuperNicePlugin.jar" -> 'Super...in.jar')
"""
if len(string) > length:
if extension:
ext = string.split('.')[-1]
str_only = '.'.join(string.split('.')[0:-1])
parts_len = round((length - 3 - len(ext)) / 2)
return f'{str_only[0:parts_len]}...{str_only[-parts_len:]}.{ext}'
return f'{string[0:length - 3]}...'
return string
|
def solution(n):
n = str(n)
if len(n) % 2 != 0: return False
n = list(n)
a,b = n[:len(n)//2], n[len(n)//2:]
a,b = list(map(int, a)), list(map(int, b))
return sum(a) == sum(b)
|
def solution(n):
n = str(n)
if len(n) % 2 != 0:
return False
n = list(n)
(a, b) = (n[:len(n) // 2], n[len(n) // 2:])
(a, b) = (list(map(int, a)), list(map(int, b)))
return sum(a) == sum(b)
|
def number(lines):
"""
Your team is writing a fancy new text editor and you've been tasked with implementing the line numbering.
Write a function which takes a list of strings and returns each line prepended by the correct number.
The numbering starts at 1. The format is n: string. Notice the colon and space in between.
"""
return [f'{index}: {value}' for index, value in enumerate(lines, 1)]
|
def number(lines):
"""
Your team is writing a fancy new text editor and you've been tasked with implementing the line numbering.
Write a function which takes a list of strings and returns each line prepended by the correct number.
The numbering starts at 1. The format is n: string. Notice the colon and space in between.
"""
return [f'{index}: {value}' for (index, value) in enumerate(lines, 1)]
|
# Copyright 2022 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper for common operations on a device with Cast capabilities."""
CAST_BROWSERS = [
'platform_app'
]
|
"""A wrapper for common operations on a device with Cast capabilities."""
cast_browsers = ['platform_app']
|
def main():
while True:
userinput = input("Write something (quit ends): ")
if(userinput == "quit"):
break
else:
tester(userinput)
def tester(givenstring="Too short"):
if(len(givenstring) < 10):
print("Too short")
else:
print(givenstring)
if __name__ == "__main__":
main()
|
def main():
while True:
userinput = input('Write something (quit ends): ')
if userinput == 'quit':
break
else:
tester(userinput)
def tester(givenstring='Too short'):
if len(givenstring) < 10:
print('Too short')
else:
print(givenstring)
if __name__ == '__main__':
main()
|
df = pd.read_csv(DATA, delimiter=';')
df[['EV1', 'EV2', 'EV3']] = df['Participants'].str.split(', ', expand=True)
df['Duration'] = pd.to_timedelta(df['Duration'])
result = (pd.concat([
df[['EV1', 'Duration']].rename(columns={'EV1': 'Astronaut'}),
df[['EV2', 'Duration']].rename(columns={'EV2': 'Astronaut'}),
df[['EV3', 'Duration']].rename(columns={'EV3': 'Astronaut'})
], axis='rows')
.groupby('Astronaut')
.sum()
.sort_values('Duration', ascending=False))
|
df = pd.read_csv(DATA, delimiter=';')
df[['EV1', 'EV2', 'EV3']] = df['Participants'].str.split(', ', expand=True)
df['Duration'] = pd.to_timedelta(df['Duration'])
result = pd.concat([df[['EV1', 'Duration']].rename(columns={'EV1': 'Astronaut'}), df[['EV2', 'Duration']].rename(columns={'EV2': 'Astronaut'}), df[['EV3', 'Duration']].rename(columns={'EV3': 'Astronaut'})], axis='rows').groupby('Astronaut').sum().sort_values('Duration', ascending=False)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.