content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def rob(self, root: TreeNode) -> int:
def helper(root):
if root is None:
return [0,0]
x = helper(root.left)
y = helper(root.right)
return [root.val+x[1]+y[1],max(x)+max(y)]
ans = helper(root)
return max(ans)
| class Treenode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def rob(self, root: TreeNode) -> int:
def helper(root):
if root is None:
return [0, 0]
x = helper(root.left)
y = helper(root.right)
return [root.val + x[1] + y[1], max(x) + max(y)]
ans = helper(root)
return max(ans) |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name' : 'Double Validation on Purchase Requisition',
'version' : '0.1',
'category': 'Purchase Management',
'images' : [],
'depends' : ['purchase_requisition'],
'author' : 'Ecosoft',
'description': """
Double-validation for purchase requisition.
==========================================
The objective of this module is to allow splitting of process between requester and approving manager.
This module adding new state "Send to Purchase", in which state, only manager can - Send to supplier, Create Quotation, Purchase Done
For PR Groups,
* User: Can only click Sent to Purchase
* Manager: Can do everything with the Purchase Requisition
""",
'website': 'http://www.ecosoft.co.th',
'data': [
'purchase_requisition_view.xml',
],
'test': [
],
'demo': [],
'installable': True,
'auto_install': False
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| {'name': 'Double Validation on Purchase Requisition', 'version': '0.1', 'category': 'Purchase Management', 'images': [], 'depends': ['purchase_requisition'], 'author': 'Ecosoft', 'description': '\nDouble-validation for purchase requisition.\n==========================================\n\nThe objective of this module is to allow splitting of process between requester and approving manager.\nThis module adding new state "Send to Purchase", in which state, only manager can - Send to supplier, Create Quotation, Purchase Done\nFor PR Groups,\n* User: Can only click Sent to Purchase\n* Manager: Can do everything with the Purchase Requisition\n ', 'website': 'http://www.ecosoft.co.th', 'data': ['purchase_requisition_view.xml'], 'test': [], 'demo': [], 'installable': True, 'auto_install': False} |
# Made by Wallee#8314/Red-exe-Engineer
# Thanks @Bigjango helping :p
Block = {
"Air": [0, 0],
"Stone": [1, 0],
"Grass": [2, 0],
"Dirt": [3, 0],
"Cobblestone": [4, 0],
"Wooden Planks": [5, 0],
"Saplin":[6, 0],
"Oak Saplin": [6, 0],
"Spruce Saplin": [6, 1],
"Birch Saplin": [6, 2],
"Bedrock": [7, 0],
"Water": [8, 0],
"Water Stationary": [9, 0],
"Lava": [10, 0],
"Lava Staionary": [11, 0],
"Sand": [12, 0],
"Gravel": [13, 0],
"Gold Ore": [14, 0],
"Iron Ore": [15, 0],
"Coal Ore": [16, 0],
"Log": [17, 0],
"Oak Log": [17, 0],
"Spruce Log": [17, 1],
"Birch Log": [17, 2],
"Leaves": [18, 0],
"Oak Leaves": [18, 0],
"Spruce Leaves": [18, 1],
"Birch Leaves": [18, 2],
"Glass": [20, 0],
"Lapis Lazuli Ore": [21, 0],
"Lapis Lazuli Block": [22, 0],
"Sandstone": [24, 0],
"Chiseled Sandstone": [24, 1],
"Smooth Sandstone": [24, 2],
"Bed": [26, 0],
"Bed Foot": [26, 0],
"Bed Head": [26, 8],
"North Bed Foot": [26, 0],
"North Bed Head": [26, 8],
"East Bed Foot": [26, 1],
"East Bed Head": [26, 9],
"South Bed Foot": [26, 2],
"South Bed Head": [26, 10],
"West Bed Foot": [26, 3],
"West Bed Head": [26, 11],
"Cobweb": [30, 0],
"Shrub": [31, 0],
"Tall Grass": [31, 1],
"Fern": [31, 3],
"Wool": [35, 0],
"White Wool": [35, 0],
"Orange Wool": [35, 1],
"Magenta Wool": [35, 2],
"Light Blue Wool": [35, 3],
"Yello Wool": [35, 4],
"Lime Wool": [35, 5],
"Pink Wool": [35, 6],
"Grey Wool": [35, 7],
"Light Grey Wool": [35, 8],
"Cyan Wool": [35, 9],
"Purple Wool": [35, 10],
"Blue Wool": [35, 11],
"Brown Wool": [35, 12],
"Green Wool": [35, 13],
"Red Wool": [35, 14],
"Black Wool": [35, 15],
"Flower": [37, 0],
"Poppy": [38, 0],
"Brown Mushroom": [39, 0],
"Red Mushroom": [40, 0],
"Block of Gold": [41, 0],
"Block of Iron": [42, 0],
"Double Stone Slab": [43, 0],
"Smooth Stone": [43, 6],
"Stone Slab": [44, 0],
"Sandstone Slab": [44, 1],
"Wooden Slab": [44, 2],
"Cobblestone Slab": [44, 3],
"Bricks Slab": [44, 4],
"Stone Bricks Slab": [44, 5],
"Lower Stone Slab": [44, 0],
"Lower Sandstone Slab": [44, 1],
"Lower Wooden Slab": [44, 2],
"Lower Cobblestone Slab": [44, 3],
"Lower Bricks Slab": [44, 4],
"Lower Stone Bricks Slab": [44, 5],
"Upper Stone Slab": [44, 8],
"Upper Sandstone Slab": [44, 9],
"Upper Wooden Slab": [44, 10],
"Upper Cobblestone Slab": [44, 11],
"Upper Bricks Slab": [44, 12],
"Upper Stone Bricks Slab": [44, 13],
"Stone Slab Block": [43, 0],
"Sandstone Slab Block": [43, 1],
"Wooden Slab Block": [43, 2],
"Cobblestone Slab Block": [43, 3],
"Bricks Slab Block": [43, 4],
"Stone Bricks Slab Block": [43, 5],
"Smooth Stone": [43, 6],
"Bricks": [45, 0],
"TNT": [46, 0],
"Active TNT": [46, 1],
"Bookshelf": [47, 0],
"Moss Stone": [48, 0],
"Obsidian": [49, 0],
"Torch": [50, 0],
"Wooden Stairs": [53, 2],
"North Lower Wooden Stairs": [53, 2],
"East Lower Wooden Stairs": [53, 1],
"South Lower Wooden Stairs": [53, 3],
"West Lower Wooden Stairs": [53, 0],
"North Upper Wooden Stairs": [53, 6],
"East Upper Wooden Stairs": [53, 5],
"South Upper Wooden Stairs": [53, 7],
"West Upper Wooden Stairs": [53, 4],
"Chest": [54, 2],
"Blank Chest": [54, 1],
"North Chest": [54, 2],
"East Chest": [54, 5],
"South Chest": [54, 3],
"West Chest": [54, 4],
"Diamond Ore": [56, 0],
"Diamond Block": [57, 0],
"Crafting Table": [58, 0],
"Crops": [59, 0],
"Crops 1": [59, 1],
"Crops 2": [59, 2],
"Crops 3": [59, 3],
"Crops 4": [59, 4],
"Crops 5": [59, 5],
"Crops 6": [59, 6],
"Crops 7": [59, 7],
"Farmland": [60, 0],
"Wet Farmland": [60, 1],
"Furnace": [61, 0],
"Active Furnace": [62, 0],
"Sign": [63, 0],
"Sign 0": [63, 0],
"Sign 1": [63, 1],
"Sign 2": [63, 2],
"Sign 3": [63, 3],
"Sign 4": [63, 4],
"Sign 5": [63, 5],
"Sign 6": [63, 6],
"Sign 7": [63, 7],
"Sign 8": [63, 8],
"Sign 9": [63, 9],
"Sign 10": [63, 10],
"Sign 11": [63, 11],
"Sign 12": [63, 12],
"Sign 13": [63, 13],
"Sign 14": [63, 14],
"Sign 15": [63, 15],
"Lower North Closed Wooden Door": [64, 1],
"Lower North Opened Wooden Door": [64, 5],
"Lower East Closed Wooden Door": [64, 2],
"Lower East Opened Wooden Door": [64, 2],
"Lower South Closed Wooden Door": [46, 3],
"Lower South Opened Wooden Door": [64, 7],
"Lower West Closed Wooden Door": [64, 0],
"Lower West Opened Wooden Door": [64, 4],
"Upper Left Wooden Door": [64, 8],
"Upper Right Wooden Door": [64, 9],
"Lower Wooden Door": [64, 1],
"Upper Wooden Door": [64, 8],
"Ladder": [65, 2],
"North Ladder": [65, 2],
"East Ladder": [65, 5],
"South Ladder": [65, 3],
"West Ladder": [65, 4],
"Cobblestone Stairs": [67, 2],
"North Lower Cobblestone Stairs": [67, 2],
"East Lower Cobblestone Stairs": [67, 1],
"South Lower Cobblestone Stairs": [67, 3],
"West Lower Cobblestone Stairs": [67, 0],
"North Upper Cobblestone Stairs": [57, 6],
"East Upper Cobbleston Stairs": [57, 5],
"South Upper Cobbleston Stairs": [57, 7],
"West Upper Cobbleston Stairs": [57, 4],
"Wall Sign": [68, 2],
"North Wall Sign": [68, 2],
"East Wall Sign": [68, 5],
"South Wall Sign": [68, 1],
"West Wall Sign": [68, 4],
"Lower North Closed Iron Door": [71, 1],
"Lower North Opened Iron Door": [71, 5],
"Lower East Closed Iron Door": [71, 2],
"Lower East Opened Iron Door": [71, 2],
"Lower South Closed Iron Door": [71, 3],
"Lower South Opened Iron Door": [71, 7],
"Lower West Closed Iron Door": [71, 0],
"Lower West Opened Iron Door": [71, 4],
"Upper Left Iron Door": [71, 8],
"Upper Right Iron Door": [71, 9],
"Lower Iron Door": [71, 1],
"Upper Iron Door": [71, 8],
"Redstone Ore": [73, 0],
"Snow": [78, 0],
"Ice": [79, 0],
"Snow Block": [80, 0],
"Cactus": [81, 0],
"Clay Block": [82, 0],
"Sugercane": [83, 0],
"Fence": [85, 0],
"Glowstone Block": [89, 0],
"Invisible Bedrock": [95, 0],
"Trapdoor": [96, 0],
"North Closed Trapdoor": [96, 0],
"East Closed Trapdoor": [96, 3],
"South Closed Trapdoor": [96, 1],
"West Closed Trapdoor": [96, 2],
"North Opened Trapdoor": [96, 4],
"East Opened Trapdoor": [96, 7],
"South Opened Trapdoor": [96, 5],
"West Opened Trapdoor": [96, 6],
"Stone Bricks": [98, 0],
"Mossy Stone Bricks": [98, 1],
"Cracked Stone Bricks": [98, 2],
"Glass Pane": [102, 0],
"Melon": [103, 0],
"Melon Stem": [105, 0],
"Melon Stem 0": [105, 0],
"Melon Stem 1": [105, 1],
"Melon Stem 2": [105, 2],
"Melon Stem 3": [105, 3],
"Melon Stem 4": [105, 4],
"Melon Stem 5": [105, 5],
"Melon Stem 6": [105, 6],
"Melon Stem 7": [105, 7],
"Fence Gate": [107, 0],
"North South Fence Gate": [107, 0],
"South North Fence Gate": [107, 0],
"East West Closed Fence Gate": [107, 3],
"West West Closed Fence Gate": [107, 3],
"North Opened Fence Gate": [107, 4],
"East Opened Fence Gate": [107, 5],
"South Opened Fence Gate": [107, 6],
"West Opened Fence Gate": [107, 7],
"Brick Stairs": [108, 2],
"North Lower Brick Stairs": [108, 2],
"East Lower Brick Stairs": [108, 1],
"South Lower Brick Stairs": [108, 3],
"West Lower Brick Stairs": [108, 0],
"North Upper Brick Stairs": [108, 6],
"East Upper Brick Stairs": [108, 5],
"South Upper Brick Stairs": [108, 7],
"West Upper Brick Stairs": [108, 4],
"Stone Brick Stairs": [109, 2],
"North Lower Stone Brick Stairs": [109, 2],
"East Lower Stone Brick Stairs": [109, 1],
"South Lower Stone Brick Stairs": [109, 3],
"West Lower Stone Brick Stairs": [109, 0],
"North Upper Stone Brick Stairs": [109, 6],
"East Upper Stone Brick Stairs": [109, 5],
"South Upper Stone Brick Stairs": [109, 7],
"West Upper Stone Brick Stairs": [109, 4],
"Nether Brick Stairs": [114, 2],
"North Lower Nether Brick Stairs": [114, 2],
"East Lower Nether Brick Stairs": [114, 1],
"South Lower Nether Brick Stairs": [114, 3],
"West Lower Nether Brick Stairs": [114, 0],
"North Upper Nether Brick Stairs": [114, 6],
"East Upper Nether Brick Stairs": [114, 5],
"South Upper Nether Brick Stairs": [114, 7],
"West Upper Nether Brick Stairs": [114, 4],
"Sandstone Stairs": [128, 2],
"North Lower Sandstone Stairs": [128, 2],
"East Lower Sandstone Stairs": [128, 1],
"South Lower Sandstone Stairs": [128, 3],
"West Lower Sandstone Stairs": [128, 0],
"North Upper Sandstone Stairs": [128, 6],
"East Upper Sandstone Stairs": [128, 5],
"South Upper Sandstone Stairs": [128, 7],
"West Upper Sandstone Stairs": [128, 4],
"Block of Quartz": [155, 0],
"Chiseled Quartz Block": [155, 1],
"Quartz Pillar": [155, 2],
"Glowing Obsidian": [246, 0],
"Nether Reactor Core": [247, 0],
"Active Nether Reactor Core": [247, 1],
"Used Nether Reactor Core": [247, 2],
"Update": [248, 0],
"Ateupd": [249, 0],
"Held Grass": [253, 0],
"Held Leaves": [254, 0],
"Held Oak Leaves": [254, 0],
"Held Spruce Leaves": [254, 1],
"Held Birch Leaves": [254, 2],
"Fire": [255, 0]
}
Item = {
"Iron Shovel": 256,
"Iron Pickaxe": 257,
"Iron Axe": 258,
"Flint and Steel": 259,
"Apple": 260,
"Bow": 261,
"Arrow": 262,
"Coal": 263,
"Diamond": 264,
"Iron Ingot": 265,
"Gold Ingot": 266,
"Iron Sword": 267,
"Wooden Sword": 268,
"Wooden Shovel": 269,
"Wooden Pickaxe": 270,
"Wooden Axe": 271,
"Stone Sword": 272,
"Stone Shovel": 273,
"Stone Pickaxe": 274,
"Stone Axe": 275,
"Diamond Sword": 276,
"Diamond Shovel": 277,
"Diamond Pickace": 278,
"Diamond Axe": 279,
"Stick": 280,
"Bowl": 281,
"Mushroom Stew": 282,
"Gold Sword": 283,
"Gold Shovel": 284,
"Gold Pickaxe": 285,
"Gold Axe": 286,
"String": 287,
"Feather": 288,
"Gunpowder": 289,
"Wooden Hoe": 290,
"Stone Hoe": 291,
"Iron Hoe": 292,
"Diamond Hoe": 293,
"Gold Hoe": 294,
"Seeds": 295,
"Wheet": 296,
"Bread": 297,
"Leather Cap": 298,
"Leather Tunic": 299,
"Leather Pants": 300,
"Leather Boots": 301,
"Chain Helmet": 302,
"Chain Chestplate": 303,
"Chain Leggings": 304,
"Chain Boots": 305,
"Iron Helmet": 306,
"Iron Chestplate": 307,
"Iron Leggings": 308,
"Iron Boots": 309,
"Diamond Helmet": 310,
"Diamond Chestplate": 311,
"Diamond Leggings": 312,
"Diamond Boots": 313,
"Gold Helmet": 314,
"Gold Chestplate": 315,
"Gold Leggings": 316,
"Gold Boots": 317,
"Flint": 318,
"Raw Porkchop": 319,
"Cooked Porkchop": 320,
"Painting": 321,
"Sign": 323,
"Wooden Door": 324,
"Iron Door": 330,
"Snowball": 332,
"Leather": 334,
"Brick": 336,
"Clay": 337,
"Sugarcane": 338,
"Paper": 339,
"Book": 340,
"Slimeball": 341,
"Egg": 344,
"Compass": 345,
"Clock": 347,
"Glowstone Dust": 248,
"Dye": 351,
"Bone": 352,
"Sugar": 353,
"Bed": 356,
"Shears": 359,
"Melon": 360,
"Melon Seeds": 362,
"Raw Beef": 363,
"Steak": 364,
"Raw Chicken": 365,
"Cooked Chicken": 366,
"Camera": 456
}
def searchBlock(search="", printName=False):
search = search.lower()
IDs = []
for block in Block:
blockName = block.lower()
if search in blockName:
IDs.append([block, Block[block]])
if printName == True:
print(f'{block} ({Block[block]})')
return(dict(IDs))
def searchItem(search="", printName=False):
search = search.lower()
IDs = []
for item in Item:
itemName = item.lower()
if search in itemName:
IDs.append([item, Item[item]])
if printName == True:
print(f'{item} ({Item[item]})')
return(dict(IDs))
def searchAll(search="", printName=False):
search = search.lower()
IDs = []
for block in Block:
blockName = block.lower()
if search in blockName:
IDs.append([block, Block[block]])
if printName == True:
print(f'{block} ({Block[block]})')
for item in Item:
itemName = item.lower()
if search in itemName:
IDs.append([item, Item[item]])
if printName == True:
print(f'{item} ({Item[item]})')
return(dict(IDs))
if __name__ == "__main__":
searchFor = input("Search for a block or item: ")
print(searchAll(search=searchFor))
| block = {'Air': [0, 0], 'Stone': [1, 0], 'Grass': [2, 0], 'Dirt': [3, 0], 'Cobblestone': [4, 0], 'Wooden Planks': [5, 0], 'Saplin': [6, 0], 'Oak Saplin': [6, 0], 'Spruce Saplin': [6, 1], 'Birch Saplin': [6, 2], 'Bedrock': [7, 0], 'Water': [8, 0], 'Water Stationary': [9, 0], 'Lava': [10, 0], 'Lava Staionary': [11, 0], 'Sand': [12, 0], 'Gravel': [13, 0], 'Gold Ore': [14, 0], 'Iron Ore': [15, 0], 'Coal Ore': [16, 0], 'Log': [17, 0], 'Oak Log': [17, 0], 'Spruce Log': [17, 1], 'Birch Log': [17, 2], 'Leaves': [18, 0], 'Oak Leaves': [18, 0], 'Spruce Leaves': [18, 1], 'Birch Leaves': [18, 2], 'Glass': [20, 0], 'Lapis Lazuli Ore': [21, 0], 'Lapis Lazuli Block': [22, 0], 'Sandstone': [24, 0], 'Chiseled Sandstone': [24, 1], 'Smooth Sandstone': [24, 2], 'Bed': [26, 0], 'Bed Foot': [26, 0], 'Bed Head': [26, 8], 'North Bed Foot': [26, 0], 'North Bed Head': [26, 8], 'East Bed Foot': [26, 1], 'East Bed Head': [26, 9], 'South Bed Foot': [26, 2], 'South Bed Head': [26, 10], 'West Bed Foot': [26, 3], 'West Bed Head': [26, 11], 'Cobweb': [30, 0], 'Shrub': [31, 0], 'Tall Grass': [31, 1], 'Fern': [31, 3], 'Wool': [35, 0], 'White Wool': [35, 0], 'Orange Wool': [35, 1], 'Magenta Wool': [35, 2], 'Light Blue Wool': [35, 3], 'Yello Wool': [35, 4], 'Lime Wool': [35, 5], 'Pink Wool': [35, 6], 'Grey Wool': [35, 7], 'Light Grey Wool': [35, 8], 'Cyan Wool': [35, 9], 'Purple Wool': [35, 10], 'Blue Wool': [35, 11], 'Brown Wool': [35, 12], 'Green Wool': [35, 13], 'Red Wool': [35, 14], 'Black Wool': [35, 15], 'Flower': [37, 0], 'Poppy': [38, 0], 'Brown Mushroom': [39, 0], 'Red Mushroom': [40, 0], 'Block of Gold': [41, 0], 'Block of Iron': [42, 0], 'Double Stone Slab': [43, 0], 'Smooth Stone': [43, 6], 'Stone Slab': [44, 0], 'Sandstone Slab': [44, 1], 'Wooden Slab': [44, 2], 'Cobblestone Slab': [44, 3], 'Bricks Slab': [44, 4], 'Stone Bricks Slab': [44, 5], 'Lower Stone Slab': [44, 0], 'Lower Sandstone Slab': [44, 1], 'Lower Wooden Slab': [44, 2], 'Lower Cobblestone Slab': [44, 3], 'Lower Bricks Slab': [44, 4], 'Lower Stone Bricks Slab': [44, 5], 'Upper Stone Slab': [44, 8], 'Upper Sandstone Slab': [44, 9], 'Upper Wooden Slab': [44, 10], 'Upper Cobblestone Slab': [44, 11], 'Upper Bricks Slab': [44, 12], 'Upper Stone Bricks Slab': [44, 13], 'Stone Slab Block': [43, 0], 'Sandstone Slab Block': [43, 1], 'Wooden Slab Block': [43, 2], 'Cobblestone Slab Block': [43, 3], 'Bricks Slab Block': [43, 4], 'Stone Bricks Slab Block': [43, 5], 'Smooth Stone': [43, 6], 'Bricks': [45, 0], 'TNT': [46, 0], 'Active TNT': [46, 1], 'Bookshelf': [47, 0], 'Moss Stone': [48, 0], 'Obsidian': [49, 0], 'Torch': [50, 0], 'Wooden Stairs': [53, 2], 'North Lower Wooden Stairs': [53, 2], 'East Lower Wooden Stairs': [53, 1], 'South Lower Wooden Stairs': [53, 3], 'West Lower Wooden Stairs': [53, 0], 'North Upper Wooden Stairs': [53, 6], 'East Upper Wooden Stairs': [53, 5], 'South Upper Wooden Stairs': [53, 7], 'West Upper Wooden Stairs': [53, 4], 'Chest': [54, 2], 'Blank Chest': [54, 1], 'North Chest': [54, 2], 'East Chest': [54, 5], 'South Chest': [54, 3], 'West Chest': [54, 4], 'Diamond Ore': [56, 0], 'Diamond Block': [57, 0], 'Crafting Table': [58, 0], 'Crops': [59, 0], 'Crops 1': [59, 1], 'Crops 2': [59, 2], 'Crops 3': [59, 3], 'Crops 4': [59, 4], 'Crops 5': [59, 5], 'Crops 6': [59, 6], 'Crops 7': [59, 7], 'Farmland': [60, 0], 'Wet Farmland': [60, 1], 'Furnace': [61, 0], 'Active Furnace': [62, 0], 'Sign': [63, 0], 'Sign 0': [63, 0], 'Sign 1': [63, 1], 'Sign 2': [63, 2], 'Sign 3': [63, 3], 'Sign 4': [63, 4], 'Sign 5': [63, 5], 'Sign 6': [63, 6], 'Sign 7': [63, 7], 'Sign 8': [63, 8], 'Sign 9': [63, 9], 'Sign 10': [63, 10], 'Sign 11': [63, 11], 'Sign 12': [63, 12], 'Sign 13': [63, 13], 'Sign 14': [63, 14], 'Sign 15': [63, 15], 'Lower North Closed Wooden Door': [64, 1], 'Lower North Opened Wooden Door': [64, 5], 'Lower East Closed Wooden Door': [64, 2], 'Lower East Opened Wooden Door': [64, 2], 'Lower South Closed Wooden Door': [46, 3], 'Lower South Opened Wooden Door': [64, 7], 'Lower West Closed Wooden Door': [64, 0], 'Lower West Opened Wooden Door': [64, 4], 'Upper Left Wooden Door': [64, 8], 'Upper Right Wooden Door': [64, 9], 'Lower Wooden Door': [64, 1], 'Upper Wooden Door': [64, 8], 'Ladder': [65, 2], 'North Ladder': [65, 2], 'East Ladder': [65, 5], 'South Ladder': [65, 3], 'West Ladder': [65, 4], 'Cobblestone Stairs': [67, 2], 'North Lower Cobblestone Stairs': [67, 2], 'East Lower Cobblestone Stairs': [67, 1], 'South Lower Cobblestone Stairs': [67, 3], 'West Lower Cobblestone Stairs': [67, 0], 'North Upper Cobblestone Stairs': [57, 6], 'East Upper Cobbleston Stairs': [57, 5], 'South Upper Cobbleston Stairs': [57, 7], 'West Upper Cobbleston Stairs': [57, 4], 'Wall Sign': [68, 2], 'North Wall Sign': [68, 2], 'East Wall Sign': [68, 5], 'South Wall Sign': [68, 1], 'West Wall Sign': [68, 4], 'Lower North Closed Iron Door': [71, 1], 'Lower North Opened Iron Door': [71, 5], 'Lower East Closed Iron Door': [71, 2], 'Lower East Opened Iron Door': [71, 2], 'Lower South Closed Iron Door': [71, 3], 'Lower South Opened Iron Door': [71, 7], 'Lower West Closed Iron Door': [71, 0], 'Lower West Opened Iron Door': [71, 4], 'Upper Left Iron Door': [71, 8], 'Upper Right Iron Door': [71, 9], 'Lower Iron Door': [71, 1], 'Upper Iron Door': [71, 8], 'Redstone Ore': [73, 0], 'Snow': [78, 0], 'Ice': [79, 0], 'Snow Block': [80, 0], 'Cactus': [81, 0], 'Clay Block': [82, 0], 'Sugercane': [83, 0], 'Fence': [85, 0], 'Glowstone Block': [89, 0], 'Invisible Bedrock': [95, 0], 'Trapdoor': [96, 0], 'North Closed Trapdoor': [96, 0], 'East Closed Trapdoor': [96, 3], 'South Closed Trapdoor': [96, 1], 'West Closed Trapdoor': [96, 2], 'North Opened Trapdoor': [96, 4], 'East Opened Trapdoor': [96, 7], 'South Opened Trapdoor': [96, 5], 'West Opened Trapdoor': [96, 6], 'Stone Bricks': [98, 0], 'Mossy Stone Bricks': [98, 1], 'Cracked Stone Bricks': [98, 2], 'Glass Pane': [102, 0], 'Melon': [103, 0], 'Melon Stem': [105, 0], 'Melon Stem 0': [105, 0], 'Melon Stem 1': [105, 1], 'Melon Stem 2': [105, 2], 'Melon Stem 3': [105, 3], 'Melon Stem 4': [105, 4], 'Melon Stem 5': [105, 5], 'Melon Stem 6': [105, 6], 'Melon Stem 7': [105, 7], 'Fence Gate': [107, 0], 'North South Fence Gate': [107, 0], 'South North Fence Gate': [107, 0], 'East West Closed Fence Gate': [107, 3], 'West West Closed Fence Gate': [107, 3], 'North Opened Fence Gate': [107, 4], 'East Opened Fence Gate': [107, 5], 'South Opened Fence Gate': [107, 6], 'West Opened Fence Gate': [107, 7], 'Brick Stairs': [108, 2], 'North Lower Brick Stairs': [108, 2], 'East Lower Brick Stairs': [108, 1], 'South Lower Brick Stairs': [108, 3], 'West Lower Brick Stairs': [108, 0], 'North Upper Brick Stairs': [108, 6], 'East Upper Brick Stairs': [108, 5], 'South Upper Brick Stairs': [108, 7], 'West Upper Brick Stairs': [108, 4], 'Stone Brick Stairs': [109, 2], 'North Lower Stone Brick Stairs': [109, 2], 'East Lower Stone Brick Stairs': [109, 1], 'South Lower Stone Brick Stairs': [109, 3], 'West Lower Stone Brick Stairs': [109, 0], 'North Upper Stone Brick Stairs': [109, 6], 'East Upper Stone Brick Stairs': [109, 5], 'South Upper Stone Brick Stairs': [109, 7], 'West Upper Stone Brick Stairs': [109, 4], 'Nether Brick Stairs': [114, 2], 'North Lower Nether Brick Stairs': [114, 2], 'East Lower Nether Brick Stairs': [114, 1], 'South Lower Nether Brick Stairs': [114, 3], 'West Lower Nether Brick Stairs': [114, 0], 'North Upper Nether Brick Stairs': [114, 6], 'East Upper Nether Brick Stairs': [114, 5], 'South Upper Nether Brick Stairs': [114, 7], 'West Upper Nether Brick Stairs': [114, 4], 'Sandstone Stairs': [128, 2], 'North Lower Sandstone Stairs': [128, 2], 'East Lower Sandstone Stairs': [128, 1], 'South Lower Sandstone Stairs': [128, 3], 'West Lower Sandstone Stairs': [128, 0], 'North Upper Sandstone Stairs': [128, 6], 'East Upper Sandstone Stairs': [128, 5], 'South Upper Sandstone Stairs': [128, 7], 'West Upper Sandstone Stairs': [128, 4], 'Block of Quartz': [155, 0], 'Chiseled Quartz Block': [155, 1], 'Quartz Pillar': [155, 2], 'Glowing Obsidian': [246, 0], 'Nether Reactor Core': [247, 0], 'Active Nether Reactor Core': [247, 1], 'Used Nether Reactor Core': [247, 2], 'Update': [248, 0], 'Ateupd': [249, 0], 'Held Grass': [253, 0], 'Held Leaves': [254, 0], 'Held Oak Leaves': [254, 0], 'Held Spruce Leaves': [254, 1], 'Held Birch Leaves': [254, 2], 'Fire': [255, 0]}
item = {'Iron Shovel': 256, 'Iron Pickaxe': 257, 'Iron Axe': 258, 'Flint and Steel': 259, 'Apple': 260, 'Bow': 261, 'Arrow': 262, 'Coal': 263, 'Diamond': 264, 'Iron Ingot': 265, 'Gold Ingot': 266, 'Iron Sword': 267, 'Wooden Sword': 268, 'Wooden Shovel': 269, 'Wooden Pickaxe': 270, 'Wooden Axe': 271, 'Stone Sword': 272, 'Stone Shovel': 273, 'Stone Pickaxe': 274, 'Stone Axe': 275, 'Diamond Sword': 276, 'Diamond Shovel': 277, 'Diamond Pickace': 278, 'Diamond Axe': 279, 'Stick': 280, 'Bowl': 281, 'Mushroom Stew': 282, 'Gold Sword': 283, 'Gold Shovel': 284, 'Gold Pickaxe': 285, 'Gold Axe': 286, 'String': 287, 'Feather': 288, 'Gunpowder': 289, 'Wooden Hoe': 290, 'Stone Hoe': 291, 'Iron Hoe': 292, 'Diamond Hoe': 293, 'Gold Hoe': 294, 'Seeds': 295, 'Wheet': 296, 'Bread': 297, 'Leather Cap': 298, 'Leather Tunic': 299, 'Leather Pants': 300, 'Leather Boots': 301, 'Chain Helmet': 302, 'Chain Chestplate': 303, 'Chain Leggings': 304, 'Chain Boots': 305, 'Iron Helmet': 306, 'Iron Chestplate': 307, 'Iron Leggings': 308, 'Iron Boots': 309, 'Diamond Helmet': 310, 'Diamond Chestplate': 311, 'Diamond Leggings': 312, 'Diamond Boots': 313, 'Gold Helmet': 314, 'Gold Chestplate': 315, 'Gold Leggings': 316, 'Gold Boots': 317, 'Flint': 318, 'Raw Porkchop': 319, 'Cooked Porkchop': 320, 'Painting': 321, 'Sign': 323, 'Wooden Door': 324, 'Iron Door': 330, 'Snowball': 332, 'Leather': 334, 'Brick': 336, 'Clay': 337, 'Sugarcane': 338, 'Paper': 339, 'Book': 340, 'Slimeball': 341, 'Egg': 344, 'Compass': 345, 'Clock': 347, 'Glowstone Dust': 248, 'Dye': 351, 'Bone': 352, 'Sugar': 353, 'Bed': 356, 'Shears': 359, 'Melon': 360, 'Melon Seeds': 362, 'Raw Beef': 363, 'Steak': 364, 'Raw Chicken': 365, 'Cooked Chicken': 366, 'Camera': 456}
def search_block(search='', printName=False):
search = search.lower()
i_ds = []
for block in Block:
block_name = block.lower()
if search in blockName:
IDs.append([block, Block[block]])
if printName == True:
print(f'{block} ({Block[block]})')
return dict(IDs)
def search_item(search='', printName=False):
search = search.lower()
i_ds = []
for item in Item:
item_name = item.lower()
if search in itemName:
IDs.append([item, Item[item]])
if printName == True:
print(f'{item} ({Item[item]})')
return dict(IDs)
def search_all(search='', printName=False):
search = search.lower()
i_ds = []
for block in Block:
block_name = block.lower()
if search in blockName:
IDs.append([block, Block[block]])
if printName == True:
print(f'{block} ({Block[block]})')
for item in Item:
item_name = item.lower()
if search in itemName:
IDs.append([item, Item[item]])
if printName == True:
print(f'{item} ({Item[item]})')
return dict(IDs)
if __name__ == '__main__':
search_for = input('Search for a block or item: ')
print(search_all(search=searchFor)) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 15 15:31:15 2017
@author: Nadiar
"""
# 1
a = 2
while (a <= 10):
print(a)
a += 2
print("Goodbye!")
# 2
print("Hello!")
a = 10
while(a >= 2):
print(a)
a -= 2
# 3
temp = 0
inc = 1
end = 21
while (end >= inc):
temp += inc
inc += 1
print(temp) | """
Created on Sun Jan 15 15:31:15 2017
@author: Nadiar
"""
a = 2
while a <= 10:
print(a)
a += 2
print('Goodbye!')
print('Hello!')
a = 10
while a >= 2:
print(a)
a -= 2
temp = 0
inc = 1
end = 21
while end >= inc:
temp += inc
inc += 1
print(temp) |
CONFIG_BINDIR="<CONFIG_BINDIR>"
CONFIG_LIBDIR="<CONFIG_LIBDIR>"
CONFIG_LOCALSTATEDIR="<CONFIG_LOCALSTATEDIR>"
CONFIG_SYSCONFDIR="<CONFIG_SYSCONFDIR>"
CONFIG_SYSCONFDIR_DSC="<CONFIG_SYSCONFDIR_DSC>"
CONFIG_OAAS_CERTPATH="<OAAS_CERTPATH>"
OMI_LIB_SCRIPTS="<OMI_LIB_SCRIPTS>"
PYTHON_PID_DIR="<PYTHON_PID_DIR>"
DSC_NAMESPACE="<DSC_NAMESPACE>"
DSC_SCRIPT_PATH="<DSC_SCRIPT_PATH>"
DSC_MODULES_PATH="<DSC_MODULES_PATH>"
| config_bindir = '<CONFIG_BINDIR>'
config_libdir = '<CONFIG_LIBDIR>'
config_localstatedir = '<CONFIG_LOCALSTATEDIR>'
config_sysconfdir = '<CONFIG_SYSCONFDIR>'
config_sysconfdir_dsc = '<CONFIG_SYSCONFDIR_DSC>'
config_oaas_certpath = '<OAAS_CERTPATH>'
omi_lib_scripts = '<OMI_LIB_SCRIPTS>'
python_pid_dir = '<PYTHON_PID_DIR>'
dsc_namespace = '<DSC_NAMESPACE>'
dsc_script_path = '<DSC_SCRIPT_PATH>'
dsc_modules_path = '<DSC_MODULES_PATH>' |
h, m = map(int, input().split())
fullMin = (h * 60) + m
hour = (fullMin - 45) // 60
minu = (fullMin - 45) % 60
if hour == -1:
hour = 23
print(f'{hour} {minu}')
else:
print(f'{hour} {minu}')
| (h, m) = map(int, input().split())
full_min = h * 60 + m
hour = (fullMin - 45) // 60
minu = (fullMin - 45) % 60
if hour == -1:
hour = 23
print(f'{hour} {minu}')
else:
print(f'{hour} {minu}') |
def get_attribute_or_key(obj, name):
if isinstance(obj, dict):
return obj.get(name)
return getattr(obj, name, None)
| def get_attribute_or_key(obj, name):
if isinstance(obj, dict):
return obj.get(name)
return getattr(obj, name, None) |
#
# PySNMP MIB module FASTPATH-QOS-AUTOVOIP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FASTPATH-QOS-AUTOVOIP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:58:28 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection")
fastPathQOS, = mibBuilder.importSymbols("FASTPATH-QOS-MIB", "fastPathQOS")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, IpAddress, ObjectIdentity, MibIdentifier, Unsigned32, NotificationType, Integer32, Gauge32, iso, Counter64, TimeTicks, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "IpAddress", "ObjectIdentity", "MibIdentifier", "Unsigned32", "NotificationType", "Integer32", "Gauge32", "iso", "Counter64", "TimeTicks", "ModuleIdentity")
RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention")
fastPathQOSAUTOVOIP = ModuleIdentity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4))
fastPathQOSAUTOVOIP.setRevisions(('2007-11-23 00:00', '2007-11-23 00:00',))
if mibBuilder.loadTexts: fastPathQOSAUTOVOIP.setLastUpdated('200711230000Z')
if mibBuilder.loadTexts: fastPathQOSAUTOVOIP.setOrganization('Broadcom Corporation')
class PercentByFives(TextualConvention, Unsigned32):
status = 'current'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(5, 5), ValueRangeConstraint(10, 10), ValueRangeConstraint(15, 15), ValueRangeConstraint(20, 20), ValueRangeConstraint(25, 25), ValueRangeConstraint(30, 30), ValueRangeConstraint(35, 35), ValueRangeConstraint(40, 40), ValueRangeConstraint(45, 45), ValueRangeConstraint(50, 50), ValueRangeConstraint(55, 55), ValueRangeConstraint(60, 60), ValueRangeConstraint(65, 65), ValueRangeConstraint(70, 70), ValueRangeConstraint(75, 75), ValueRangeConstraint(80, 80), ValueRangeConstraint(85, 85), ValueRangeConstraint(90, 90), ValueRangeConstraint(95, 95), ValueRangeConstraint(100, 100), )
class Sixteenths(TextualConvention, Unsigned32):
status = 'current'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 16)
agentAutoVoIPCfgGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1))
agentAutoVoIPTable = MibTable((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1), )
if mibBuilder.loadTexts: agentAutoVoIPTable.setStatus('current')
agentAutoVoIPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1), ).setIndexNames((0, "FASTPATH-QOS-AUTOVOIP-MIB", "agentAutoVoIPIntfIndex"))
if mibBuilder.loadTexts: agentAutoVoIPEntry.setStatus('current')
agentAutoVoIPIntfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 1), InterfaceIndexOrZero())
if mibBuilder.loadTexts: agentAutoVoIPIntfIndex.setStatus('current')
agentAutoVoIPMode = MibTableColumn((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentAutoVoIPMode.setStatus('current')
agentAutoVoIPCosQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentAutoVoIPCosQueue.setStatus('current')
mibBuilder.exportSymbols("FASTPATH-QOS-AUTOVOIP-MIB", fastPathQOSAUTOVOIP=fastPathQOSAUTOVOIP, agentAutoVoIPEntry=agentAutoVoIPEntry, Sixteenths=Sixteenths, agentAutoVoIPIntfIndex=agentAutoVoIPIntfIndex, agentAutoVoIPMode=agentAutoVoIPMode, PercentByFives=PercentByFives, PYSNMP_MODULE_ID=fastPathQOSAUTOVOIP, agentAutoVoIPCosQueue=agentAutoVoIPCosQueue, agentAutoVoIPTable=agentAutoVoIPTable, agentAutoVoIPCfgGroup=agentAutoVoIPCfgGroup)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_range_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection')
(fast_path_qos,) = mibBuilder.importSymbols('FASTPATH-QOS-MIB', 'fastPathQOS')
(interface_index_or_zero,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndexOrZero')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, ip_address, object_identity, mib_identifier, unsigned32, notification_type, integer32, gauge32, iso, counter64, time_ticks, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'IpAddress', 'ObjectIdentity', 'MibIdentifier', 'Unsigned32', 'NotificationType', 'Integer32', 'Gauge32', 'iso', 'Counter64', 'TimeTicks', 'ModuleIdentity')
(row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention')
fast_path_qosautovoip = module_identity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4))
fastPathQOSAUTOVOIP.setRevisions(('2007-11-23 00:00', '2007-11-23 00:00'))
if mibBuilder.loadTexts:
fastPathQOSAUTOVOIP.setLastUpdated('200711230000Z')
if mibBuilder.loadTexts:
fastPathQOSAUTOVOIP.setOrganization('Broadcom Corporation')
class Percentbyfives(TextualConvention, Unsigned32):
status = 'current'
subtype_spec = Unsigned32.subtypeSpec + constraints_union(value_range_constraint(0, 0), value_range_constraint(5, 5), value_range_constraint(10, 10), value_range_constraint(15, 15), value_range_constraint(20, 20), value_range_constraint(25, 25), value_range_constraint(30, 30), value_range_constraint(35, 35), value_range_constraint(40, 40), value_range_constraint(45, 45), value_range_constraint(50, 50), value_range_constraint(55, 55), value_range_constraint(60, 60), value_range_constraint(65, 65), value_range_constraint(70, 70), value_range_constraint(75, 75), value_range_constraint(80, 80), value_range_constraint(85, 85), value_range_constraint(90, 90), value_range_constraint(95, 95), value_range_constraint(100, 100))
class Sixteenths(TextualConvention, Unsigned32):
status = 'current'
subtype_spec = Unsigned32.subtypeSpec + value_range_constraint(0, 16)
agent_auto_vo_ip_cfg_group = mib_identifier((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1))
agent_auto_vo_ip_table = mib_table((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1))
if mibBuilder.loadTexts:
agentAutoVoIPTable.setStatus('current')
agent_auto_vo_ip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1)).setIndexNames((0, 'FASTPATH-QOS-AUTOVOIP-MIB', 'agentAutoVoIPIntfIndex'))
if mibBuilder.loadTexts:
agentAutoVoIPEntry.setStatus('current')
agent_auto_vo_ip_intf_index = mib_table_column((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 1), interface_index_or_zero())
if mibBuilder.loadTexts:
agentAutoVoIPIntfIndex.setStatus('current')
agent_auto_vo_ip_mode = mib_table_column((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
agentAutoVoIPMode.setStatus('current')
agent_auto_vo_ip_cos_queue = mib_table_column((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 3, 4, 1, 1, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
agentAutoVoIPCosQueue.setStatus('current')
mibBuilder.exportSymbols('FASTPATH-QOS-AUTOVOIP-MIB', fastPathQOSAUTOVOIP=fastPathQOSAUTOVOIP, agentAutoVoIPEntry=agentAutoVoIPEntry, Sixteenths=Sixteenths, agentAutoVoIPIntfIndex=agentAutoVoIPIntfIndex, agentAutoVoIPMode=agentAutoVoIPMode, PercentByFives=PercentByFives, PYSNMP_MODULE_ID=fastPathQOSAUTOVOIP, agentAutoVoIPCosQueue=agentAutoVoIPCosQueue, agentAutoVoIPTable=agentAutoVoIPTable, agentAutoVoIPCfgGroup=agentAutoVoIPCfgGroup) |
{
"midi_fname": "sample_music/effrhy_131.mid",
"video_fname": "tests/test_out/start_size.mp4",
"note_start_height": 0.0,
# "note_end_height": 0.0,
}
| {'midi_fname': 'sample_music/effrhy_131.mid', 'video_fname': 'tests/test_out/start_size.mp4', 'note_start_height': 0.0} |
par = list()
impar = list()
num = list()
for i in range(1, 8):
num.append(int(input(f'Digite o {i} numero: ')))
for a in num:
if a % 2 == 0:
par.append(a)
else:
impar.append(a)
print(num)
print(par)
print(impar) | par = list()
impar = list()
num = list()
for i in range(1, 8):
num.append(int(input(f'Digite o {i} numero: ')))
for a in num:
if a % 2 == 0:
par.append(a)
else:
impar.append(a)
print(num)
print(par)
print(impar) |
class Solution:
def scheduleCourse(self, courses: List[List[int]]) -> int:
time = 0
maxHeap = []
for duration, lastDay in sorted(courses, key=lambda x: x[1]):
heapq.heappush(maxHeap, -duration)
time += duration
# if current course could not be taken, check if it's able to swap with a
# previously taken course with larger duration, to increase the time
# available to take upcoming courses
if time > lastDay:
time += heapq.heappop(maxHeap)
return len(maxHeap)
| class Solution:
def schedule_course(self, courses: List[List[int]]) -> int:
time = 0
max_heap = []
for (duration, last_day) in sorted(courses, key=lambda x: x[1]):
heapq.heappush(maxHeap, -duration)
time += duration
if time > lastDay:
time += heapq.heappop(maxHeap)
return len(maxHeap) |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"get_data": "01_core.ipynb",
"Dataset": "01_core.ipynb",
"DataBunch": "01_core.ipynb",
"Learner": "01_core.ipynb",
"get_dls": "01_core.ipynb",
"get_model": "01_core.ipynb",
"get_learner": "01_core.ipynb",
"accuracy": "01_core.ipynb",
"camel2snake": "01_core.ipynb",
"Callback": "01_core.ipynb",
"TrainEvalCallback": "01_core.ipynb",
"listify": "01_core.ipynb",
"Runner": "01_core.ipynb",
"AvgStats": "01_core.ipynb",
"AvgStatsCallback": "01_core.ipynb",
"Recorder": "01_core.ipynb",
"ParamScheduler": "01_core.ipynb",
"annealer": "01_core.ipynb",
"sched_lin": "01_core.ipynb",
"sched_cos": "01_core.ipynb",
"sched_no": "01_core.ipynb",
"sched_expo": "01_core.ipynb",
"cos_1cycle_anneal": "01_core.ipynb",
"torch.Tensor.ndim": "01_core.ipynb",
"combine_scheds": "01_core.ipynb"}
modules = ["l10_anneal.py"]
doc_url = "https://weilainicolas.github.io/fastai_lai_lib/"
git_url = "https://github.com/weilainicolas/fastai_lai_lib/tree/master/"
def custom_doc_links(name): return None
| __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'get_data': '01_core.ipynb', 'Dataset': '01_core.ipynb', 'DataBunch': '01_core.ipynb', 'Learner': '01_core.ipynb', 'get_dls': '01_core.ipynb', 'get_model': '01_core.ipynb', 'get_learner': '01_core.ipynb', 'accuracy': '01_core.ipynb', 'camel2snake': '01_core.ipynb', 'Callback': '01_core.ipynb', 'TrainEvalCallback': '01_core.ipynb', 'listify': '01_core.ipynb', 'Runner': '01_core.ipynb', 'AvgStats': '01_core.ipynb', 'AvgStatsCallback': '01_core.ipynb', 'Recorder': '01_core.ipynb', 'ParamScheduler': '01_core.ipynb', 'annealer': '01_core.ipynb', 'sched_lin': '01_core.ipynb', 'sched_cos': '01_core.ipynb', 'sched_no': '01_core.ipynb', 'sched_expo': '01_core.ipynb', 'cos_1cycle_anneal': '01_core.ipynb', 'torch.Tensor.ndim': '01_core.ipynb', 'combine_scheds': '01_core.ipynb'}
modules = ['l10_anneal.py']
doc_url = 'https://weilainicolas.github.io/fastai_lai_lib/'
git_url = 'https://github.com/weilainicolas/fastai_lai_lib/tree/master/'
def custom_doc_links(name):
return None |
#function that allows user to filter photos based on ranking
def filterPhotos(photoAlbum, userchoice):
if userchoice:
#display photos in ascending order
return;
else:
#display photos in descending order
return;
return;
| def filter_photos(photoAlbum, userchoice):
if userchoice:
return
else:
return
return |
def test_about_should_return_200(client):
rv = client.get('/about')
assert rv.status_code == 200
assert rv.headers['Content-type'] == 'text/html; charset=utf-8'
| def test_about_should_return_200(client):
rv = client.get('/about')
assert rv.status_code == 200
assert rv.headers['Content-type'] == 'text/html; charset=utf-8' |
#-*- coding:utf-8 -*-
title = """"""
text = """""".replace("\n", r"\n")
template = """\t*-*"title": "{}", "content": "{}"-*-"""
complete_text = template.format(title, text).replace("*-*", "{").replace("-*-", "}")
file = open("aktar.txt", "a", encoding="utf-8")
file.write(complete_text+",\n")
file.close() | title = ''
text = ''.replace('\n', '\\n')
template = '\t*-*"title": "{}", "content": "{}"-*-'
complete_text = template.format(title, text).replace('*-*', '{').replace('-*-', '}')
file = open('aktar.txt', 'a', encoding='utf-8')
file.write(complete_text + ',\n')
file.close() |
# dfs
class Solution:
def numIslands(self, grid: 'List[List[str]]') -> 'int':
if grid == []: return 0
def dfs(i, j, n, m):
if i < 0 or j < 0 or i >= n or j >= m or grid[i][j] == "0" or grid[i][j] == "-1": return
grid[i][j] = "-1"
dfs(i + 1, j, n, m)
dfs(i - 1, j, n, m)
dfs(i, j + 1, n, m)
dfs(i, j - 1, n, m)
num_islands = 0
n, m = len(grid), len(grid[0])
for i in range(n):
for j in range(m):
if grid[i][j] == "1":
dfs(i, j, n, m)
num_islands += 1
return num_islands
| class Solution:
def num_islands(self, grid: 'List[List[str]]') -> 'int':
if grid == []:
return 0
def dfs(i, j, n, m):
if i < 0 or j < 0 or i >= n or (j >= m) or (grid[i][j] == '0') or (grid[i][j] == '-1'):
return
grid[i][j] = '-1'
dfs(i + 1, j, n, m)
dfs(i - 1, j, n, m)
dfs(i, j + 1, n, m)
dfs(i, j - 1, n, m)
num_islands = 0
(n, m) = (len(grid), len(grid[0]))
for i in range(n):
for j in range(m):
if grid[i][j] == '1':
dfs(i, j, n, m)
num_islands += 1
return num_islands |
# Relative path to the database text file
DATABASE_PATH = "resources/anime.txt"
def add_anime(anime_name, episodes, current_episode_=0):
"""
Function to add a new anime to the database /resources/anime.txt
Args:
anime_name (str): Name of the anime.
episodes (int): Total episodes in the anime.
current_episode_ (int) : Current episode count. Default is 0 for new anime.
Returns:
None
"""
with open(DATABASE_PATH, "a") as file:
file.writelines(f"{anime_name}~{current_episode_}~{episodes}\n")
print(f"\nSuccess! Added {anime_name} to database\n\n")
def anime_exists(anime_name):
"""
Function to check if the anime exists in the database or not
Args:
anime_name (str): Name of the anime.
Returns:
bool: True if the anime exists else False.
"""
with open(DATABASE_PATH, "r") as file:
for line in file:
if anime_name in line.split("~")[0]:
return True
return False
def update_anime(anime_name, episode):
"""
Function to update the episodes watched till now of the particular anime.
Args:
anime_name (str): Name of the anime.
episode (int): The current episodes.
Returns:
None
"""
anime_data = [] # Necessary line
with open(DATABASE_PATH, "r") as file:
anime_data = file.readlines()
for idx, anime_ in enumerate(anime_data):
line_list = anime_.split("~")
if anime_name in line_list[0]:
anime_full_name = line_list[0]
anime_data[idx] = f"{line_list[0]}~{episode}~{line_list[2]}"
break
anime_data.sort()
with open(DATABASE_PATH, "w") as file:
file.writelines(anime_data)
print(f"\nSuccess! Updated the episode count of {anime_full_name}!\n\n")
def anime_progress(anime_name):
"""
Function to list the current progress of the anime.
We read the data from the database.
Args:
anime_name (str): Name of the anime.
Returns:
(tuple): (Full name of anime, Current episode, Total episodes)
"""
with open(DATABASE_PATH, "r") as file:
for line in file:
line_list = line.split("~")
if anime_name in line_list[0]:
return tuple([line_list[0], line_list[1], line_list[2].rstrip("\n")])
def anime_progress_all():
"""
Function to list the current progress of the all the anime in the database.
Args:
No arguments
Returns:
tuple of tuples: Tuple of Tuples in the format ((anime-name, current-episode, total-episode))
"""
all_anime_ = []
with open(DATABASE_PATH, "r") as file:
for line in file:
line_list = line.split("~")
all_anime_.append(tuple([line_list[0], line_list[1], line_list[2].rstrip("\n")]))
return tuple(all_anime_)
def main():
while True:
choice = input("""Kon'nichiwa! Hajimemashite!
What do you want to do?
1. Add new anime
2. Update progress on existing anime
3. View progress on existing anime
4. All currently watching anime
5. Exit
Enter your choice:> """)
if choice == "1":
anime = input("Enter the name of the anime:> ")
current_episode = int(input("Enter the current episode number:> "))
total_episodes = int(input("Enter the total number of episodes:> "))
if not anime_exists(anime):
add_anime(anime, total_episodes, current_episode)
else:
print("Anime already exists")
elif choice == "2":
anime = input("Enter the name of the anime:> ")
if anime_exists(anime):
current_episode = int(input("Enter the current episode number:> "))
update_anime(anime, current_episode)
else:
print("\nThe anime does not exist.\n")
elif choice == "3":
anime = input("Enter the name of the anime:> ")
if anime_exists(anime):
anime_full_name, current, total = anime_progress(anime)
print("\nProgress:")
print(f"{anime_full_name}: {current}/{total}\n")
else:
print("\nThe anime does not exist.\n")
elif choice == "4":
all_anime_ = anime_progress_all()
if all_anime == ():
print("You are watching no anime currently\n")
else:
print("\nCurrent Watch list:\n")
for anime in all_anime_:
print(f"{anime[0]}: {anime[1]}/{anime[2]}\n", end="")
print()
elif choice == "5":
break
else:
print("Invalid input\n")
if __name__ == '__main__':
print("Current Watch list:\n")
all_anime = anime_progress_all()
if all_anime == ():
print("You are watching no anime currently\n")
else:
for anime in all_anime:
print(f"{anime[0]}: {anime[1]}/{anime[2]}\n", end="")
print()
main()
| database_path = 'resources/anime.txt'
def add_anime(anime_name, episodes, current_episode_=0):
"""
Function to add a new anime to the database /resources/anime.txt
Args:
anime_name (str): Name of the anime.
episodes (int): Total episodes in the anime.
current_episode_ (int) : Current episode count. Default is 0 for new anime.
Returns:
None
"""
with open(DATABASE_PATH, 'a') as file:
file.writelines(f'{anime_name}~{current_episode_}~{episodes}\n')
print(f'\nSuccess! Added {anime_name} to database\n\n')
def anime_exists(anime_name):
"""
Function to check if the anime exists in the database or not
Args:
anime_name (str): Name of the anime.
Returns:
bool: True if the anime exists else False.
"""
with open(DATABASE_PATH, 'r') as file:
for line in file:
if anime_name in line.split('~')[0]:
return True
return False
def update_anime(anime_name, episode):
"""
Function to update the episodes watched till now of the particular anime.
Args:
anime_name (str): Name of the anime.
episode (int): The current episodes.
Returns:
None
"""
anime_data = []
with open(DATABASE_PATH, 'r') as file:
anime_data = file.readlines()
for (idx, anime_) in enumerate(anime_data):
line_list = anime_.split('~')
if anime_name in line_list[0]:
anime_full_name = line_list[0]
anime_data[idx] = f'{line_list[0]}~{episode}~{line_list[2]}'
break
anime_data.sort()
with open(DATABASE_PATH, 'w') as file:
file.writelines(anime_data)
print(f'\nSuccess! Updated the episode count of {anime_full_name}!\n\n')
def anime_progress(anime_name):
"""
Function to list the current progress of the anime.
We read the data from the database.
Args:
anime_name (str): Name of the anime.
Returns:
(tuple): (Full name of anime, Current episode, Total episodes)
"""
with open(DATABASE_PATH, 'r') as file:
for line in file:
line_list = line.split('~')
if anime_name in line_list[0]:
return tuple([line_list[0], line_list[1], line_list[2].rstrip('\n')])
def anime_progress_all():
"""
Function to list the current progress of the all the anime in the database.
Args:
No arguments
Returns:
tuple of tuples: Tuple of Tuples in the format ((anime-name, current-episode, total-episode))
"""
all_anime_ = []
with open(DATABASE_PATH, 'r') as file:
for line in file:
line_list = line.split('~')
all_anime_.append(tuple([line_list[0], line_list[1], line_list[2].rstrip('\n')]))
return tuple(all_anime_)
def main():
while True:
choice = input("Kon'nichiwa! Hajimemashite!\nWhat do you want to do?\n1. Add new anime\n2. Update progress on existing anime\n3. View progress on existing anime\n4. All currently watching anime\n5. Exit\nEnter your choice:> ")
if choice == '1':
anime = input('Enter the name of the anime:> ')
current_episode = int(input('Enter the current episode number:> '))
total_episodes = int(input('Enter the total number of episodes:> '))
if not anime_exists(anime):
add_anime(anime, total_episodes, current_episode)
else:
print('Anime already exists')
elif choice == '2':
anime = input('Enter the name of the anime:> ')
if anime_exists(anime):
current_episode = int(input('Enter the current episode number:> '))
update_anime(anime, current_episode)
else:
print('\nThe anime does not exist.\n')
elif choice == '3':
anime = input('Enter the name of the anime:> ')
if anime_exists(anime):
(anime_full_name, current, total) = anime_progress(anime)
print('\nProgress:')
print(f'{anime_full_name}: {current}/{total}\n')
else:
print('\nThe anime does not exist.\n')
elif choice == '4':
all_anime_ = anime_progress_all()
if all_anime == ():
print('You are watching no anime currently\n')
else:
print('\nCurrent Watch list:\n')
for anime in all_anime_:
print(f'{anime[0]}: {anime[1]}/{anime[2]}\n', end='')
print()
elif choice == '5':
break
else:
print('Invalid input\n')
if __name__ == '__main__':
print('Current Watch list:\n')
all_anime = anime_progress_all()
if all_anime == ():
print('You are watching no anime currently\n')
else:
for anime in all_anime:
print(f'{anime[0]}: {anime[1]}/{anime[2]}\n', end='')
print()
main() |
# Definitions
EXECUTING = 'executing'
QUEUED = 'queued'
PLEDGED = 'pledged'
IGNORE = 'ignore'
class Node(object):
def __init__(self):
self.children = []
def add_child(self, node):
self.children.append(node)
def get_leaves(self, leaves=[]):
# If the node has no leaves, return the node in a list
if not self.children:
leaves.append(self)
return leaves
# Recursively get to the bottom
for child in self.children:
child.get_leaves(leaves)
return leaves
class Share(Node):
"""
Implement the share node
"""
_attributes = ('name', 'value', 'parent', 'prodsourcelabel', 'workinggroup', 'campaign', 'processingtype',
'transpath', 'vo', 'rtype', 'queue_id', 'throttled')
def __str__(self, level=0):
"""
Print the tree structure
"""
ret = "{0} name: {1}, value: {2}\n".format('\t' * level, self.name, self.value)
for child in self.children:
ret += child.__str__(level + 1)
return ret
def __repr__(self):
return self.__str__()
def __mul__(self, other):
"""
If I multiply a share object by a number, multiply the value field
"""
self.value *= other
return self.value
def __rmul__(self, other):
return self.__mul__
def __imul__(self, other):
return self.__mul__
def __init__(self, name, value, parent, prodsourcelabel, workinggroup, campaign, processingtype,
transpath, rtype, vo, queue_id, throttled):
# Create default attributes
for attr in self._attributes:
setattr(self, attr, None)
Node.__init__(self)
self.name = name
self.value = value
self.parent = parent
self.prodsourcelabel = prodsourcelabel
self.workinggroup = workinggroup
self.campaign = campaign
self.processingtype = processingtype
self.transpath = transpath
self.rtype = rtype
self.vo = vo
self.queue_id = queue_id
self.throttled = throttled
def pretty_print_hs_distribution(self, hs_distribution, level=0):
try:
executing = hs_distribution[self.name][EXECUTING]/1000.0
except:
executing = 0
try:
target = hs_distribution[self.name][PLEDGED]/1000.0
except:
target = 0
try:
queued = hs_distribution[self.name][QUEUED]/1000.0
except:
queued = 0
ret = "{0} name: {1}, values: {2:.1f}k|{3:.1f}k|{4:.1f}k\n".format('\t' * level, self.name, executing, target, queued)
for child in self.children:
ret += child.pretty_print_hs_distribution(hs_distribution, level + 1)
return ret
def normalize(self, multiplier=100, divider=100):
"""
Will run down the branch and normalize values beneath
"""
self.value *= (multiplier * 1.0 / divider)
if not self.children:
return
divider = 0
for child in self.children:
divider += child.value
multiplier = self.value
for child in self.children:
child.normalize(multiplier=multiplier, divider=divider)
return
def sort_branch_by_current_hs_distribution(self, hs_distribution):
"""
Runs down the branch in order of under-pledging. It returns a list of sorted leave shares
"""
sorted_shares = []
# If the node has no leaves, return the node in a list
if not self.children:
sorted_shares = [self]
return sorted_shares
# If the node has leaves, sort the children
children_sorted = []
for child1 in self.children:
loop_index = 0
insert_index = len(children_sorted) # insert at the end, if not deemed otherwise
# Calculate under-pledging
try:
child1_under_pledge = hs_distribution[child1.name][EXECUTING] * 1.0 / hs_distribution[child1.name][PLEDGED]
except ZeroDivisionError:
child1_under_pledge = 10**6 # Initialize to a large default number
for child2 in children_sorted:
try:
# Calculate under-pledging
child2_under_pledge = hs_distribution[child2.name][EXECUTING] * 1.0 / hs_distribution[child2.name][PLEDGED]
except ZeroDivisionError:
child2_under_pledge = 10 ** 6 # Initialize to a large default number
except KeyError:
continue # Does not exist
if child1_under_pledge < child2_under_pledge:
insert_index = loop_index
break
loop_index += 1
# Insert the child into the list
children_sorted.insert(insert_index, child1)
# Go recursively and sort the grand* children
for child in children_sorted:
sorted_shares.extend(child.sort_branch_by_current_hs_distribution(hs_distribution))
return sorted_shares
def aggregate_hs_distribution(self, hs_distribution):
"""
We have the current HS distribution values for the leaves, but want to propagate it updwards to the parents.
We will traverse the tree from top to bottom and bring up the aggregated values.
"""
executing, queued, pledged = 0, 0, 0
# If the node has no children, it's a leave and should have an entry in the hs_distribution
if not self.children:
try:
executing = hs_distribution[self.name][EXECUTING]
queued = hs_distribution[self.name][QUEUED]
pledged = hs_distribution[self.name][PLEDGED]
except KeyError:
pass
return executing, queued, pledged
# If the node has children, sum up the values of the children
executing = 0
queued = 0
pledged = 0
for child in self.children:
executing_child, queued_child, pledged_child = child.aggregate_hs_distribution(hs_distribution)
executing += executing_child
queued += queued_child
pledged += pledged_child
# Add the aggregated value to the map
hs_distribution[self.name] = {
EXECUTING: executing,
QUEUED: queued,
PLEDGED: pledged
}
# Return the aggregated values
return executing, queued, pledged
# return column names
def column_names(cls):
ret = ''
for attr in cls._attributes:
if ret != '':
ret += ','
ret += attr
return ret
column_names = classmethod(column_names) | executing = 'executing'
queued = 'queued'
pledged = 'pledged'
ignore = 'ignore'
class Node(object):
def __init__(self):
self.children = []
def add_child(self, node):
self.children.append(node)
def get_leaves(self, leaves=[]):
if not self.children:
leaves.append(self)
return leaves
for child in self.children:
child.get_leaves(leaves)
return leaves
class Share(Node):
"""
Implement the share node
"""
_attributes = ('name', 'value', 'parent', 'prodsourcelabel', 'workinggroup', 'campaign', 'processingtype', 'transpath', 'vo', 'rtype', 'queue_id', 'throttled')
def __str__(self, level=0):
"""
Print the tree structure
"""
ret = '{0} name: {1}, value: {2}\n'.format('\t' * level, self.name, self.value)
for child in self.children:
ret += child.__str__(level + 1)
return ret
def __repr__(self):
return self.__str__()
def __mul__(self, other):
"""
If I multiply a share object by a number, multiply the value field
"""
self.value *= other
return self.value
def __rmul__(self, other):
return self.__mul__
def __imul__(self, other):
return self.__mul__
def __init__(self, name, value, parent, prodsourcelabel, workinggroup, campaign, processingtype, transpath, rtype, vo, queue_id, throttled):
for attr in self._attributes:
setattr(self, attr, None)
Node.__init__(self)
self.name = name
self.value = value
self.parent = parent
self.prodsourcelabel = prodsourcelabel
self.workinggroup = workinggroup
self.campaign = campaign
self.processingtype = processingtype
self.transpath = transpath
self.rtype = rtype
self.vo = vo
self.queue_id = queue_id
self.throttled = throttled
def pretty_print_hs_distribution(self, hs_distribution, level=0):
try:
executing = hs_distribution[self.name][EXECUTING] / 1000.0
except:
executing = 0
try:
target = hs_distribution[self.name][PLEDGED] / 1000.0
except:
target = 0
try:
queued = hs_distribution[self.name][QUEUED] / 1000.0
except:
queued = 0
ret = '{0} name: {1}, values: {2:.1f}k|{3:.1f}k|{4:.1f}k\n'.format('\t' * level, self.name, executing, target, queued)
for child in self.children:
ret += child.pretty_print_hs_distribution(hs_distribution, level + 1)
return ret
def normalize(self, multiplier=100, divider=100):
"""
Will run down the branch and normalize values beneath
"""
self.value *= multiplier * 1.0 / divider
if not self.children:
return
divider = 0
for child in self.children:
divider += child.value
multiplier = self.value
for child in self.children:
child.normalize(multiplier=multiplier, divider=divider)
return
def sort_branch_by_current_hs_distribution(self, hs_distribution):
"""
Runs down the branch in order of under-pledging. It returns a list of sorted leave shares
"""
sorted_shares = []
if not self.children:
sorted_shares = [self]
return sorted_shares
children_sorted = []
for child1 in self.children:
loop_index = 0
insert_index = len(children_sorted)
try:
child1_under_pledge = hs_distribution[child1.name][EXECUTING] * 1.0 / hs_distribution[child1.name][PLEDGED]
except ZeroDivisionError:
child1_under_pledge = 10 ** 6
for child2 in children_sorted:
try:
child2_under_pledge = hs_distribution[child2.name][EXECUTING] * 1.0 / hs_distribution[child2.name][PLEDGED]
except ZeroDivisionError:
child2_under_pledge = 10 ** 6
except KeyError:
continue
if child1_under_pledge < child2_under_pledge:
insert_index = loop_index
break
loop_index += 1
children_sorted.insert(insert_index, child1)
for child in children_sorted:
sorted_shares.extend(child.sort_branch_by_current_hs_distribution(hs_distribution))
return sorted_shares
def aggregate_hs_distribution(self, hs_distribution):
"""
We have the current HS distribution values for the leaves, but want to propagate it updwards to the parents.
We will traverse the tree from top to bottom and bring up the aggregated values.
"""
(executing, queued, pledged) = (0, 0, 0)
if not self.children:
try:
executing = hs_distribution[self.name][EXECUTING]
queued = hs_distribution[self.name][QUEUED]
pledged = hs_distribution[self.name][PLEDGED]
except KeyError:
pass
return (executing, queued, pledged)
executing = 0
queued = 0
pledged = 0
for child in self.children:
(executing_child, queued_child, pledged_child) = child.aggregate_hs_distribution(hs_distribution)
executing += executing_child
queued += queued_child
pledged += pledged_child
hs_distribution[self.name] = {EXECUTING: executing, QUEUED: queued, PLEDGED: pledged}
return (executing, queued, pledged)
def column_names(cls):
ret = ''
for attr in cls._attributes:
if ret != '':
ret += ','
ret += attr
return ret
column_names = classmethod(column_names) |
#
# Copyright (c) 2017 Joy Diamond. All rights reserved.
#
@gem('Topaz.Cache')
def gem():
require_gem('Gem.Cache2')
require_gem('Topaz.Core')
require_gem('Topaz.CacheSupport')
#
# Specific instances
#
eight = conjure_number('eight', 8)
five = conjure_number('five', 5)
four = conjure_number('four', 4)
nine = conjure_number('nine', 9)
one = conjure_number('one', 1)
seven = conjure_number('seven', 7)
six = conjure_number('six', 6)
three = conjure_number('three', 3)
two = conjure_number('two', 2)
zero = conjure_number('zero', 0)
red = conjure_color('red')
white = conjure_color('white')
purple = conjure_color('purple')
green = conjure_color('green')
silver = conjure_color('silver')
black = conjure_color('black')
blue = conjure_color('blue')
yellow = conjure_color('yellow')
cyan = conjure_color('cyan')
circle = conjure_shape('circle')
ellipse = conjure_shape('ellipse')
moon = conjure_shape('moon')
pentagon = conjure_shape('pentagon')
oval = conjure_shape('oval')
square = conjure_shape('square')
polygon = conjure_shape('polygon')
star = conjure_shape('star')
trapazoid = conjure_shape('trapazoid')
triangle = conjure_shape('triangle')
def test_conjure_again():
assert one is conjure_number('one', 1)
assert two is conjure_number('two', 2)
assert zero is conjure_number('zero', 0)
assert three is conjure_number('three', 3)
assert four is conjure_number('four', 4)
assert five is conjure_number('five', 5)
assert six is conjure_number('six', 6)
assert seven is conjure_number('seven', 7)
assert eight is conjure_number('eight', 8)
assert nine is conjure_number('nine', 9)
assert black is conjure_color('black')
assert blue is conjure_color('blue')
assert cyan is conjure_color('cyan')
assert green is conjure_color('green')
assert purple is conjure_color('purple')
assert red is conjure_color('red')
assert silver is conjure_color('silver')
assert white is conjure_color('white')
assert yellow is conjure_color('yellow')
assert circle is conjure_shape('circle')
assert ellipse is conjure_shape('ellipse')
assert moon is conjure_shape('moon')
assert oval is conjure_shape('oval')
assert pentagon is conjure_shape('pentagon')
assert polygon is conjure_shape('polygon')
assert square is conjure_shape('square')
assert star is conjure_shape('star')
assert trapazoid is conjure_shape('trapazoid')
assert triangle is conjure_shape('triangle')
@share
def test_conjure_single():
test_conjure_again()
line('PASSED: conjure_single')
| @gem('Topaz.Cache')
def gem():
require_gem('Gem.Cache2')
require_gem('Topaz.Core')
require_gem('Topaz.CacheSupport')
eight = conjure_number('eight', 8)
five = conjure_number('five', 5)
four = conjure_number('four', 4)
nine = conjure_number('nine', 9)
one = conjure_number('one', 1)
seven = conjure_number('seven', 7)
six = conjure_number('six', 6)
three = conjure_number('three', 3)
two = conjure_number('two', 2)
zero = conjure_number('zero', 0)
red = conjure_color('red')
white = conjure_color('white')
purple = conjure_color('purple')
green = conjure_color('green')
silver = conjure_color('silver')
black = conjure_color('black')
blue = conjure_color('blue')
yellow = conjure_color('yellow')
cyan = conjure_color('cyan')
circle = conjure_shape('circle')
ellipse = conjure_shape('ellipse')
moon = conjure_shape('moon')
pentagon = conjure_shape('pentagon')
oval = conjure_shape('oval')
square = conjure_shape('square')
polygon = conjure_shape('polygon')
star = conjure_shape('star')
trapazoid = conjure_shape('trapazoid')
triangle = conjure_shape('triangle')
def test_conjure_again():
assert one is conjure_number('one', 1)
assert two is conjure_number('two', 2)
assert zero is conjure_number('zero', 0)
assert three is conjure_number('three', 3)
assert four is conjure_number('four', 4)
assert five is conjure_number('five', 5)
assert six is conjure_number('six', 6)
assert seven is conjure_number('seven', 7)
assert eight is conjure_number('eight', 8)
assert nine is conjure_number('nine', 9)
assert black is conjure_color('black')
assert blue is conjure_color('blue')
assert cyan is conjure_color('cyan')
assert green is conjure_color('green')
assert purple is conjure_color('purple')
assert red is conjure_color('red')
assert silver is conjure_color('silver')
assert white is conjure_color('white')
assert yellow is conjure_color('yellow')
assert circle is conjure_shape('circle')
assert ellipse is conjure_shape('ellipse')
assert moon is conjure_shape('moon')
assert oval is conjure_shape('oval')
assert pentagon is conjure_shape('pentagon')
assert polygon is conjure_shape('polygon')
assert square is conjure_shape('square')
assert star is conjure_shape('star')
assert trapazoid is conjure_shape('trapazoid')
assert triangle is conjure_shape('triangle')
@share
def test_conjure_single():
test_conjure_again()
line('PASSED: conjure_single') |
"""
Author: Resul Emre AYGAN
"""
"""
Project Description: Sum of positive
You get an array of numbers, return the sum of all of the positives ones.
Example [1,-4,7,12] => 1 + 7 + 12 = 20
Note: if there is nothing to sum, the sum is default to 0.
"""
def positive_sum(arr):
return sum([i for i in arr if i > 0])
| """
Author: Resul Emre AYGAN
"""
'\nProject Description: Sum of positive\n\nYou get an array of numbers, return the sum of all of the positives ones.\n\nExample [1,-4,7,12] => 1 + 7 + 12 = 20\n\nNote: if there is nothing to sum, the sum is default to 0.\n'
def positive_sum(arr):
return sum([i for i in arr if i > 0]) |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 5 16:03:43 2018
@author: James Jiang
"""
all_lines = [line.rstrip('\n') for line in open('Data.txt')]
del all_lines[-2]
original_molecule = all_lines[-1]
capital_letters = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
count_elements = 0
for letter in original_molecule:
if letter in capital_letters:
count_elements += 1
count_Rn = original_molecule.count('Rn')
count_Ar = original_molecule.count('Ar')
count_Y = original_molecule.count('Y')
print(count_elements - (count_Rn + count_Ar) - 2*count_Y - 1)
| """
Created on Fri Jan 5 16:03:43 2018
@author: James Jiang
"""
all_lines = [line.rstrip('\n') for line in open('Data.txt')]
del all_lines[-2]
original_molecule = all_lines[-1]
capital_letters = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
count_elements = 0
for letter in original_molecule:
if letter in capital_letters:
count_elements += 1
count__rn = original_molecule.count('Rn')
count__ar = original_molecule.count('Ar')
count_y = original_molecule.count('Y')
print(count_elements - (count_Rn + count_Ar) - 2 * count_Y - 1) |
ENV = 'directory that defines e.g. the boxes'
WORKSPACE = 'workspace directory'
BEAD_REF = '''
bead to load data from
- either an archive file name or a bead name
'''
INPUT_NICK = (
'name of input,'
+ ' its workspace relative location is "input/%(metavar)s"')
BOX = 'Name of box to store bead'
| env = 'directory that defines e.g. the boxes'
workspace = 'workspace directory'
bead_ref = '\n bead to load data from\n - either an archive file name or a bead name\n'
input_nick = 'name of input,' + ' its workspace relative location is "input/%(metavar)s"'
box = 'Name of box to store bead' |
a = []
assert a[:] == []
assert a[:2**100] == []
assert a[-2**100:] == []
assert a[::2**100] == []
assert a[10:20] == []
assert a[-20:-10] == []
b = [1, 2]
assert b[:] == [1, 2]
assert b[:2**100] == [1, 2]
assert b[-2**100:] == [1, 2]
assert b[2**100:] == []
assert b[::2**100] == [1]
assert b[-10:1] == [1]
assert b[0:0] == []
assert b[1:0] == []
try:
_ = b[::0]
except ValueError:
pass
else:
assert False, "Zero step slice should raise ValueError"
assert b[::-1] == [2, 1]
assert b[1::-1] == [2, 1]
assert b[0::-1] == [1]
assert b[0:-5:-1] == [1]
assert b[:0:-1] == [2]
assert b[5:0:-1] == [2]
c = list(range(10))
assert c[9:6:-3] == [9]
assert c[9::-3] == [9, 6, 3, 0]
assert c[9::-4] == [9, 5, 1]
assert c[8::-2**100] == [8]
assert c[7:7:-2] == []
assert c[7:8:-2] == []
d = "123456"
assert d[3::-1] == "4321"
assert d[4::-3] == "52"
slice_a = slice(5)
assert slice_a.start is None
assert slice_a.stop == 5
assert slice_a.step is None
slice_b = slice(1, 5)
assert slice_b.start == 1
assert slice_b.stop == 5
assert slice_b.step is None
slice_c = slice(1, 5, 2)
assert slice_c.start == 1
assert slice_c.stop == 5
assert slice_c.step == 2
class SubScript(object):
def __getitem__(self, item):
assert type(item) == slice
def __setitem__(self, key, value):
assert type(key) == slice
ss = SubScript()
_ = ss[:]
ss[:1] = 1
| a = []
assert a[:] == []
assert a[:2 ** 100] == []
assert a[-2 ** 100:] == []
assert a[::2 ** 100] == []
assert a[10:20] == []
assert a[-20:-10] == []
b = [1, 2]
assert b[:] == [1, 2]
assert b[:2 ** 100] == [1, 2]
assert b[-2 ** 100:] == [1, 2]
assert b[2 ** 100:] == []
assert b[::2 ** 100] == [1]
assert b[-10:1] == [1]
assert b[0:0] == []
assert b[1:0] == []
try:
_ = b[::0]
except ValueError:
pass
else:
assert False, 'Zero step slice should raise ValueError'
assert b[::-1] == [2, 1]
assert b[1::-1] == [2, 1]
assert b[0::-1] == [1]
assert b[0:-5:-1] == [1]
assert b[:0:-1] == [2]
assert b[5:0:-1] == [2]
c = list(range(10))
assert c[9:6:-3] == [9]
assert c[9::-3] == [9, 6, 3, 0]
assert c[9::-4] == [9, 5, 1]
assert c[8::-2 ** 100] == [8]
assert c[7:7:-2] == []
assert c[7:8:-2] == []
d = '123456'
assert d[3::-1] == '4321'
assert d[4::-3] == '52'
slice_a = slice(5)
assert slice_a.start is None
assert slice_a.stop == 5
assert slice_a.step is None
slice_b = slice(1, 5)
assert slice_b.start == 1
assert slice_b.stop == 5
assert slice_b.step is None
slice_c = slice(1, 5, 2)
assert slice_c.start == 1
assert slice_c.stop == 5
assert slice_c.step == 2
class Subscript(object):
def __getitem__(self, item):
assert type(item) == slice
def __setitem__(self, key, value):
assert type(key) == slice
ss = sub_script()
_ = ss[:]
ss[:1] = 1 |
class Class:
__students_count = 22
def __init__(self, name):
self.name = name
self.students = []
self.grades = []
def add_student(self, name, grade):
if self.__students_count != 0:
self.students.append(name)
self.grades.append(float(grade))
self.__students_count -= 1
def get_average_grade(self):
return sum(self.grades) / len(self.grades)
def __repr__(self):
return f'The students in {self.name}: {", ".join(self.students)}. Average grade: {self.get_average_grade():.2f}'
a_class = Class("11B")
a_class.add_student("Peter", 4.80)
a_class.add_student("George", 6.00)
a_class.add_student("Amy", 3.50)
print(a_class) | class Class:
__students_count = 22
def __init__(self, name):
self.name = name
self.students = []
self.grades = []
def add_student(self, name, grade):
if self.__students_count != 0:
self.students.append(name)
self.grades.append(float(grade))
self.__students_count -= 1
def get_average_grade(self):
return sum(self.grades) / len(self.grades)
def __repr__(self):
return f"The students in {self.name}: {', '.join(self.students)}. Average grade: {self.get_average_grade():.2f}"
a_class = class('11B')
a_class.add_student('Peter', 4.8)
a_class.add_student('George', 6.0)
a_class.add_student('Amy', 3.5)
print(a_class) |
#!/usr/bin/env python3
#p3_180824_2354.py
# Search synonym #2
# Format:
# Number_of_lines
# Key (space) Value
# Key_word
def main():
num = input()
myDictionary = getDictionary(num)
word = input()
#wordToSearch = getKeySearchWord(myDictionary)
checkDictionary(myDictionary, word)
# Fill dictionary with input lines
def getDictionary(numberOfLines):
myDictionary = dict()
listTemp = list()
for i in range(int(numberOfLines)):
listTemp.append(input().split(' '))
myDictionary = dict(listTemp)
return myDictionary
# Get the word we're looking for
# Not used
def getKeySearchWord(synonymDict):
keyList = list(synonymDict.keys())
keyIndex = int(keyList[0])+1
keyWord = keyList[keyIndex]
return keyWord
# Get a synonym for key-word
def checkDictionary(synonymDict, keyWord):
for wordsN1, wordsN2 in synonymDict.items():
if wordsN1 == keyWord:
synonymDict.update({keyWord: wordsN2})
break
if wordsN2 == keyWord:
synonymDict.update({keyWord: wordsN1})
break
print(synonymDict[keyWord])
if __name__ == '__main__':
main()
| def main():
num = input()
my_dictionary = get_dictionary(num)
word = input()
check_dictionary(myDictionary, word)
def get_dictionary(numberOfLines):
my_dictionary = dict()
list_temp = list()
for i in range(int(numberOfLines)):
listTemp.append(input().split(' '))
my_dictionary = dict(listTemp)
return myDictionary
def get_key_search_word(synonymDict):
key_list = list(synonymDict.keys())
key_index = int(keyList[0]) + 1
key_word = keyList[keyIndex]
return keyWord
def check_dictionary(synonymDict, keyWord):
for (words_n1, words_n2) in synonymDict.items():
if wordsN1 == keyWord:
synonymDict.update({keyWord: wordsN2})
break
if wordsN2 == keyWord:
synonymDict.update({keyWord: wordsN1})
break
print(synonymDict[keyWord])
if __name__ == '__main__':
main() |
__title__ = 'cli_command_parser'
__description__ = 'CLI Command Parser'
__url__ = 'https://github.com/dskrypa/cli_command_parser'
__version__ = '2022.06.06'
__author__ = 'Doug Skrypa'
__author_email__ = 'dskrypa@gmail.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2022 Doug Skrypa'
| __title__ = 'cli_command_parser'
__description__ = 'CLI Command Parser'
__url__ = 'https://github.com/dskrypa/cli_command_parser'
__version__ = '2022.06.06'
__author__ = 'Doug Skrypa'
__author_email__ = 'dskrypa@gmail.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2022 Doug Skrypa' |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Evgenii sopov <mrseakg@gmail.com>
# pylint: disable=relative-beyond-top-level,missing-function-docstring
"""cpplint list of errors"""
def error_line_too_long(parsed_line):
print("error(00001): Line too long {}:{}".format(
parsed_line.get_filename(),
parsed_line.get_number_of_line()
)
)
def error_whitespace_after_equal(parsed_line):
print("error(00002): Expected whitespace after equal {}:{}".format(
parsed_line.get_filename(),
parsed_line.get_number_of_line()
)
)
def error_whitespace_before_equal(parsed_line):
print("error(00003): Expecetd whitespace before equal {}:{}".format(
parsed_line.get_filename(),
parsed_line.get_number_of_line()
)
)
def error_whitespace_comment(parsed_line):
print("error(00004): Expected whitespace after '//' {}:{}".format(
parsed_line.get_filename(),
parsed_line.get_number_of_line()
)
)
def error_whitespace_end_of_line(parsed_line):
print("error(00005): Excess whitespaces on end of line {}:{}".format(
parsed_line.get_filename(),
parsed_line.get_number_of_line()
)
)
def error_conf_unsupported_param(pc_name, _cnf_file, count):
ret = """error(00006): Unsupported parameter {}
in line {}:{}
""".format(pc_name, _cnf_file, count)
return ret
def error_conf_alredy_defined(checker_id, _cnf_name):
ret = """error(00007): Configuration name '{}' already defined
found in {}
""".format(_cnf_name, checker_id)
return ret
def error_conf_expected_eq(line_content, _cnf_file, count):
ret = """error(00008): Expected '=' in line
line_content = {}
in line {}:{}
""".format(line_content, _cnf_file, count)
return ret
def error_conf_in_regexp(pc_name, pc_value, err, _cnf_file, count):
ret = """error(00009): Problem with regexp
name = {}
value = {}
error = {}
in line {}:{}
""".format(pc_name, pc_value, str(err), _cnf_file, count)
return ret
def error_conf_file_not_exists(_cnf_file):
ret = """error(00010): File did not exists
name = {}
""".format(_cnf_file)
return ret
def error_could_not_parse_line(_line, _file, _number_of_line):
ret = """error(00011): Could not parse line
line content = {}
in line = {}:{}
""".format(_line, _file, _number_of_line)
return ret
def error_not_parse_line_character(_char, _line, _file, _number_of_line):
ret = """error(00012): Could not parse char '{}'
line content = {}
in line = {}:{}
""".format(_char, _line, _file, _number_of_line)
return ret
| """cpplint list of errors"""
def error_line_too_long(parsed_line):
print('error(00001): Line too long {}:{}'.format(parsed_line.get_filename(), parsed_line.get_number_of_line()))
def error_whitespace_after_equal(parsed_line):
print('error(00002): Expected whitespace after equal {}:{}'.format(parsed_line.get_filename(), parsed_line.get_number_of_line()))
def error_whitespace_before_equal(parsed_line):
print('error(00003): Expecetd whitespace before equal {}:{}'.format(parsed_line.get_filename(), parsed_line.get_number_of_line()))
def error_whitespace_comment(parsed_line):
print("error(00004): Expected whitespace after '//' {}:{}".format(parsed_line.get_filename(), parsed_line.get_number_of_line()))
def error_whitespace_end_of_line(parsed_line):
print('error(00005): Excess whitespaces on end of line {}:{}'.format(parsed_line.get_filename(), parsed_line.get_number_of_line()))
def error_conf_unsupported_param(pc_name, _cnf_file, count):
ret = 'error(00006): Unsupported parameter {}\n in line {}:{}\n '.format(pc_name, _cnf_file, count)
return ret
def error_conf_alredy_defined(checker_id, _cnf_name):
ret = "error(00007): Configuration name '{}' already defined\n found in {}\n ".format(_cnf_name, checker_id)
return ret
def error_conf_expected_eq(line_content, _cnf_file, count):
ret = "error(00008): Expected '=' in line\n line_content = {}\n in line {}:{}\n ".format(line_content, _cnf_file, count)
return ret
def error_conf_in_regexp(pc_name, pc_value, err, _cnf_file, count):
ret = 'error(00009): Problem with regexp\n name = {}\n value = {}\n error = {}\n in line {}:{}\n '.format(pc_name, pc_value, str(err), _cnf_file, count)
return ret
def error_conf_file_not_exists(_cnf_file):
ret = 'error(00010): File did not exists\n name = {}\n '.format(_cnf_file)
return ret
def error_could_not_parse_line(_line, _file, _number_of_line):
ret = 'error(00011): Could not parse line\n line content = {}\n in line = {}:{}\n '.format(_line, _file, _number_of_line)
return ret
def error_not_parse_line_character(_char, _line, _file, _number_of_line):
ret = "error(00012): Could not parse char '{}'\n line content = {}\n in line = {}:{}\n ".format(_char, _line, _file, _number_of_line)
return ret |
# Based and improved from https://github.com/piratecrew/rez-python
name = "python"
version = "2.7.16"
authors = [
"Guido van Rossum"
]
description = \
"""
The Python programming language.
"""
requires = [
"cmake-3+",
"gcc-6+"
]
variants = [
["platform-linux"]
]
tools = [
"2to3",
"idle",
"pip",
"pip2.7",
"pip2",
"pydoc",
"python-config",
"python",
"python2-config",
"python2.7-config",
"python2.7",
"python2",
"smtpd.py"
]
build_system = "cmake"
with scope("config") as config:
config.build_thread_count = "logical_cores"
uuid = "python-{version}".format(version=str(version))
def commands():
env.PATH.prepend("{root}/bin")
env.LD_LIBRARY_PATH.prepend("{root}/lib")
env.PKG_CONFIG_PATH.prepend("{root}/lib/pkgconfig")
# Helper environment variables.
env.PYTHON_BINARY_PATH.set("{root}/bin")
env.PYTHON_INCLUDE_PATH.set("{root}/include")
env.PYTHON_LIBRARY_PATH.set("{root}/lib")
| name = 'python'
version = '2.7.16'
authors = ['Guido van Rossum']
description = '\n The Python programming language.\n '
requires = ['cmake-3+', 'gcc-6+']
variants = [['platform-linux']]
tools = ['2to3', 'idle', 'pip', 'pip2.7', 'pip2', 'pydoc', 'python-config', 'python', 'python2-config', 'python2.7-config', 'python2.7', 'python2', 'smtpd.py']
build_system = 'cmake'
with scope('config') as config:
config.build_thread_count = 'logical_cores'
uuid = 'python-{version}'.format(version=str(version))
def commands():
env.PATH.prepend('{root}/bin')
env.LD_LIBRARY_PATH.prepend('{root}/lib')
env.PKG_CONFIG_PATH.prepend('{root}/lib/pkgconfig')
env.PYTHON_BINARY_PATH.set('{root}/bin')
env.PYTHON_INCLUDE_PATH.set('{root}/include')
env.PYTHON_LIBRARY_PATH.set('{root}/lib') |
def sda_to_rgb(im_sda, I_0):
"""Transform input SDA image or matrix `im_sda` into RGB space. This
is the inverse of `rgb_to_sda` with respect to the first parameter
Parameters
----------
im_sda : array_like
Image (MxNx3) or matrix (3xN) of pixels
I_0 : float or array_like
Background intensity, either per-channel or for all channels
Note
----
For compatibility purposes, passing I_0=None invokes the behavior of
od_to_rgb.
See Also
--------
histomicstk.preprocessing.color_conversion.rgb_to_sda,
histomicstk.preprocessing.color_conversion.od_to_rgb,
histomicstk.preprocessing.color_deconvolution.color_deconvolution,
histomicstk.preprocessing.color_deconvolution.color_convolution
"""
is_matrix = im_sda.ndim == 2
if is_matrix:
im_sda = im_sda.T
od = I_0 is None
if od: # od_to_rgb compatibility
I_0 = 256
im_rgb = I_0 ** (1 - im_sda / 255.)
return (im_rgb.T if is_matrix else im_rgb) - od
| def sda_to_rgb(im_sda, I_0):
"""Transform input SDA image or matrix `im_sda` into RGB space. This
is the inverse of `rgb_to_sda` with respect to the first parameter
Parameters
----------
im_sda : array_like
Image (MxNx3) or matrix (3xN) of pixels
I_0 : float or array_like
Background intensity, either per-channel or for all channels
Note
----
For compatibility purposes, passing I_0=None invokes the behavior of
od_to_rgb.
See Also
--------
histomicstk.preprocessing.color_conversion.rgb_to_sda,
histomicstk.preprocessing.color_conversion.od_to_rgb,
histomicstk.preprocessing.color_deconvolution.color_deconvolution,
histomicstk.preprocessing.color_deconvolution.color_convolution
"""
is_matrix = im_sda.ndim == 2
if is_matrix:
im_sda = im_sda.T
od = I_0 is None
if od:
i_0 = 256
im_rgb = I_0 ** (1 - im_sda / 255.0)
return (im_rgb.T if is_matrix else im_rgb) - od |
altitude=int(input("enter the current altitude : "))
if altitude<=1000:
print(" SAFE to land")
elif altitude>1000 and altitude<=5000:
print("bring it down to 1000ft")
else:
print("turn around") | altitude = int(input('enter the current altitude : '))
if altitude <= 1000:
print(' SAFE to land')
elif altitude > 1000 and altitude <= 5000:
print('bring it down to 1000ft')
else:
print('turn around') |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def hasCycle(self, head: Optional[ListNode]) -> bool:
cs = head
cf = head
if head == None:
return False
if cf.next == None:
return False
else:
cf = cf.next
while cf.next != None and cf != cs:
cs = cs.next
cf = cf.next
if cf.next != None:
cf = cf.next
else:
return False
if cf == cs:
return True
return False | class Solution:
def has_cycle(self, head: Optional[ListNode]) -> bool:
cs = head
cf = head
if head == None:
return False
if cf.next == None:
return False
else:
cf = cf.next
while cf.next != None and cf != cs:
cs = cs.next
cf = cf.next
if cf.next != None:
cf = cf.next
else:
return False
if cf == cs:
return True
return False |
# ***************************************
# ******** Manual Configurations ********
# ***************************************
# ----------------------------------------------------------------
# -------- Part 1, meta-network generation settings ----------
# ----------------------------------------------------------------
# 1. What is the path to the folder containing the BLAST result files ? Please end all folders with a single slash ('/').
blast_results_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/mbl_cdhit50_all_by_all/'
# 2. Which files in the input folder should be used for this analysis ? Setting None will use all files in the input folder.
# blast_results_files = ['b1_all_by_all.txt','b2_vs_b1_all_blast.txt','b2_vs_b1_all_as_subject.txt']
blast_results_files = None
# 3. Which columns (1st column is 0, 2nd is 1, etc) in the blast files contain the following information ?
# Please ensure this is true for all files given as input.
query_col = 0
subject_col = 1
bitscore_col = 3
# Obsolete : clustering thresholds now provided directly through command line
# 4. At what bitscore threshold should sequences be grouped together into a metanode ?
# metanode_bitscore_range = range(100,310,10)
# 5. At what bitscore threshold should edge connections be ignored for the network ?
# fixed_min_bitscore = None
# bitscore_gap = 10
# 6. Enter the path to the file used to limit the sequences used in the analysis ? Only sequence IDs present in the file will be used in the analysis.
# If set to None, ther filter is ignored.
# The file should be formatted to have a single sequence ID on each line
filter_path = 'input/filters/'
filter_files = []
# filter_files = ['b1_subgroup_all_reps.txt']
# 7. What should the output be named? The label given should only describe the input data, as the bitscore cut-offs and other information will be added as suffixes automatically.
output_label = 'mbl_full_cdhit50'
# output_label = 'b1_subgroup'
# 8. Where should the output be placed ? This will create a directory relative to the scripts running location.
# output_dir = 'result_tiered/'
# output_dir = 'cluster_extraction/'
output_dir = 'metaSSN_v4_test/'
# use_old_metanodes = True # use old if found
# 9. Out put member names can be remapped, supply a mapping file with the old name in the first column and the new name in the second
# names not found in the file will be left as is.
mapping_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/sequences/'
member_name_mapping = []
# ----------------------------------------------------------------
# ------- Part 2, resolving sequence clustering, OPTIONAL --------
# ----------------------------------------------------------------
# 1. Should member sequences in the metanodes be analysed for cluster members ? Only applicable if each member sequence is the representative of a cluster of sequences,
# and should be set to False otherwise.
# analyze_clustering = True
# use_old_clustering = True
# 2. What is the path to the folder containing clustering information ?
cluster_info_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/sequences/'
# 3. Describe each file in the input folder using the following Dictionary.
# Each top level key should be the name of the file, and the value should be a dictionary specifying if the file is 1) a 'cdhit' cluster or a 'table',
# 2) a label to give data extracted from this clustering, 3) the table delimiter, 4) the key column of the table for matching sequence IDs,
# 5) the column in the table that contains member information, and 6) the delimiter that separates cluster members in the table's string.
# Properties 3-6 are for tables only and can be set to None for cdhit files. Properties 4-5 should be given with 0 as the 1st column, 1 as the 2nd, etc.
# For heirarchical clustering of cdhit files, only the lowest identity file needs to be assigned, the remainder should be provided below.
# label currently unused, doesn't make sense, since clustering may not necessarily mean distinct datasets
cluster_file_info = {
'mbl_cdhit50.clstr': {'format':'cdhit', 'delim':None, 'key_col':None, 'member_col':None, 'member_delim':None}
# 'B1_230_to_300_cdhit.clstr': {'format':'cdhit', 'label':'metagenome', 'delim':None, 'key_col':None, 'member_col':None, 'member_delim':None},
# 'CARD_b1_cdhit70.clstr': {'format':'cdhit', 'label':'B1', 'delim':None, 'key_col':None, 'member_col':None, 'member_delim':None},
# 'CARD_b2_cdhit70.clstr': {'format':'cdhit', 'label':'B2', 'delim':None, 'key_col':None, 'member_col':None, 'member_delim':None},
# 'uniref50_IPR001279.tab': {'format':'table', 'label':'uniprot', 'delim':'\t', 'key_col':0, 'member_col':4, 'member_delim':';'}
}
# 4. For cdhit based clustering, describe heirarchical clustering, if any. Use a dictionary where the key is the clustering with the lowest identity, and
# the value is a list of the other files in the heirarchy in ascending order of identity cut-off.
# If not, give None as the input.
# example
# cdhit_heirarchy = { '40%.clstr': ['70%.clstr','90%.clstr'] }
cdhit_heirarchy = {'mbl_cdhit50.clstr': ['mbl_cdhit70.clstr','mbl_cdhit90.clstr'] }
# ----------------------------------------------------------------
# ------- Part 3, extra annotation, OPTIONAL --------
# ----------------------------------------------------------------
# 1. Would you like to add extra annotations ?
# annot_metanodes = True
# 2. Provide the path to the folder containing the annotation files.
annot_path = 'input/annot/'
# 3. Provide a list of files to annotate by membership count. Each entry should be a dictionary
# that specifies the filename, the annotation label and the level at which the annotations should be applied (metanode members vs all sequences in metanode)
# Each file should be a series of sequence IDs separated by new lines. The IDs should be non-redundant.
# NOTE: the same file may not work for both 'member' and 'sequence' level extractions, since representative members may have different names than at the individual sequence level
# such as UniRef vs UniProt IDs
membership_count_annot = [
{'files':'b1_refs.txt','id_col':0,'data_col':None,'delim':'\t','label':'CARD B1','level':'sequence'},
{'files':'b2_refs.txt','id_col':0,'data_col':None,'delim':'\t','label':'CARD B2','level':'sequence'},
{'files':'b3_refs.txt','id_col':0,'data_col':None,'delim':'\t','label':'CARD B3','level':'sequence'},
{'files':'mbl_swissprot_acc.txt','id_col':0,'data_col':None,'delim':'\t','label':'SwissProt','level':'sequence'},
{'files':'mbl_uniprot_acc.txt','id_col':0,'data_col':None,'delim':'\t','label':'UniProt','level':'sequence'},
{'files':'jgi_headers.txt','id_col':0,'data_col':None,'delim':'\t','label':'JGI','level':'sequence'}
# {'files':'b1_refs.txt','id_col':0,'data_col':None,'delim':'\t','label':'known B1','level':'member'},
# {'files':'b1_refs.txt','id_col':0,'data_col':None,'delim':'\t','label':'known B1','level':'sequence'},
# {'files':'ipr001279_acc.txt','id_col':0,'data_col':None,'delim':'\t','label':'UniProt','level':'sequence'},
# {'files':'JGI_b1_230-300aa_headers.txt','id_col':0,'data_col':None,'delim':'\t','label':'JGI','level':'sequence'}
]
# 4. Provide a list of files to annotate by frequency of certain traits (genus, kingdom, etc). Each entry should be a dictionary
# that specifies the file name, the column of the sequence id, the column of the data, the file delimiter, the annotation label and the level at which the annotations
# should be applied (metanode members vs all sequences in metanode)
# Each file should be a tab separated file with the sequence ID in the first column, and the trait in the second column.
membership_freq_annot = [
# {'files':'b1_active_sites.txt','id_col':0,'data_col':1,'delim':'\t','label':'active_site','level':'member','highest_entries':3},
# {'files':'b1_active_sites.txt','id_col':0,'data_col':1,'delim':'\t','label':'active_site','level':'member','highest_entries':3},
{'files':'ipr001279_org_annot_filled.txt','id_col':0,'data_col':2,'delim':'\t','label':'genus','level':'sequence','highest_entries':5},
{'files':['B1_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B1_activesite','level':'sequence','highest_entries':3},
{'files':['B2_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B2_activesite','level':'sequence','highest_entries':3},
{'files':['B3_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B3_activesite','level':'sequence','highest_entries':3},
{'files':['B1_200-350aa_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B1_200-350aa_activesite','level':'sequence','highest_entries':3},
{'files':['B2_200-350aa_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B2_200-350aa_activesite','level':'sequence','highest_entries':3},
{'files':['B3_200-350aa_activesite.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B3_200-350aa_activesite','level':'sequence','highest_entries':3},
{'files':['B1_MSA_inclusion.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B1_200-350aa_MSA_inclusion','level':'sequence','highest_entries':3},
{'files':['B2_MSA_inclusion.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B2_200-350aa_MSA_inclusion','level':'sequence','highest_entries':3},
{'files':['B3_MSA_inclusion.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'B3_200-350aa_MSA_inclusion','level':'sequence','highest_entries':3}
]
# 5. Unique labels
membership_label = [
{'files':'b1_name.txt','id_col':1,'data_col':2 ,'delim':'\t', 'label':'known B1 families', 'level':'sequence'},
{'files':'b2_name.txt','id_col':1,'data_col':2 ,'delim':'\t', 'label':'known B2 families', 'level':'sequence'},
{'files':'b3_name.txt','id_col':1,'data_col':2 ,'delim':'\t', 'label':'known B3 families', 'level':'sequence'},
# {'files':'b1_family_label.txt','id_col':0,'data_col':1 ,'delim':'\t', 'label':'known B1 families', 'level':'member'}
]
# 6. Numerical distribution
membership_dist_annot = [
# {'files':['ipr001279_length.txt', 'JGI_b1_230-300aa_headers+length.txt'],'id_col':0,'data_col':1,'delim':'\t','label':'length_dist','level':'sequence'}
{'files':'mbl_lengths.txt','id_col':0,'data_col':1,'delim':'\t','label':'length_dist','level':'sequence'}
]
# 7. link nodes at higher cut-offs to those observed at lower ones. Make sure the file is a lower cut-off than the currently set metanode bitscores, or else the results
# will not make any sense. It also doesn't need to be from the same set of analysis, since node numbering is arbitrary so long as the clustering is correct.
# level should always be member.
membership_lower_node = [
# {'files':'b1_ssn_50min_115clust_meta-node_members.txt','id_col':1,'data_col':0 ,'delim':'\t', 'label':'115clust node', 'level':'member', 'bitscore':115}
] | blast_results_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/mbl_cdhit50_all_by_all/'
blast_results_files = None
query_col = 0
subject_col = 1
bitscore_col = 3
filter_path = 'input/filters/'
filter_files = []
output_label = 'mbl_full_cdhit50'
output_dir = 'metaSSN_v4_test/'
mapping_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/sequences/'
member_name_mapping = []
cluster_info_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/sequences/'
cluster_file_info = {'mbl_cdhit50.clstr': {'format': 'cdhit', 'delim': None, 'key_col': None, 'member_col': None, 'member_delim': None}}
cdhit_heirarchy = {'mbl_cdhit50.clstr': ['mbl_cdhit70.clstr', 'mbl_cdhit90.clstr']}
annot_path = 'input/annot/'
membership_count_annot = [{'files': 'b1_refs.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'CARD B1', 'level': 'sequence'}, {'files': 'b2_refs.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'CARD B2', 'level': 'sequence'}, {'files': 'b3_refs.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'CARD B3', 'level': 'sequence'}, {'files': 'mbl_swissprot_acc.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'SwissProt', 'level': 'sequence'}, {'files': 'mbl_uniprot_acc.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'UniProt', 'level': 'sequence'}, {'files': 'jgi_headers.txt', 'id_col': 0, 'data_col': None, 'delim': '\t', 'label': 'JGI', 'level': 'sequence'}]
membership_freq_annot = [{'files': 'ipr001279_org_annot_filled.txt', 'id_col': 0, 'data_col': 2, 'delim': '\t', 'label': 'genus', 'level': 'sequence', 'highest_entries': 5}, {'files': ['B1_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B1_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B2_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B2_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B3_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B3_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B1_200-350aa_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B1_200-350aa_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B2_200-350aa_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B2_200-350aa_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B3_200-350aa_activesite.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B3_200-350aa_activesite', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B1_MSA_inclusion.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B1_200-350aa_MSA_inclusion', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B2_MSA_inclusion.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B2_200-350aa_MSA_inclusion', 'level': 'sequence', 'highest_entries': 3}, {'files': ['B3_MSA_inclusion.txt'], 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'B3_200-350aa_MSA_inclusion', 'level': 'sequence', 'highest_entries': 3}]
membership_label = [{'files': 'b1_name.txt', 'id_col': 1, 'data_col': 2, 'delim': '\t', 'label': 'known B1 families', 'level': 'sequence'}, {'files': 'b2_name.txt', 'id_col': 1, 'data_col': 2, 'delim': '\t', 'label': 'known B2 families', 'level': 'sequence'}, {'files': 'b3_name.txt', 'id_col': 1, 'data_col': 2, 'delim': '\t', 'label': 'known B3 families', 'level': 'sequence'}]
membership_dist_annot = [{'files': 'mbl_lengths.txt', 'id_col': 0, 'data_col': 1, 'delim': '\t', 'label': 'length_dist', 'level': 'sequence'}]
membership_lower_node = [] |
sbox0 = [
0X3e, 0x72, 0x5b, 0x47, 0xca, 0xe0, 0x00, 0x33, 0x04, 0xd1, 0x54, 0x98, 0x09, 0xb9, 0x6d, 0xcb,
0X7b, 0x1b, 0xf9, 0x32, 0xaf, 0x9d, 0x6a, 0xa5, 0xb8, 0x2d, 0xfc, 0x1d, 0x08, 0x53, 0x03, 0x90,
0X4d, 0x4e, 0x84, 0x99, 0xe4, 0xce, 0xd9, 0x91, 0xdd, 0xb6, 0x85, 0x48, 0x8b, 0x29, 0x6e, 0xac,
0Xcd, 0xc1, 0xf8, 0x1e, 0x73, 0x43, 0x69, 0xc6, 0xb5, 0xbd, 0xfd, 0x39, 0x63, 0x20, 0xd4, 0x38,
0X76, 0x7d, 0xb2, 0xa7, 0xcf, 0xed, 0x57, 0xc5, 0xf3, 0x2c, 0xbb, 0x14, 0x21, 0x06, 0x55, 0x9b,
0Xe3, 0xef, 0x5e, 0x31, 0x4f, 0x7f, 0x5a, 0xa4, 0x0d, 0x82, 0x51, 0x49, 0x5f, 0xba, 0x58, 0x1c,
0X4a, 0x16, 0xd5, 0x17, 0xa8, 0x92, 0x24, 0x1f, 0x8c, 0xff, 0xd8, 0xae, 0x2e, 0x01, 0xd3, 0xad,
0X3b, 0x4b, 0xda, 0x46, 0xeb, 0xc9, 0xde, 0x9a, 0x8f, 0x87, 0xd7, 0x3a, 0x80, 0x6f, 0x2f, 0xc8,
0Xb1, 0xb4, 0x37, 0xf7, 0x0a, 0x22, 0x13, 0x28, 0x7c, 0xcc, 0x3c, 0x89, 0xc7, 0xc3, 0x96, 0x56,
0X07, 0xbf, 0x7e, 0xf0, 0x0b, 0x2b, 0x97, 0x52, 0x35, 0x41, 0x79, 0x61, 0xa6, 0x4c, 0x10, 0xfe,
0Xbc, 0x26, 0x95, 0x88, 0x8a, 0xb0, 0xa3, 0xfb, 0xc0, 0x18, 0x94, 0xf2, 0xe1, 0xe5, 0xe9, 0x5d,
0Xd0, 0xdc, 0x11, 0x66, 0x64, 0x5c, 0xec, 0x59, 0x42, 0x75, 0x12, 0xf5, 0x74, 0x9c, 0xaa, 0x23,
0X0e, 0x86, 0xab, 0xbe, 0x2a, 0x02, 0xe7, 0x67, 0xe6, 0x44, 0xa2, 0x6c, 0xc2, 0x93, 0x9f, 0xf1,
0Xf6, 0xfa, 0x36, 0xd2, 0x50, 0x68, 0x9e, 0x62, 0x71, 0x15, 0x3d, 0xd6, 0x40, 0xc4, 0xe2, 0x0f,
0X8e, 0x83, 0x77, 0x6b, 0x25, 0x05, 0x3f, 0x0c, 0x30, 0xea, 0x70, 0xb7, 0xa1, 0xe8, 0xa9, 0x65,
0X8d, 0x27, 0x1a, 0xdb, 0x81, 0xb3, 0xa0, 0xf4, 0x45, 0x7a, 0x19, 0xdf, 0xee, 0x78, 0x34, 0x60
]
sbox1 = [
0x55, 0xc2, 0x63, 0x71, 0x3b, 0xc8, 0x47, 0x86, 0x9f, 0x3c, 0xda, 0x5b, 0x29, 0xaa, 0xfd, 0x77,
0x8c, 0xc5, 0x94, 0x0c, 0xa6, 0x1a, 0x13, 0x00, 0xe3, 0xa8, 0x16, 0x72, 0x40, 0xf9, 0xf8, 0x42,
0x44, 0x26, 0x68, 0x96, 0x81, 0xd9, 0x45, 0x3e, 0x10, 0x76, 0xc6, 0xa7, 0x8b, 0x39, 0x43, 0xe1,
0x3a, 0xb5, 0x56, 0x2a, 0xc0, 0x6d, 0xb3, 0x05, 0x22, 0x66, 0xbf, 0xdc, 0x0b, 0xfa, 0x62, 0x48,
0xdd, 0x20, 0x11, 0x06, 0x36, 0xc9, 0xc1, 0xcf, 0xf6, 0x27, 0x52, 0xbb, 0x69, 0xf5, 0xd4, 0x87,
0x7f, 0x84, 0x4c, 0xd2, 0x9c, 0x57, 0xa4, 0xbc, 0x4f, 0x9a, 0xdf, 0xfe, 0xd6, 0x8d, 0x7a, 0xeb,
0x2b, 0x53, 0xd8, 0x5c, 0xa1, 0x14, 0x17, 0xfb, 0x23, 0xd5, 0x7d, 0x30, 0x67, 0x73, 0x08, 0x09,
0xee, 0xb7, 0x70, 0x3f, 0x61, 0xb2, 0x19, 0x8e, 0x4e, 0xe5, 0x4b, 0x93, 0x8f, 0x5d, 0xdb, 0xa9,
0xad, 0xf1, 0xae, 0x2e, 0xcb, 0x0d, 0xfc, 0xf4, 0x2d, 0x46, 0x6e, 0x1d, 0x97, 0xe8, 0xd1, 0xe9,
0x4d, 0x37, 0xa5, 0x75, 0x5e, 0x83, 0x9e, 0xab, 0x82, 0x9d, 0xb9, 0x1c, 0xe0, 0xcd, 0x49, 0x89,
0x01, 0xb6, 0xbd, 0x58, 0x24, 0xa2, 0x5f, 0x38, 0x78, 0x99, 0x15, 0x90, 0x50, 0xb8, 0x95, 0xe4,
0xd0, 0x91, 0xc7, 0xce, 0xed, 0x0f, 0xb4, 0x6f, 0xa0, 0xcc, 0xf0, 0x02, 0x4a, 0x79, 0xc3, 0xde,
0xa3, 0xef, 0xea, 0x51, 0xe6, 0x6b, 0x18, 0xec, 0x1b, 0x2c, 0x80, 0xf7, 0x74, 0xe7, 0xff, 0x21,
0x5a, 0x6a, 0x54, 0x1e, 0x41, 0x31, 0x92, 0x35, 0xc4, 0x33, 0x07, 0x0a, 0xba, 0x7e, 0x0e, 0x34,
0x88, 0xb1, 0x98, 0x7c, 0xf3, 0x3d, 0x60, 0x6c, 0x7b, 0xca, 0xd3, 0x1f, 0x32, 0x65, 0x04, 0x28,
0x64, 0xbe, 0x85, 0x9b, 0x2f, 0x59, 0x8a, 0xd7, 0xb0, 0x25, 0xac, 0xaf, 0x12, 0x03, 0xe2, 0xf2
]
D = [
0x44d7, 0x26bc, 0x626b, 0x135e, 0x5789, 0x35e2, 0x7135, 0x09af,
0x4d78, 0x2f13, 0x6bc4, 0x1af1, 0x5e26, 0x3c4d, 0x789a, 0x47ac
]
def LFSRCalcS(s):
# return (s[15] << 15 + s[13] << 17 + s[10] << 21 + s[4] << 20 + s[0] << 8 + s[0]) % 0x7fffffff
return (left_rot(s[15], 15, 31) + left_rot(s[13], 17, 31) + left_rot(s[10], 21, 31) + left_rot(s[4], 20, 31) + left_rot(s[0], 8, 31) + s[0]) % 0x7fffffff
def LFSRWithInitMode(s, u):
s.append(0x7fffffff if s[0] == 0 else ((LFSRCalcS(s) + u) % 0x7fffffff))
s.pop(0)
def LFSRWithWorkMode(s):
s.append(0x7fffffff if s[0] == 0 else LFSRCalcS(s))
s.pop(0)
def BitReorganization(s):
X = [0, 0, 0, 0]
X[0] = ((s[15] & 0x7fff8000) << 1) | (s[14] & 0xffff)
X[1] = ((s[11] & 0xffff) << 16) | (s[9] >> 15)
X[2] = ((s[7] & 0xffff) << 16) | (s[5] >> 15)
X[3] = ((s[2] & 0xffff) << 16) | (s[0] >> 15)
return X
def left_rot(x, n, x_len):
n %= x_len
return ((x << n) | (x >> (x_len - n))) & ((1 << x_len) - 1)
def left_rot1(x):
return x ^ left_rot(x, 2, 32) ^ left_rot(x, 10, 32) ^ left_rot(x, 18, 32) ^ left_rot(x, 24, 32)
def left_rot2(x):
return x ^ left_rot(x, 8, 32) ^ left_rot(x, 14, 32) ^ left_rot(x, 22, 32) ^ left_rot(x, 30, 32)
def SBOX(x):
return (sbox0[x >> 24] << 24) | (sbox1[(x >> 16) & 0xff] << 16) | (sbox0[(x >> 8) & 0xff] << 8) | (sbox1[x & 0xff])
def F(R, x0, x1, x2):
W = [0, 0, 0]
W[0] = ((x0 ^ R[0]) + R[1]) & 0xffffffff
W[1] = (R[0] + x1) & 0xffffffff
W[2] = R[1] ^ x2
R[0] = SBOX(left_rot1((((W[1] & 0xffff) << 16) | (W[2] >> 16))))
R[1] = SBOX(left_rot2((((W[2] & 0xffff) << 16) | (W[1] >> 16))))
return W[0]
def pack_key(s, k, iv):
for i in range(15, -1, -1):
s[i] = ((k & 0xff) << 23) | (D[i] << 8) | (iv & 0xff)
k >>= 8
iv >>= 8
def zuc_run(k, iv, key_len):
s = [0 for i in range(16)]
R = [0, 0]
# init mode
pack_key(s, k, iv)
for i in range(32):
X = BitReorganization(s)
W = F(R, X[0], X[1], X[2])
LFSRWithInitMode(s, W >> 1)
''' debug
for j in X:
print ('%x' % j, end = ' ')
for j in R:
print ('%x' % j, end = ' ')
print ('%x' % W, end = ' ')
print ('%x' % s[15])
'''
# work mode
X = BitReorganization(s)
F(R, X[0], X[1], X[2])
LFSRWithWorkMode(s)
Z = []
for i in range(key_len):
X = BitReorganization(s)
Z.append(F(R, X[0], X[1], X[2]) ^ X[3])
LFSRWithWorkMode(s)
return Z
if __name__ == '__main__':
a = zuc_run(0, 0, 2)
print ('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(0xffffffffffffffffffffffffffffffff, 0xffffffffffffffffffffffffffffffff, 2)
print ('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(0x3d4c4be96a82fdaeb58f641db17b455b, 0x84319aa8de6915ca1f6bda6bfbd8c766, 2)
print ('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(0x338985fedc98cb99c9f9b346bd6cae56, 0x7dd3175c2374c7113bcbbfb339563172, 10)
for a_i in a:
print ('%x' % (a_i)) | sbox0 = [62, 114, 91, 71, 202, 224, 0, 51, 4, 209, 84, 152, 9, 185, 109, 203, 123, 27, 249, 50, 175, 157, 106, 165, 184, 45, 252, 29, 8, 83, 3, 144, 77, 78, 132, 153, 228, 206, 217, 145, 221, 182, 133, 72, 139, 41, 110, 172, 205, 193, 248, 30, 115, 67, 105, 198, 181, 189, 253, 57, 99, 32, 212, 56, 118, 125, 178, 167, 207, 237, 87, 197, 243, 44, 187, 20, 33, 6, 85, 155, 227, 239, 94, 49, 79, 127, 90, 164, 13, 130, 81, 73, 95, 186, 88, 28, 74, 22, 213, 23, 168, 146, 36, 31, 140, 255, 216, 174, 46, 1, 211, 173, 59, 75, 218, 70, 235, 201, 222, 154, 143, 135, 215, 58, 128, 111, 47, 200, 177, 180, 55, 247, 10, 34, 19, 40, 124, 204, 60, 137, 199, 195, 150, 86, 7, 191, 126, 240, 11, 43, 151, 82, 53, 65, 121, 97, 166, 76, 16, 254, 188, 38, 149, 136, 138, 176, 163, 251, 192, 24, 148, 242, 225, 229, 233, 93, 208, 220, 17, 102, 100, 92, 236, 89, 66, 117, 18, 245, 116, 156, 170, 35, 14, 134, 171, 190, 42, 2, 231, 103, 230, 68, 162, 108, 194, 147, 159, 241, 246, 250, 54, 210, 80, 104, 158, 98, 113, 21, 61, 214, 64, 196, 226, 15, 142, 131, 119, 107, 37, 5, 63, 12, 48, 234, 112, 183, 161, 232, 169, 101, 141, 39, 26, 219, 129, 179, 160, 244, 69, 122, 25, 223, 238, 120, 52, 96]
sbox1 = [85, 194, 99, 113, 59, 200, 71, 134, 159, 60, 218, 91, 41, 170, 253, 119, 140, 197, 148, 12, 166, 26, 19, 0, 227, 168, 22, 114, 64, 249, 248, 66, 68, 38, 104, 150, 129, 217, 69, 62, 16, 118, 198, 167, 139, 57, 67, 225, 58, 181, 86, 42, 192, 109, 179, 5, 34, 102, 191, 220, 11, 250, 98, 72, 221, 32, 17, 6, 54, 201, 193, 207, 246, 39, 82, 187, 105, 245, 212, 135, 127, 132, 76, 210, 156, 87, 164, 188, 79, 154, 223, 254, 214, 141, 122, 235, 43, 83, 216, 92, 161, 20, 23, 251, 35, 213, 125, 48, 103, 115, 8, 9, 238, 183, 112, 63, 97, 178, 25, 142, 78, 229, 75, 147, 143, 93, 219, 169, 173, 241, 174, 46, 203, 13, 252, 244, 45, 70, 110, 29, 151, 232, 209, 233, 77, 55, 165, 117, 94, 131, 158, 171, 130, 157, 185, 28, 224, 205, 73, 137, 1, 182, 189, 88, 36, 162, 95, 56, 120, 153, 21, 144, 80, 184, 149, 228, 208, 145, 199, 206, 237, 15, 180, 111, 160, 204, 240, 2, 74, 121, 195, 222, 163, 239, 234, 81, 230, 107, 24, 236, 27, 44, 128, 247, 116, 231, 255, 33, 90, 106, 84, 30, 65, 49, 146, 53, 196, 51, 7, 10, 186, 126, 14, 52, 136, 177, 152, 124, 243, 61, 96, 108, 123, 202, 211, 31, 50, 101, 4, 40, 100, 190, 133, 155, 47, 89, 138, 215, 176, 37, 172, 175, 18, 3, 226, 242]
d = [17623, 9916, 25195, 4958, 22409, 13794, 28981, 2479, 19832, 12051, 27588, 6897, 24102, 15437, 30874, 18348]
def lfsr_calc_s(s):
return (left_rot(s[15], 15, 31) + left_rot(s[13], 17, 31) + left_rot(s[10], 21, 31) + left_rot(s[4], 20, 31) + left_rot(s[0], 8, 31) + s[0]) % 2147483647
def lfsr_with_init_mode(s, u):
s.append(2147483647 if s[0] == 0 else (lfsr_calc_s(s) + u) % 2147483647)
s.pop(0)
def lfsr_with_work_mode(s):
s.append(2147483647 if s[0] == 0 else lfsr_calc_s(s))
s.pop(0)
def bit_reorganization(s):
x = [0, 0, 0, 0]
X[0] = (s[15] & 2147450880) << 1 | s[14] & 65535
X[1] = (s[11] & 65535) << 16 | s[9] >> 15
X[2] = (s[7] & 65535) << 16 | s[5] >> 15
X[3] = (s[2] & 65535) << 16 | s[0] >> 15
return X
def left_rot(x, n, x_len):
n %= x_len
return (x << n | x >> x_len - n) & (1 << x_len) - 1
def left_rot1(x):
return x ^ left_rot(x, 2, 32) ^ left_rot(x, 10, 32) ^ left_rot(x, 18, 32) ^ left_rot(x, 24, 32)
def left_rot2(x):
return x ^ left_rot(x, 8, 32) ^ left_rot(x, 14, 32) ^ left_rot(x, 22, 32) ^ left_rot(x, 30, 32)
def sbox(x):
return sbox0[x >> 24] << 24 | sbox1[x >> 16 & 255] << 16 | sbox0[x >> 8 & 255] << 8 | sbox1[x & 255]
def f(R, x0, x1, x2):
w = [0, 0, 0]
W[0] = (x0 ^ R[0]) + R[1] & 4294967295
W[1] = R[0] + x1 & 4294967295
W[2] = R[1] ^ x2
R[0] = sbox(left_rot1((W[1] & 65535) << 16 | W[2] >> 16))
R[1] = sbox(left_rot2((W[2] & 65535) << 16 | W[1] >> 16))
return W[0]
def pack_key(s, k, iv):
for i in range(15, -1, -1):
s[i] = (k & 255) << 23 | D[i] << 8 | iv & 255
k >>= 8
iv >>= 8
def zuc_run(k, iv, key_len):
s = [0 for i in range(16)]
r = [0, 0]
pack_key(s, k, iv)
for i in range(32):
x = bit_reorganization(s)
w = f(R, X[0], X[1], X[2])
lfsr_with_init_mode(s, W >> 1)
" debug\n\t\tfor j in X:\n\t\t\tprint ('%x' % j, end = ' ')\n\t\tfor j in R:\n\t\t\tprint ('%x' % j, end = ' ')\n\t\tprint ('%x' % W, end = ' ')\n\t\tprint ('%x' % s[15])\n\t\t"
x = bit_reorganization(s)
f(R, X[0], X[1], X[2])
lfsr_with_work_mode(s)
z = []
for i in range(key_len):
x = bit_reorganization(s)
Z.append(f(R, X[0], X[1], X[2]) ^ X[3])
lfsr_with_work_mode(s)
return Z
if __name__ == '__main__':
a = zuc_run(0, 0, 2)
print('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(340282366920938463463374607431768211455, 340282366920938463463374607431768211455, 2)
print('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(81479061977974424224921903182177322331, 175715654859920078820355257736348878694, 2)
print('%x\n%x\n' % (a[0], a[1]))
a = zuc_run(68504690207351965561090037172763668054, 167249547905650318850990489600416690546, 10)
for a_i in a:
print('%x' % a_i) |
# Description: Raw Strings
if __name__ == '__main__':
# Escape characters are honoured
a_string = "this is\na string split\t\tand tabbed"
print(a_string)
# Raw string is printed as it is without interpreting the escape characters.
# This is used a lot in regular expressions
raw_string = r"this is\na string split\t\tand tabbed"
print(raw_string)
b_string = "this is" + chr(10) + "a string split" + chr(9) + chr(9) + "and tabbed"
print(b_string)
backslash_string = "this is a backslash \followed by some text"
print(backslash_string)
backslash_string = "this is a backslash \\followed by some text"
print(backslash_string)
error_string = r"this string ends with \\"
| if __name__ == '__main__':
a_string = 'this is\na string split\t\tand tabbed'
print(a_string)
raw_string = 'this is\\na string split\\t\\tand tabbed'
print(raw_string)
b_string = 'this is' + chr(10) + 'a string split' + chr(9) + chr(9) + 'and tabbed'
print(b_string)
backslash_string = 'this is a backslash \x0collowed by some text'
print(backslash_string)
backslash_string = 'this is a backslash \\followed by some text'
print(backslash_string)
error_string = 'this string ends with \\\\' |
class BaseLangDetect:
"""
Container for what a language detection module
should take as input and should return as output
"""
def get(self, text):
"""
Uses the language detection module to detect a language
Parameters
----------
text : str
The raw text to detect the language of
Returns
-------
tuple(str, float)
The detected language and confidence of detection
"""
return 'und', 0.0 # (lang_str, confidence)
| class Baselangdetect:
"""
Container for what a language detection module
should take as input and should return as output
"""
def get(self, text):
"""
Uses the language detection module to detect a language
Parameters
----------
text : str
The raw text to detect the language of
Returns
-------
tuple(str, float)
The detected language and confidence of detection
"""
return ('und', 0.0) |
class Board():
def __init__(self, matrix):
self.matrix = matrix
self.cols = len(matrix)
self.rows = len(matrix[0])
self.last = None
self.matches = []
for i in range(self.rows):
self.matches.append([False] * self.cols)
def is_winner(self):
for row in self.matches:
if all(row):
return True
for j in range(self.cols):
col = [self.matches[i][j] for i in range(self.rows)]
if all(col):
return True
return False
def add_number(self, number):
for i in range(self.rows):
for j in range(self.cols):
if number == self.matrix[i][j]:
self.matches[i][j] = True
self.last = number
def score(self):
sum_unmarked = 0
for i in range(self.rows):
for j in range(self.cols):
sum_unmarked += self.matrix[i][j] * int(not self.matches[i][j])
return sum_unmarked * self.last
def __str__(self):
string = ""
for i in range(self.rows):
row_val = ""
row_mat = ""
for j in range(self.cols):
val = (" " + str(self.matrix[i][j]))[-2:]
mat = "x " if self.matches[i][j] else " "
row_val += val + " "
row_mat += mat + " "
row = row_val + " | " + row_mat
string += row + "\n"
return string | class Board:
def __init__(self, matrix):
self.matrix = matrix
self.cols = len(matrix)
self.rows = len(matrix[0])
self.last = None
self.matches = []
for i in range(self.rows):
self.matches.append([False] * self.cols)
def is_winner(self):
for row in self.matches:
if all(row):
return True
for j in range(self.cols):
col = [self.matches[i][j] for i in range(self.rows)]
if all(col):
return True
return False
def add_number(self, number):
for i in range(self.rows):
for j in range(self.cols):
if number == self.matrix[i][j]:
self.matches[i][j] = True
self.last = number
def score(self):
sum_unmarked = 0
for i in range(self.rows):
for j in range(self.cols):
sum_unmarked += self.matrix[i][j] * int(not self.matches[i][j])
return sum_unmarked * self.last
def __str__(self):
string = ''
for i in range(self.rows):
row_val = ''
row_mat = ''
for j in range(self.cols):
val = (' ' + str(self.matrix[i][j]))[-2:]
mat = 'x ' if self.matches[i][j] else ' '
row_val += val + ' '
row_mat += mat + ' '
row = row_val + ' | ' + row_mat
string += row + '\n'
return string |
DATABASE_ENGINE = 'sqlite3'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'tests.app',
]
| database_engine = 'sqlite3'
root_urlconf = 'tests.urls'
installed_apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'tests.app'] |
# using return in functions
def my_function(name,surname):
full_name = name.title() + " " + surname.title()
return full_name
print(my_function('selim', 'mh'))
| def my_function(name, surname):
full_name = name.title() + ' ' + surname.title()
return full_name
print(my_function('selim', 'mh')) |
class Solution:
def reverseWords(self, s: str) -> str:
q = []
raw_split = s.split(' ')
for raw_w in raw_split:
w = raw_w.strip()
if w:
q.append(w)
return ' '.join(q[::-1])
| class Solution:
def reverse_words(self, s: str) -> str:
q = []
raw_split = s.split(' ')
for raw_w in raw_split:
w = raw_w.strip()
if w:
q.append(w)
return ' '.join(q[::-1]) |
class RaddarException(Exception):
pass
class FailedToCloneRepoException(RaddarException):
pass
class FailedToWriteRepoException(RaddarException):
pass
| class Raddarexception(Exception):
pass
class Failedtoclonerepoexception(RaddarException):
pass
class Failedtowriterepoexception(RaddarException):
pass |
QUERIES = {}
QUERIES['1A'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, agerange
from vw_cpims_registration {ocbos} {oareas} {odate}
group by gender, agerange
'''
QUERIES['1B'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id,
CASE exit_status WHEN 'ACTIVE' THEN 'Active'
ELSE 'Exited' END AS active_status
from vw_cpims_registration {ocbos} {oareas} {odate}
group by gender, active_status
UNION
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Ever Registered' AS active_status
from vw_cpims_registration {ocbos} {oareas} {odate}
group by gender
'''
QUERIES['1C'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, schoollevel as school_level
from vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}
group by gender, schoollevel
'''
QUERIES['1D'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Active' as services
from vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}
group by gender
UNION
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Has Birth Certificate' as services
from vw_cpims_registration where exit_status='ACTIVE'
and birthcert = 'HAS BIRTHCERT' {cbos} {areas} {fdate}
group by gender
UNION
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Has Disability' as services
from vw_cpims_registration where exit_status='ACTIVE'
and ovcdisability = 'HAS DISABILITY' {cbos} {areas} {fdate}
group by gender
UNION
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'School Going' as services
from vw_cpims_registration where exit_status='ACTIVE'
and schoollevel != 'Not in School' {cbos} {areas} {fdate}
group by gender
'''
QUERIES['1E'] = '''
Select count(distinct(cpims_ovc_id)) AS dcount,
gender as sex_id,
CASE
when ovchivstatus='POSITIVE' THEN 'HIV Status +Ve'
when ovchivstatus='NEGATIVE' THEN 'HIV Status -Ve'
when ovchivstatus='NOT KNOWN' THEN 'HIV Status Unknown'
when ovchivstatus='HIV Test Not Required' THEN 'HIV Test not Required'
when ovchivstatus='HIV Referred For Testing' THEN 'HIV Referred For Testing'
ELSE 'Others' END AS hivstat
from vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}
group by gender, ovchivstatus
'''
QUERIES['1F'] = '''
SELECT count(cpims_ovc_id) as dcount,
gender as sex_id, eligibility
from vw_cpims_registration {ocbos} {oareas} {odate}
group by gender, eligibility
'''
QUERIES['1G'] = '''
SELECT count(cpims_ovc_id) as dcount,
gender as sex_id, exit_reason
from vw_cpims_registration where exit_status = 'EXITED' {cbos} {areas} {fdate}
group by gender, exit_reason order by count(cpims_ovc_id) desc
'''
QUERIES['1H'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'OVC Registration' as services
from vw_cpims_registration where exit_status = 'ACTIVE' {cbos} {areas} {dates}
group by gender
UNION
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'OVC Exit' as services
from vw_cpims_registration where exit_status = 'EXITED' {cbos} {areas} {dates}
group by gender
'''
QUERIES['2A'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Active' as hivstat
from vw_cpims_registration where exit_status='ACTIVE' {cbos} {fdate}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) AS dcount,
gender as sex_id, 'Positive' as hivstat
from vw_cpims_registration where exit_status='ACTIVE'
and ovchivstatus='POSITIVE' {cbos} {fdate} group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'On ART' as hivstat
from vw_cpims_registration where exit_status='ACTIVE'
and ovchivstatus='POSITIVE' AND artstatus='ART' {cbos} {fdate}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'VL Accessed' as hivstat
from vw_cpims_viral_load {ocbos}
group by gender
UNION
Select count(distinct(v.cpims_ovc_id)) as dcount,
v.gender as sex_id, 'Current VL' as hivstat
from vw_cpims_viral_load v
inner join (
select cpims_ovc_id, max(date_of_event) as most_current_vl_date
from vw_cpims_viral_load
group by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id
and v.date_of_event=vl.most_current_vl_date
where current_date - vl.most_current_vl_date <= 400 {vcbos}
group by v.gender
UNION
Select count(distinct(v.cpims_ovc_id)) AS dcount,
v.gender as sex_id, 'Suppressed' as hivstat
from vw_cpims_viral_load v
inner join (
select cpims_ovc_id, max(date_of_event) as most_current_vl_date
from vw_cpims_viral_load
group by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id
and v.date_of_event=vl.most_current_vl_date
where current_date - vl.most_current_vl_date <= 400
and v.viral_load < 1001 {vcbos} group by v.gender
UNION
Select count(distinct(v.cpims_ovc_id)) AS dcount,
v.gender as sex_id, 'Not Suppressed' as hivstat
from vw_cpims_viral_load v
inner join (
select cpims_ovc_id, max(date_of_event) as most_current_vl_date
from vw_cpims_viral_load
group by cpims_ovc_id ) vl on v.cpims_ovc_id=vl.cpims_ovc_id
and v.date_of_event=vl.most_current_vl_date
where current_date - vl.most_current_vl_date <=400
and v.viral_load > 1000 {vcbos}
group by v.gender
'''
QUERIES['2B'] = '''
Select count(distinct(cpims_ovc_id)) as dcount, gender as sex_id, agerange
from vw_cpims_viral_load where (current_date - date_of_event) < 401
and viral_load > 10000 {cbos} group by gender, agerange
'''
QUERIES['2C'] = '''
select sum(x.cnt) as dcount, x.gender as sex_id,
'OVC_SERV' as hivstat from
(
Select count(distinct(cpims_ovc_id)) as cnt,
gender from vw_cpims_active_beneficiary {ocbos}
group by gender
UNION ALL
Select count(distinct(cpims_ovc_id)), gender
from vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400
AND cpara_score = 17 {cbos} group by gender
) x group by x.gender
UNION
Select count(distinct(cpims_ovc_id)) AS dcount,
gender as sex_id,
CASE
when ovchivstatus='POSITIVE' THEN 'HIV Status +Ve'
when ovchivstatus='NEGATIVE' THEN 'HIV Status -Ve'
when ovchivstatus='NOT KNOWN' THEN 'HIV Status Unknown'
when ovchivstatus='HIV Test Not Required' THEN 'HIV Test not Required'
when ovchivstatus='HIV Referred For Testing' THEN 'HIV Referred For Testing'
ELSE 'Others' END AS hivstat
from vw_cpims_registration where cpims_ovc_id in
(select distinct(x.cpims_ovc_id) from
(
Select distinct(cpims_ovc_id)
from vw_cpims_active_beneficiary {ocbos}
UNION ALL
Select distinct(cpims_ovc_id)
from vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400
AND cpara_score = 17 {cbos}
) x)
and exit_status='ACTIVE' {cbos} {areas} {fdate}
group by gender, ovchivstatus
'''
QUERIES['2D'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
'Male' as sex_id, 'HIV Status' as hivstat
from vw_cpims_registration where exit_status='ACTIVE' {cbos}
UNION
Select count(distinct(cpims_ovc_id)) AS dcount,
'Male' as sex_id, 'ART Status' as hivstat
from vw_cpims_registration where exit_status='ACTIVE'
and ovchivstatus='POSITIVE' {cbos}
UNION
Select count(distinct(v.cpims_ovc_id)) as dcount,
'Male' as sex_id, 'Suppression' as hivstat
from vw_cpims_viral_load v
inner join (
select cpims_ovc_id, max(date_of_event) as most_current_vl_date
from vw_cpims_viral_load
group by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id
and v.date_of_event=vl.most_current_vl_date
where current_date - vl.most_current_vl_date <= 400 {vcbos}
UNION
Select count(distinct(cpims_ovc_id)) AS dcount,
'Female' as sex_id, 'HIV Status' as hivstat
from vw_cpims_registration where exit_status='ACTIVE'
and (ovchivstatus='POSITIVE' or ovchivstatus='NEGATIVE'
or ovchivstatus='NOT KNOWN' or ovchivstatus='HIV Test Not Required'
or ovchivstatus='HIV Referred For Testing') {cbos}
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
'Female' as sex_id, 'ART Status' as hivstat
from vw_cpims_registration where exit_status='ACTIVE'
and ovchivstatus='POSITIVE' AND artstatus='ART' {cbos}
UNION
Select count(distinct(v.cpims_ovc_id)) AS dcount,
'Female' as sex_id, 'Suppression' as hivstat
from vw_cpims_viral_load v
inner join (
select cpims_ovc_id, max(date_of_event) as most_current_vl_date
from vw_cpims_viral_load
group by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id
and v.date_of_event=vl.most_current_vl_date
where current_date - vl.most_current_vl_date <= 400
and v.viral_load < 1001 {vcbos}
'''
QUERIES['3A'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Active' as services
from vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender
UNION
Select count(distinct(person_id)) AS dcount,
gender as sex_id, 'Served Two Quarters' as services
from vw_cpims_two_quarters where (current_date - date_of_event) <=400 {cbos}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender, 'Case Plans' as services
from vw_cpims_case_plan where (current_date - date_of_event) <= 400 {cbos}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender, 'CPARA' as services
from vw_cpims_cpara where (current_date - date_of_event) <= 400 {cbos}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Graduated' as services
from vw_cpims_benchmark_achieved
where (current_date - date_of_event) <= 400
AND cpara_score = 17 {cbos}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Active Beneficiary' as services
from vw_cpims_active_beneficiary {ocbos}
group by gender
UNION
select sum(x.cnt) as dcount, x.gender as sex_id,
'OVC_SERV' as hivstat from
(
Select count(distinct(cpims_ovc_id)) as cnt,
gender from vw_cpims_active_beneficiary {ocbos}
group by gender
UNION ALL
Select count(distinct(cpims_ovc_id)), gender
from vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400
AND cpara_score = 17 {cbos} group by gender
) x group by x.gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Exit without Graduation' as services
from vw_cpims_registration where exit_status='ACTIVE'
AND cpims_ovc_id NOT IN
(select distinct(vw_cpims_registration.cpims_ovc_id)
from vw_cpims_two_quarters ) {cbos}
group by gender
'''
QUERIES['3B'] = '''
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, domain as services
from vw_cpims_list_served {ocbos} group by gender, domain
'''
QUERIES['3C'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'OVC Comprehensive' as services
from vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender
'''
QUERIES['3D'] = '''
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, cpara_score as services
from vw_cpims_benchmark_achieved
where (current_date - date_of_event) <= 400 {cbos}
group by gender, cpara_score
'''
QUERIES['3E'] = '''
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, service as services
from vw_cpims_list_served
where {odates} {cbos}
group by gender, service
order by dcount desc
'''
QUERIES['4A'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, 'Active' as services
from vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender, 'Current Case Plan' as services
from vw_cpims_case_plan where (current_date - date_of_event) <= 400 {cbos}
group by gender
UNION
Select count(distinct(cpims_ovc_id)) as dcount,
gender, 'Current CPARA' as services
from vw_cpims_cpara where (current_date - date_of_event) <= 400 {cbos}
group by gender
'''
QUERIES['4B'] = '''
Select count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, graduationpath as services
from vw_cpims_benchmark_achieved
where (current_date - date_of_event) <= 400 {cbos}
group by gender, graduationpath;
'''
| queries = {}
QUERIES['1A'] = '\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, agerange\nfrom vw_cpims_registration {ocbos} {oareas} {odate}\ngroup by gender, agerange\n'
QUERIES['1B'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id,\nCASE exit_status WHEN 'ACTIVE' THEN 'Active'\nELSE 'Exited' END AS active_status\nfrom vw_cpims_registration {ocbos} {oareas} {odate}\ngroup by gender, active_status\nUNION\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Ever Registered' AS active_status\nfrom vw_cpims_registration {ocbos} {oareas} {odate}\ngroup by gender\n"
QUERIES['1C'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, schoollevel as school_level\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}\ngroup by gender, schoollevel\n"
QUERIES['1D'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Active' as services\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}\ngroup by gender\nUNION\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Has Birth Certificate' as services\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand birthcert = 'HAS BIRTHCERT' {cbos} {areas} {fdate}\ngroup by gender\nUNION\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Has Disability' as services\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand ovcdisability = 'HAS DISABILITY' {cbos} {areas} {fdate}\ngroup by gender\nUNION\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'School Going' as services\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand schoollevel != 'Not in School' {cbos} {areas} {fdate}\ngroup by gender\n"
QUERIES['1E'] = "\nSelect count(distinct(cpims_ovc_id)) AS dcount,\ngender as sex_id,\nCASE\nwhen ovchivstatus='POSITIVE' THEN 'HIV Status +Ve'\nwhen ovchivstatus='NEGATIVE' THEN 'HIV Status -Ve'\nwhen ovchivstatus='NOT KNOWN' THEN 'HIV Status Unknown'\nwhen ovchivstatus='HIV Test Not Required' THEN 'HIV Test not Required'\nwhen ovchivstatus='HIV Referred For Testing' THEN 'HIV Referred For Testing'\nELSE 'Others' END AS hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} {areas} {fdate}\ngroup by gender, ovchivstatus\n"
QUERIES['1F'] = '\nSELECT count(cpims_ovc_id) as dcount,\ngender as sex_id, eligibility\nfrom vw_cpims_registration {ocbos} {oareas} {odate}\ngroup by gender, eligibility\n'
QUERIES['1G'] = "\nSELECT count(cpims_ovc_id) as dcount,\ngender as sex_id, exit_reason\nfrom vw_cpims_registration where exit_status = 'EXITED' {cbos} {areas} {fdate}\ngroup by gender, exit_reason order by count(cpims_ovc_id) desc\n"
QUERIES['1H'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'OVC Registration' as services\nfrom vw_cpims_registration where exit_status = 'ACTIVE' {cbos} {areas} {dates}\ngroup by gender\nUNION\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'OVC Exit' as services\nfrom vw_cpims_registration where exit_status = 'EXITED' {cbos} {areas} {dates}\ngroup by gender\n"
QUERIES['2A'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Active' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} {fdate}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) AS dcount,\ngender as sex_id, 'Positive' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand ovchivstatus='POSITIVE' {cbos} {fdate} group by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'On ART' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand ovchivstatus='POSITIVE' AND artstatus='ART' {cbos} {fdate}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'VL Accessed' as hivstat\nfrom vw_cpims_viral_load {ocbos}\ngroup by gender\nUNION\nSelect count(distinct(v.cpims_ovc_id)) as dcount,\nv.gender as sex_id, 'Current VL' as hivstat\nfrom vw_cpims_viral_load v\ninner join (\nselect cpims_ovc_id, max(date_of_event) as most_current_vl_date\nfrom vw_cpims_viral_load\ngroup by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id\nand v.date_of_event=vl.most_current_vl_date\nwhere current_date - vl.most_current_vl_date <= 400 {vcbos}\ngroup by v.gender\nUNION\nSelect count(distinct(v.cpims_ovc_id)) AS dcount,\nv.gender as sex_id, 'Suppressed' as hivstat\nfrom vw_cpims_viral_load v\ninner join (\nselect cpims_ovc_id, max(date_of_event) as most_current_vl_date\nfrom vw_cpims_viral_load\ngroup by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id\nand v.date_of_event=vl.most_current_vl_date\nwhere current_date - vl.most_current_vl_date <= 400\nand v.viral_load < 1001 {vcbos} group by v.gender\nUNION\nSelect count(distinct(v.cpims_ovc_id)) AS dcount,\nv.gender as sex_id, 'Not Suppressed' as hivstat\nfrom vw_cpims_viral_load v\ninner join (\nselect cpims_ovc_id, max(date_of_event) as most_current_vl_date\nfrom vw_cpims_viral_load\ngroup by cpims_ovc_id ) vl on v.cpims_ovc_id=vl.cpims_ovc_id\nand v.date_of_event=vl.most_current_vl_date\nwhere current_date - vl.most_current_vl_date <=400\nand v.viral_load > 1000 {vcbos}\ngroup by v.gender\n"
QUERIES['2B'] = '\nSelect count(distinct(cpims_ovc_id)) as dcount, gender as sex_id, agerange\nfrom vw_cpims_viral_load where (current_date - date_of_event) < 401\nand viral_load > 10000 {cbos} group by gender, agerange\n'
QUERIES['2C'] = "\nselect sum(x.cnt) as dcount, x.gender as sex_id,\n'OVC_SERV' as hivstat from\n(\nSelect count(distinct(cpims_ovc_id)) as cnt,\ngender from vw_cpims_active_beneficiary {ocbos}\ngroup by gender\nUNION ALL\nSelect count(distinct(cpims_ovc_id)), gender\nfrom vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400\nAND cpara_score = 17 {cbos} group by gender\n) x group by x.gender\nUNION\nSelect count(distinct(cpims_ovc_id)) AS dcount,\ngender as sex_id,\nCASE\nwhen ovchivstatus='POSITIVE' THEN 'HIV Status +Ve'\nwhen ovchivstatus='NEGATIVE' THEN 'HIV Status -Ve'\nwhen ovchivstatus='NOT KNOWN' THEN 'HIV Status Unknown'\nwhen ovchivstatus='HIV Test Not Required' THEN 'HIV Test not Required'\nwhen ovchivstatus='HIV Referred For Testing' THEN 'HIV Referred For Testing'\nELSE 'Others' END AS hivstat\nfrom vw_cpims_registration where cpims_ovc_id in\n(select distinct(x.cpims_ovc_id) from\n(\nSelect distinct(cpims_ovc_id)\nfrom vw_cpims_active_beneficiary {ocbos}\nUNION ALL\nSelect distinct(cpims_ovc_id)\nfrom vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400\nAND cpara_score = 17 {cbos}\n) x)\nand exit_status='ACTIVE' {cbos} {areas} {fdate}\ngroup by gender, ovchivstatus\n"
QUERIES['2D'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\n'Male' as sex_id, 'HIV Status' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos}\nUNION\nSelect count(distinct(cpims_ovc_id)) AS dcount,\n'Male' as sex_id, 'ART Status' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand ovchivstatus='POSITIVE' {cbos}\nUNION\nSelect count(distinct(v.cpims_ovc_id)) as dcount,\n'Male' as sex_id, 'Suppression' as hivstat\nfrom vw_cpims_viral_load v\ninner join (\nselect cpims_ovc_id, max(date_of_event) as most_current_vl_date\nfrom vw_cpims_viral_load\ngroup by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id\nand v.date_of_event=vl.most_current_vl_date\nwhere current_date - vl.most_current_vl_date <= 400 {vcbos}\nUNION\nSelect count(distinct(cpims_ovc_id)) AS dcount,\n'Female' as sex_id, 'HIV Status' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand (ovchivstatus='POSITIVE' or ovchivstatus='NEGATIVE'\nor ovchivstatus='NOT KNOWN' or ovchivstatus='HIV Test Not Required'\nor ovchivstatus='HIV Referred For Testing') {cbos}\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\n'Female' as sex_id, 'ART Status' as hivstat\nfrom vw_cpims_registration where exit_status='ACTIVE'\nand ovchivstatus='POSITIVE' AND artstatus='ART' {cbos}\nUNION\nSelect count(distinct(v.cpims_ovc_id)) AS dcount,\n'Female' as sex_id, 'Suppression' as hivstat\nfrom vw_cpims_viral_load v\ninner join (\nselect cpims_ovc_id, max(date_of_event) as most_current_vl_date\nfrom vw_cpims_viral_load\ngroup by cpims_ovc_id ) vl on v.cpims_ovc_id = vl.cpims_ovc_id\nand v.date_of_event=vl.most_current_vl_date\nwhere current_date - vl.most_current_vl_date <= 400\nand v.viral_load < 1001 {vcbos}\n"
QUERIES['3A'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Active' as services\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender\nUNION\nSelect count(distinct(person_id)) AS dcount,\ngender as sex_id, 'Served Two Quarters' as services\nfrom vw_cpims_two_quarters where (current_date - date_of_event) <=400 {cbos}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender, 'Case Plans' as services\nfrom vw_cpims_case_plan where (current_date - date_of_event) <= 400 {cbos}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender, 'CPARA' as services\nfrom vw_cpims_cpara where (current_date - date_of_event) <= 400 {cbos}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Graduated' as services\nfrom vw_cpims_benchmark_achieved\nwhere (current_date - date_of_event) <= 400\nAND cpara_score = 17 {cbos}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Active Beneficiary' as services\nfrom vw_cpims_active_beneficiary {ocbos}\ngroup by gender\nUNION\nselect sum(x.cnt) as dcount, x.gender as sex_id,\n'OVC_SERV' as hivstat from\n(\nSelect count(distinct(cpims_ovc_id)) as cnt,\ngender from vw_cpims_active_beneficiary {ocbos}\ngroup by gender\nUNION ALL\nSelect count(distinct(cpims_ovc_id)), gender\nfrom vw_cpims_benchmark_achieved where (current_date - date_of_event) <= 400\nAND cpara_score = 17 {cbos} group by gender\n) x group by x.gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Exit without Graduation' as services\nfrom vw_cpims_registration where exit_status='ACTIVE'\nAND cpims_ovc_id NOT IN\n(select distinct(vw_cpims_registration.cpims_ovc_id)\nfrom vw_cpims_two_quarters ) {cbos}\ngroup by gender\n"
QUERIES['3B'] = '\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, domain as services\nfrom vw_cpims_list_served {ocbos} group by gender, domain\n'
QUERIES['3C'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'OVC Comprehensive' as services\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender\n"
QUERIES['3D'] = '\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, cpara_score as services\nfrom vw_cpims_benchmark_achieved\nwhere (current_date - date_of_event) <= 400 {cbos}\ngroup by gender, cpara_score\n'
QUERIES['3E'] = '\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, service as services\nfrom vw_cpims_list_served\nwhere {odates} {cbos}\ngroup by gender, service\norder by dcount desc\n'
QUERIES['4A'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, 'Active' as services\nfrom vw_cpims_registration where exit_status='ACTIVE' {cbos} group by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender, 'Current Case Plan' as services\nfrom vw_cpims_case_plan where (current_date - date_of_event) <= 400 {cbos}\ngroup by gender\nUNION\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender, 'Current CPARA' as services\nfrom vw_cpims_cpara where (current_date - date_of_event) <= 400 {cbos}\ngroup by gender\n"
QUERIES['4B'] = '\nSelect count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, graduationpath as services\nfrom vw_cpims_benchmark_achieved\nwhere (current_date - date_of_event) <= 400 {cbos}\ngroup by gender, graduationpath;\n' |
def countingSort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
index = array[i] // place
output[count[index % 10] - 1] = array[i]
count[index % 10] -= 1
i -= 1
for i in range(0, size):
array[i] = output[i]
def radixSort(array):
max_element = max(array)
place = 1
while max_element // place > 0:
countingSort(array, place)
place *= 10
alist = input('Enter the list of (nonnegative) numbers: ').split()
data = [int(x) for x in alist]
radixSort(data)
print(data)
| def counting_sort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
index = array[i] // place
output[count[index % 10] - 1] = array[i]
count[index % 10] -= 1
i -= 1
for i in range(0, size):
array[i] = output[i]
def radix_sort(array):
max_element = max(array)
place = 1
while max_element // place > 0:
counting_sort(array, place)
place *= 10
alist = input('Enter the list of (nonnegative) numbers: ').split()
data = [int(x) for x in alist]
radix_sort(data)
print(data) |
'''
Created on Dec 2, 2013
@author: daniel
'''
class PharmacyController(object):
def __init__(self, repository):
self.__pRepo = repository
# cart is used to keep track of all the products
self.__cart = []
self.__cartTotal = 0
def addProductToCart(self, product, qty):
"""
Add a product to cart
Input:
product - instance of type product
qty - int - representing the quantity
Output:
"""
# we will store them as list of tuples [(product_instance, qty)]
self.__cart.append((product, qty))
self.__cartTotal += int(product.getPrice()) * int(qty)
def filterByName(self, name):
"""
Search a product by name and return the closest matching
Input:
name - string - the name of the product
Output:
list - a list of products instances
"""
return_list = []
name = name.lower()
for product in self.__pRepo.getAll():
if name in product.getName().lower():
return_list.append(product)
return return_list
def getProductsInCart(self):
"""
Get the products
Input:
Output:
a list of tuples in the format [(product, qty)]
"""
return self.__cart
def getCartTotal(self):
"""
Get the car total
Input:
Output:
int - representing the total
"""
return self.__cartTotal
def newCart(self):
"""
Init a new cart
"""
self.__cart = []
| """
Created on Dec 2, 2013
@author: daniel
"""
class Pharmacycontroller(object):
def __init__(self, repository):
self.__pRepo = repository
self.__cart = []
self.__cartTotal = 0
def add_product_to_cart(self, product, qty):
"""
Add a product to cart
Input:
product - instance of type product
qty - int - representing the quantity
Output:
"""
self.__cart.append((product, qty))
self.__cartTotal += int(product.getPrice()) * int(qty)
def filter_by_name(self, name):
"""
Search a product by name and return the closest matching
Input:
name - string - the name of the product
Output:
list - a list of products instances
"""
return_list = []
name = name.lower()
for product in self.__pRepo.getAll():
if name in product.getName().lower():
return_list.append(product)
return return_list
def get_products_in_cart(self):
"""
Get the products
Input:
Output:
a list of tuples in the format [(product, qty)]
"""
return self.__cart
def get_cart_total(self):
"""
Get the car total
Input:
Output:
int - representing the total
"""
return self.__cartTotal
def new_cart(self):
"""
Init a new cart
"""
self.__cart = [] |
#######################################################################################
# 2.1
# change what is stored in the variables to another types of data
# if a variable stores a string, change it to an int, or a boolean, or a float
some_var = "hi"
some_var2 = 1
some_var3 = True
some_var4 = 1.32
#######################################################################################
# 2.2
# using the variables a, b, c, and d, print out the number 5
# use a combonation of +, -, *, /
# ex. print(a + b - c * d) -> this is not the answer
a = 10
b = 2
c = 3
d = 12
#######################################################################################
# 2.3
# create 2 variables with 1 holding your first name and 1 holding your last name
# add them together with a space so it prints nicely
# ex. print("Ben" + " " + "Campbell") -> "Ben Campbell"
#######################################################################################
# 2.4
# Make 2 variables. 1 Variable will be a string and the other will be a number. Then
# add them together and print them out.
#######################################################################################
# 2.5
# Make 1 variable. Make another variable and set it equal to the other variable. Then
# print out the second variable to see what is stored.
#######################################################################################
# 2.6
# Make a math equation with at least a +, -, /, * and (). Store this equation in a
# variable and then print out what is stored in the variable.
#######################################################################################
# 2.7
# Create string, int, double, and boolean variables. Then print them all out.
| some_var = 'hi'
some_var2 = 1
some_var3 = True
some_var4 = 1.32
a = 10
b = 2
c = 3
d = 12 |
load("@build_bazel_integration_testing//tools:import.bzl", "bazel_external_dependency_archive")
def bazel_external_dependencies(rules_scala_version, rules_scala_version_sha256):
bazel_external_dependency_archive(
name = "io_bazel_rules_scala_test",
srcs = {
rules_scala_version_sha256: [
"https://github.com/wix/rules_scala/archive/%s.zip" % rules_scala_version,
],
"3023b07cc02f2b0217b2c04f8e636b396130b3a8544a8dfad498a19c3e57a863": [
"https://repo.maven.apache.org/maven2/org/scala-lang/scala-compiler/2.12.6/scala-compiler-2.12.6.jar"
],
"f81d7144f0ce1b8123335b72ba39003c4be2870767aca15dd0888ba3dab65e98": [
"https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.6/scala-library-2.12.6.jar"
],
"ffa70d522fc9f9deec14358aa674e6dd75c9dfa39d4668ef15bb52f002ce99fa": [
"https://repo.maven.apache.org/maven2/org/scala-lang/scala-reflect/2.12.6/scala-reflect-2.12.6.jar"
],
"b416b5bcef6720da469a8d8a5726e457fc2d1cd5d316e1bc283aa75a2ae005e5": [
"http://central.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.5/scalatest_2.12-3.0.5.jar"
],
"57e25b4fd969b1758fe042595112c874dfea99dca5cc48eebe07ac38772a0c41": [
"http://central.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.5/scalactic_2.12-3.0.5.jar"
],
"f877d304660ac2a142f3865badfc971dec7ed73c747c7f8d5d2f5139ca736513": [
"http://central.maven.org/maven2/commons/io/commons-io/2.6/commons-io-2.6.jar"
],
"8d7ec605ca105747653e002bfe67bddba90ab964da697aaa5daa1060923585db": [
"http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.1.0/protobuf-java-3.1.0.jar"
],
"39097bdc47407232e0fe7eed4f2c175c067b7eda95873cb76ffa76f1b4c18895": [
"https://mirror.bazel.build/raw.githubusercontent.com/bazelbuild/bazel/0.17.1" +
"/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt"
],
}
)
bazel_external_dependency_archive(
name = "com_google_guava_guava_test",
srcs = {
"36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8": [
"http://central.maven.org/maven2/com/google/guava/guava/20.0/guava-20.0.jar",
],
}
)
bazel_external_dependency_archive(
name = "bazel_toolchains_test",
srcs = {
"f08758b646beea3b37dc9e07d63020cecd5f9d29f42de1cd60e9325e047c7103": [
"https://github.com/bazelbuild/bazel-toolchains/archive/719f8035a20997289727e16693acdebc8e918e28.tar.gz",
],
}
)
| load('@build_bazel_integration_testing//tools:import.bzl', 'bazel_external_dependency_archive')
def bazel_external_dependencies(rules_scala_version, rules_scala_version_sha256):
bazel_external_dependency_archive(name='io_bazel_rules_scala_test', srcs={rules_scala_version_sha256: ['https://github.com/wix/rules_scala/archive/%s.zip' % rules_scala_version], '3023b07cc02f2b0217b2c04f8e636b396130b3a8544a8dfad498a19c3e57a863': ['https://repo.maven.apache.org/maven2/org/scala-lang/scala-compiler/2.12.6/scala-compiler-2.12.6.jar'], 'f81d7144f0ce1b8123335b72ba39003c4be2870767aca15dd0888ba3dab65e98': ['https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.6/scala-library-2.12.6.jar'], 'ffa70d522fc9f9deec14358aa674e6dd75c9dfa39d4668ef15bb52f002ce99fa': ['https://repo.maven.apache.org/maven2/org/scala-lang/scala-reflect/2.12.6/scala-reflect-2.12.6.jar'], 'b416b5bcef6720da469a8d8a5726e457fc2d1cd5d316e1bc283aa75a2ae005e5': ['http://central.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.5/scalatest_2.12-3.0.5.jar'], '57e25b4fd969b1758fe042595112c874dfea99dca5cc48eebe07ac38772a0c41': ['http://central.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.5/scalactic_2.12-3.0.5.jar'], 'f877d304660ac2a142f3865badfc971dec7ed73c747c7f8d5d2f5139ca736513': ['http://central.maven.org/maven2/commons/io/commons-io/2.6/commons-io-2.6.jar'], '8d7ec605ca105747653e002bfe67bddba90ab964da697aaa5daa1060923585db': ['http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.1.0/protobuf-java-3.1.0.jar'], '39097bdc47407232e0fe7eed4f2c175c067b7eda95873cb76ffa76f1b4c18895': ['https://mirror.bazel.build/raw.githubusercontent.com/bazelbuild/bazel/0.17.1' + '/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt']})
bazel_external_dependency_archive(name='com_google_guava_guava_test', srcs={'36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8': ['http://central.maven.org/maven2/com/google/guava/guava/20.0/guava-20.0.jar']})
bazel_external_dependency_archive(name='bazel_toolchains_test', srcs={'f08758b646beea3b37dc9e07d63020cecd5f9d29f42de1cd60e9325e047c7103': ['https://github.com/bazelbuild/bazel-toolchains/archive/719f8035a20997289727e16693acdebc8e918e28.tar.gz']}) |
class Line:
pic = None
color = -1
def __init__(self, pic, color):
self.pic = pic
self.color = color
def oct1(self, x0, y0, x1, y1):
if (x0 > x1):
x0, y0, x1, y1 = x1, y1, x0, y0
x = x0
y = y0
A = y1 - y0
B = x0 - x1
d = 2 * A + B
while (x <= x1):
self.pic.set(x, y, self.color)
if (d > 0):
y += 1
d += 2 * B
x += 1
d += 2 * A
def oct2(self, x0, y0, x1, y1):
if (y0 > y1):
x0, y0, x1, y1 = x1, y1, x0, y0
x = x0
y = y0
A = y1 - y0
B = x0 - x1
d = A + 2 * B
while (y <= y1):
self.pic.set(x, y, self.color)
if (d < 0):
x += 1
d += 2 * A
y += 1
d += 2 * B
def oct7(self, x0, y0, x1, y1):
if (y1 > y0):
x0, y0, x1, y1 = x1, y1, x0, y0
x = x0
y = y0
A = y1 - y0
B = x0 - x1
d = A - 2 * B
while (y >= y1):
self.pic.set(x, y, self.color)
if (d > 0):
x += 1
d += 2 * A
y -= 1
d -= 2 * B
def oct8(self, x0, y0, x1, y1):
if (x0 > x1):
x0, y0, x1, y1 = x1, y1, x0, y0
x = x0
y = y0
A = y1 - y0
B = x0 - x1
d = 2 * A - B
while (x <= x1):
self.pic.set(x, y, self.color)
if (d < 0):
y -= 1
d -= 2 * B
x += 1
d += 2 * A
def draw(self, x0, y0, x1, y1):
try:
m = (y1 - y0) / (x1 - x0)
except ZeroDivisionError:
m = 2
if (1 <= m):
self.oct2(x0, y0, x1, y1)
elif (0 <= m < 1):
self.oct1(x0, y0, x1, y1)
elif (-1 <= m < 0):
self.oct8(x0, y0, x1, y1)
else:
self.oct7(x0, y0, x1, y1)
def draw(self, matrix):
matrix = matrix.getContent()
for i in range(matrix.getEdges()):
self.draw(matrix[0][2 * i], matrix[1][2 * i], matrix[0][2 * i + 1], matrix[1][2 * i + 1])
| class Line:
pic = None
color = -1
def __init__(self, pic, color):
self.pic = pic
self.color = color
def oct1(self, x0, y0, x1, y1):
if x0 > x1:
(x0, y0, x1, y1) = (x1, y1, x0, y0)
x = x0
y = y0
a = y1 - y0
b = x0 - x1
d = 2 * A + B
while x <= x1:
self.pic.set(x, y, self.color)
if d > 0:
y += 1
d += 2 * B
x += 1
d += 2 * A
def oct2(self, x0, y0, x1, y1):
if y0 > y1:
(x0, y0, x1, y1) = (x1, y1, x0, y0)
x = x0
y = y0
a = y1 - y0
b = x0 - x1
d = A + 2 * B
while y <= y1:
self.pic.set(x, y, self.color)
if d < 0:
x += 1
d += 2 * A
y += 1
d += 2 * B
def oct7(self, x0, y0, x1, y1):
if y1 > y0:
(x0, y0, x1, y1) = (x1, y1, x0, y0)
x = x0
y = y0
a = y1 - y0
b = x0 - x1
d = A - 2 * B
while y >= y1:
self.pic.set(x, y, self.color)
if d > 0:
x += 1
d += 2 * A
y -= 1
d -= 2 * B
def oct8(self, x0, y0, x1, y1):
if x0 > x1:
(x0, y0, x1, y1) = (x1, y1, x0, y0)
x = x0
y = y0
a = y1 - y0
b = x0 - x1
d = 2 * A - B
while x <= x1:
self.pic.set(x, y, self.color)
if d < 0:
y -= 1
d -= 2 * B
x += 1
d += 2 * A
def draw(self, x0, y0, x1, y1):
try:
m = (y1 - y0) / (x1 - x0)
except ZeroDivisionError:
m = 2
if 1 <= m:
self.oct2(x0, y0, x1, y1)
elif 0 <= m < 1:
self.oct1(x0, y0, x1, y1)
elif -1 <= m < 0:
self.oct8(x0, y0, x1, y1)
else:
self.oct7(x0, y0, x1, y1)
def draw(self, matrix):
matrix = matrix.getContent()
for i in range(matrix.getEdges()):
self.draw(matrix[0][2 * i], matrix[1][2 * i], matrix[0][2 * i + 1], matrix[1][2 * i + 1]) |
def test_signal_url_total_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url("url_total_length", url)
rank_long = rank("http://www.verrrryyyylongdomain.com/very-long-url-xxxxxxxxxxxxxx.html")
rank_short = rank("https://en.wikipedia.org/wiki/Maceo_Parker")
rank_min = rank("http://t.co")
assert 0 <= rank_long < rank_short < rank_min <= 1
def test_signal_url_path_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url("url_path_length", url)
rank_hp = rank("http://www.longdomain.com")
rank_hp2 = rank("http://www.domain.com/")
assert rank_hp == rank_hp2
rank_subpage = rank("http://t.co/p")
assert rank_subpage < rank_hp
rank_subpage_query = rank("http://t.co/p?q=1")
assert rank_subpage_query < rank_subpage
| def test_signal_url_total_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url('url_total_length', url)
rank_long = rank('http://www.verrrryyyylongdomain.com/very-long-url-xxxxxxxxxxxxxx.html')
rank_short = rank('https://en.wikipedia.org/wiki/Maceo_Parker')
rank_min = rank('http://t.co')
assert 0 <= rank_long < rank_short < rank_min <= 1
def test_signal_url_path_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url('url_path_length', url)
rank_hp = rank('http://www.longdomain.com')
rank_hp2 = rank('http://www.domain.com/')
assert rank_hp == rank_hp2
rank_subpage = rank('http://t.co/p')
assert rank_subpage < rank_hp
rank_subpage_query = rank('http://t.co/p?q=1')
assert rank_subpage_query < rank_subpage |
terms=int(input("Enter the number of terms:"))
a, b= 0, 1
count=0
if terms <= 0:
print("Please enter a positive number")
elif terms == 1:
print("The fibonacci series upto",terms)
print(a)
else:
print("The fabinocci series upto",terms,"terms is:")
while count < terms:
print(a, end=" ")
c=a+b
a=b
b=c
count+=1
| terms = int(input('Enter the number of terms:'))
(a, b) = (0, 1)
count = 0
if terms <= 0:
print('Please enter a positive number')
elif terms == 1:
print('The fibonacci series upto', terms)
print(a)
else:
print('The fabinocci series upto', terms, 'terms is:')
while count < terms:
print(a, end=' ')
c = a + b
a = b
b = c
count += 1 |
OV2640_JPEG_INIT = [
[ 0xff, 0x00 ],
[ 0x2c, 0xff ],
[ 0x2e, 0xdf ],
[ 0xff, 0x01 ],
[ 0x3c, 0x32 ],
[ 0x11, 0x04 ],
[ 0x09, 0x02 ],
[ 0x04, 0x28 ],
[ 0x13, 0xe5 ],
[ 0x14, 0x48 ],
[ 0x2c, 0x0c ],
[ 0x33, 0x78 ],
[ 0x3a, 0x33 ],
[ 0x3b, 0xfB ],
[ 0x3e, 0x00 ],
[ 0x43, 0x11 ],
[ 0x16, 0x10 ],
[ 0x39, 0x92 ],
[ 0x35, 0xda ],
[ 0x22, 0x1a ],
[ 0x37, 0xc3 ],
[ 0x23, 0x00 ],
[ 0x34, 0xc0 ],
[ 0x36, 0x1a ],
[ 0x06, 0x88 ],
[ 0x07, 0xc0 ],
[ 0x0d, 0x87 ],
[ 0x0e, 0x41 ],
[ 0x4c, 0x00 ],
[ 0x48, 0x00 ],
[ 0x5B, 0x00 ],
[ 0x42, 0x03 ],
[ 0x4a, 0x81 ],
[ 0x21, 0x99 ],
[ 0x24, 0x40 ],
[ 0x25, 0x38 ],
[ 0x26, 0x82 ],
[ 0x5c, 0x00 ],
[ 0x63, 0x00 ],
[ 0x61, 0x70 ],
[ 0x62, 0x80 ],
[ 0x7c, 0x05 ],
[ 0x20, 0x80 ],
[ 0x28, 0x30 ],
[ 0x6c, 0x00 ],
[ 0x6d, 0x80 ],
[ 0x6e, 0x00 ],
[ 0x70, 0x02 ],
[ 0x71, 0x94 ],
[ 0x73, 0xc1 ],
[ 0x12, 0x40 ],
[ 0x17, 0x11 ],
[ 0x18, 0x43 ],
[ 0x19, 0x00 ],
[ 0x1a, 0x4b ],
[ 0x32, 0x09 ],
[ 0x37, 0xc0 ],
[ 0x4f, 0x60 ],
[ 0x50, 0xa8 ],
[ 0x6d, 0x00 ],
[ 0x3d, 0x38 ],
[ 0x46, 0x3f ],
[ 0x4f, 0x60 ],
[ 0x0c, 0x3c ],
[ 0xff, 0x00 ],
[ 0xe5, 0x7f ],
[ 0xf9, 0xc0 ],
[ 0x41, 0x24 ],
[ 0xe0, 0x14 ],
[ 0x76, 0xff ],
[ 0x33, 0xa0 ],
[ 0x42, 0x20 ],
[ 0x43, 0x18 ],
[ 0x4c, 0x00 ],
[ 0x87, 0xd5 ],
[ 0x88, 0x3f ],
[ 0xd7, 0x03 ],
[ 0xd9, 0x10 ],
[ 0xd3, 0x82 ],
[ 0xc8, 0x08 ],
[ 0xc9, 0x80 ],
[ 0x7c, 0x00 ],
[ 0x7d, 0x00 ],
[ 0x7c, 0x03 ],
[ 0x7d, 0x48 ],
[ 0x7d, 0x48 ],
[ 0x7c, 0x08 ],
[ 0x7d, 0x20 ],
[ 0x7d, 0x10 ],
[ 0x7d, 0x0e ],
[ 0x90, 0x00 ],
[ 0x91, 0x0e ],
[ 0x91, 0x1a ],
[ 0x91, 0x31 ],
[ 0x91, 0x5a ],
[ 0x91, 0x69 ],
[ 0x91, 0x75 ],
[ 0x91, 0x7e ],
[ 0x91, 0x88 ],
[ 0x91, 0x8f ],
[ 0x91, 0x96 ],
[ 0x91, 0xa3 ],
[ 0x91, 0xaf ],
[ 0x91, 0xc4 ],
[ 0x91, 0xd7 ],
[ 0x91, 0xe8 ],
[ 0x91, 0x20 ],
[ 0x92, 0x00 ],
[ 0x93, 0x06 ],
[ 0x93, 0xe3 ],
[ 0x93, 0x05 ],
[ 0x93, 0x05 ],
[ 0x93, 0x00 ],
[ 0x93, 0x04 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x93, 0x00 ],
[ 0x96, 0x00 ],
[ 0x97, 0x08 ],
[ 0x97, 0x19 ],
[ 0x97, 0x02 ],
[ 0x97, 0x0c ],
[ 0x97, 0x24 ],
[ 0x97, 0x30 ],
[ 0x97, 0x28 ],
[ 0x97, 0x26 ],
[ 0x97, 0x02 ],
[ 0x97, 0x98 ],
[ 0x97, 0x80 ],
[ 0x97, 0x00 ],
[ 0x97, 0x00 ],
[ 0xc3, 0xed ],
[ 0xa4, 0x00 ],
[ 0xa8, 0x00 ],
[ 0xc5, 0x11 ],
[ 0xc6, 0x51 ],
[ 0xbf, 0x80 ],
[ 0xc7, 0x10 ],
[ 0xb6, 0x66 ],
[ 0xb8, 0xA5 ],
[ 0xb7, 0x64 ],
[ 0xb9, 0x7C ],
[ 0xb3, 0xaf ],
[ 0xb4, 0x97 ],
[ 0xb5, 0xFF ],
[ 0xb0, 0xC5 ],
[ 0xb1, 0x94 ],
[ 0xb2, 0x0f ],
[ 0xc4, 0x5c ],
[ 0xc0, 0x64 ],
[ 0xc1, 0x4B ],
[ 0x8c, 0x00 ],
[ 0x86, 0x3D ],
[ 0x50, 0x00 ],
[ 0x51, 0xC8 ],
[ 0x52, 0x96 ],
[ 0x53, 0x00 ],
[ 0x54, 0x00 ],
[ 0x55, 0x00 ],
[ 0x5a, 0xC8 ],
[ 0x5b, 0x96 ],
[ 0x5c, 0x00 ],
[ 0xd3, 0x00 ],
[ 0xc3, 0xed ],
[ 0x7f, 0x00 ],
[ 0xda, 0x00 ],
[ 0xe5, 0x1f ],
[ 0xe1, 0x67 ],
[ 0xe0, 0x00 ],
[ 0xdd, 0x7f ],
[ 0x05, 0x00 ],
[ 0x12, 0x40 ],
[ 0xd3, 0x04 ],
[ 0xc0, 0x16 ],
[ 0xC1, 0x12 ],
[ 0x8c, 0x00 ],
[ 0x86, 0x3d ],
[ 0x50, 0x00 ],
[ 0x51, 0x2C ],
[ 0x52, 0x24 ],
[ 0x53, 0x00 ],
[ 0x54, 0x00 ],
[ 0x55, 0x00 ],
[ 0x5A, 0x2c ],
[ 0x5b, 0x24 ],
[ 0x5c, 0x00 ],
[ 0xff, 0xff ],
]
OV2640_YUV422 = [
[ 0xFF, 0x00 ],
[ 0x05, 0x00 ],
[ 0xDA, 0x10 ],
[ 0xD7, 0x03 ],
[ 0xDF, 0x00 ],
[ 0x33, 0x80 ],
[ 0x3C, 0x40 ],
[ 0xe1, 0x77 ],
[ 0x00, 0x00 ],
[ 0xff, 0xff ],
]
OV2640_JPEG = [
[ 0xe0, 0x14 ],
[ 0xe1, 0x77 ],
[ 0xe5, 0x1f ],
[ 0xd7, 0x03 ],
[ 0xda, 0x10 ],
[ 0xe0, 0x00 ],
[ 0xFF, 0x01 ],
[ 0x04, 0x08 ],
[ 0xff, 0xff ],
]
SENSORADDR = 0x30
PICBUFSIZE = 64
| ov2640_jpeg_init = [[255, 0], [44, 255], [46, 223], [255, 1], [60, 50], [17, 4], [9, 2], [4, 40], [19, 229], [20, 72], [44, 12], [51, 120], [58, 51], [59, 251], [62, 0], [67, 17], [22, 16], [57, 146], [53, 218], [34, 26], [55, 195], [35, 0], [52, 192], [54, 26], [6, 136], [7, 192], [13, 135], [14, 65], [76, 0], [72, 0], [91, 0], [66, 3], [74, 129], [33, 153], [36, 64], [37, 56], [38, 130], [92, 0], [99, 0], [97, 112], [98, 128], [124, 5], [32, 128], [40, 48], [108, 0], [109, 128], [110, 0], [112, 2], [113, 148], [115, 193], [18, 64], [23, 17], [24, 67], [25, 0], [26, 75], [50, 9], [55, 192], [79, 96], [80, 168], [109, 0], [61, 56], [70, 63], [79, 96], [12, 60], [255, 0], [229, 127], [249, 192], [65, 36], [224, 20], [118, 255], [51, 160], [66, 32], [67, 24], [76, 0], [135, 213], [136, 63], [215, 3], [217, 16], [211, 130], [200, 8], [201, 128], [124, 0], [125, 0], [124, 3], [125, 72], [125, 72], [124, 8], [125, 32], [125, 16], [125, 14], [144, 0], [145, 14], [145, 26], [145, 49], [145, 90], [145, 105], [145, 117], [145, 126], [145, 136], [145, 143], [145, 150], [145, 163], [145, 175], [145, 196], [145, 215], [145, 232], [145, 32], [146, 0], [147, 6], [147, 227], [147, 5], [147, 5], [147, 0], [147, 4], [147, 0], [147, 0], [147, 0], [147, 0], [147, 0], [147, 0], [147, 0], [150, 0], [151, 8], [151, 25], [151, 2], [151, 12], [151, 36], [151, 48], [151, 40], [151, 38], [151, 2], [151, 152], [151, 128], [151, 0], [151, 0], [195, 237], [164, 0], [168, 0], [197, 17], [198, 81], [191, 128], [199, 16], [182, 102], [184, 165], [183, 100], [185, 124], [179, 175], [180, 151], [181, 255], [176, 197], [177, 148], [178, 15], [196, 92], [192, 100], [193, 75], [140, 0], [134, 61], [80, 0], [81, 200], [82, 150], [83, 0], [84, 0], [85, 0], [90, 200], [91, 150], [92, 0], [211, 0], [195, 237], [127, 0], [218, 0], [229, 31], [225, 103], [224, 0], [221, 127], [5, 0], [18, 64], [211, 4], [192, 22], [193, 18], [140, 0], [134, 61], [80, 0], [81, 44], [82, 36], [83, 0], [84, 0], [85, 0], [90, 44], [91, 36], [92, 0], [255, 255]]
ov2640_yuv422 = [[255, 0], [5, 0], [218, 16], [215, 3], [223, 0], [51, 128], [60, 64], [225, 119], [0, 0], [255, 255]]
ov2640_jpeg = [[224, 20], [225, 119], [229, 31], [215, 3], [218, 16], [224, 0], [255, 1], [4, 8], [255, 255]]
sensoraddr = 48
picbufsize = 64 |
class Parent:
value1="This is value 1"
value2="This is value 2"
class Child(Parent):
pass
parent=Parent()
child=Child()
print(parent.value1)
print(child.value2)
| class Parent:
value1 = 'This is value 1'
value2 = 'This is value 2'
class Child(Parent):
pass
parent = parent()
child = child()
print(parent.value1)
print(child.value2) |
begin_unit
comment|'# Copyright (c) 2016 Intel, Inc.'
nl|'\n'
comment|'# Copyright (c) 2013 OpenStack Foundation'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
name|'from'
name|'oslo_config'
name|'import'
name|'cfg'
newline|'\n'
nl|'\n'
DECL|variable|debugger_group
name|'debugger_group'
op|'='
name|'cfg'
op|'.'
name|'OptGroup'
op|'('
string|"'remote_debug'"
op|','
nl|'\n'
DECL|variable|title
name|'title'
op|'='
string|"'debugger options'"
op|')'
newline|'\n'
nl|'\n'
DECL|variable|host
name|'host'
op|'='
name|'cfg'
op|'.'
name|'StrOpt'
op|'('
string|"'host'"
op|','
nl|'\n'
DECL|variable|help
name|'help'
op|'='
string|"'Debug host (IP or name) to connect. Note '"
nl|'\n'
string|"'that using the remote debug option changes how '"
nl|'\n'
string|"'Nova uses the eventlet library to support async IO. '"
nl|'\n'
string|"'This could result in failures that do not occur '"
nl|'\n'
string|"'under normal operation. Use at your own risk.'"
op|')'
newline|'\n'
nl|'\n'
DECL|variable|port
name|'port'
op|'='
name|'cfg'
op|'.'
name|'IntOpt'
op|'('
string|"'port'"
op|','
nl|'\n'
DECL|variable|min
name|'min'
op|'='
number|'1'
op|','
nl|'\n'
DECL|variable|max
name|'max'
op|'='
number|'65535'
op|','
nl|'\n'
DECL|variable|help
name|'help'
op|'='
string|"'Debug port to connect. Note '"
nl|'\n'
string|"'that using the remote debug option changes how '"
nl|'\n'
string|"'Nova uses the eventlet library to support async IO. '"
nl|'\n'
string|"'This could result in failures that do not occur '"
nl|'\n'
string|"'under normal operation. Use at your own risk.'"
op|')'
newline|'\n'
nl|'\n'
DECL|variable|CLI_OPTS
name|'CLI_OPTS'
op|'='
op|'['
name|'host'
op|','
name|'port'
op|']'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|register_cli_opts
name|'def'
name|'register_cli_opts'
op|'('
name|'conf'
op|')'
op|':'
newline|'\n'
indent|' '
name|'conf'
op|'.'
name|'register_cli_opts'
op|'('
name|'CLI_OPTS'
op|','
name|'group'
op|'='
name|'debugger_group'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|list_opts
dedent|''
name|'def'
name|'list_opts'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
op|'{'
name|'debugger_group'
op|':'
name|'CLI_OPTS'
op|'}'
newline|'\n'
dedent|''
endmarker|''
end_unit
| begin_unit
comment | '# Copyright (c) 2016 Intel, Inc.'
nl | '\n'
comment | '# Copyright (c) 2013 OpenStack Foundation'
nl | '\n'
comment | '# All Rights Reserved.'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl | '\n'
comment | '# not use this file except in compliance with the License. You may obtain'
nl | '\n'
comment | '# a copy of the License at'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# http://www.apache.org/licenses/LICENSE-2.0'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# Unless required by applicable law or agreed to in writing, software'
nl | '\n'
comment | '# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl | '\n'
comment | '# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl | '\n'
comment | '# License for the specific language governing permissions and limitations'
nl | '\n'
comment | '# under the License.'
nl | '\n'
nl | '\n'
name | 'from'
name | 'oslo_config'
name | 'import'
name | 'cfg'
newline | '\n'
nl | '\n'
DECL | variable | debugger_group
name | 'debugger_group'
op | '='
name | 'cfg'
op | '.'
name | 'OptGroup'
op | '('
string | "'remote_debug'"
op | ','
nl | '\n'
DECL | variable | title
name | 'title'
op | '='
string | "'debugger options'"
op | ')'
newline | '\n'
nl | '\n'
DECL | variable | host
name | 'host'
op | '='
name | 'cfg'
op | '.'
name | 'StrOpt'
op | '('
string | "'host'"
op | ','
nl | '\n'
DECL | variable | help
name | 'help'
op | '='
string | "'Debug host (IP or name) to connect. Note '"
nl | '\n'
string | "'that using the remote debug option changes how '"
nl | '\n'
string | "'Nova uses the eventlet library to support async IO. '"
nl | '\n'
string | "'This could result in failures that do not occur '"
nl | '\n'
string | "'under normal operation. Use at your own risk.'"
op | ')'
newline | '\n'
nl | '\n'
DECL | variable | port
name | 'port'
op | '='
name | 'cfg'
op | '.'
name | 'IntOpt'
op | '('
string | "'port'"
op | ','
nl | '\n'
DECL | variable | min
name | 'min'
op | '='
number | '1'
op | ','
nl | '\n'
DECL | variable | max
name | 'max'
op | '='
number | '65535'
op | ','
nl | '\n'
DECL | variable | help
name | 'help'
op | '='
string | "'Debug port to connect. Note '"
nl | '\n'
string | "'that using the remote debug option changes how '"
nl | '\n'
string | "'Nova uses the eventlet library to support async IO. '"
nl | '\n'
string | "'This could result in failures that do not occur '"
nl | '\n'
string | "'under normal operation. Use at your own risk.'"
op | ')'
newline | '\n'
nl | '\n'
DECL | variable | CLI_OPTS
name | 'CLI_OPTS'
op | '='
op | '['
name | 'host'
op | ','
name | 'port'
op | ']'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | register_cli_opts
name | 'def'
name | 'register_cli_opts'
op | '('
name | 'conf'
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'conf'
op | '.'
name | 'register_cli_opts'
op | '('
name | 'CLI_OPTS'
op | ','
name | 'group'
op | '='
name | 'debugger_group'
op | ')'
newline | '\n'
nl | '\n'
nl | '\n'
DECL | function | list_opts
dedent | ''
name | 'def'
name | 'list_opts'
op | '('
op | ')'
op | ':'
newline | '\n'
indent | ' '
name | 'return'
op | '{'
name | 'debugger_group'
op | ':'
name | 'CLI_OPTS'
op | '}'
newline | '\n'
dedent | ''
endmarker | ''
end_unit |
class Frame:
__slots__ = ("name", "class_name", "line_no", "file_path")
def __init__(self, name, class_name=None, line_no=None, file_path=None):
self.name = name
self.class_name = class_name
self.line_no = line_no
self.file_path = file_path
| class Frame:
__slots__ = ('name', 'class_name', 'line_no', 'file_path')
def __init__(self, name, class_name=None, line_no=None, file_path=None):
self.name = name
self.class_name = class_name
self.line_no = line_no
self.file_path = file_path |
# 6.Input and Range
# Given an integer n, write a program that generates a dictionary with
# entries from 1 to n. For each key i, the corresponding value should
# be i*i.
def range_dict(_max):
my_dict = {}
for i in range(1, _max + 1):
my_dict[i] = i ** 2
return my_dict
# or with dictionary Comprehension
def range_dict2(_max):
return {i: i ** 2 for i in range(1, _max + 1)}
print(range_dict(10))
print(range_dict2(10))
# for n=10:
# {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100}
| def range_dict(_max):
my_dict = {}
for i in range(1, _max + 1):
my_dict[i] = i ** 2
return my_dict
def range_dict2(_max):
return {i: i ** 2 for i in range(1, _max + 1)}
print(range_dict(10))
print(range_dict2(10)) |
# Holds permission data for a private race room
def get_permission_info(server, race_private_info):
permission_info = PermissionInfo()
for admin_name in race_private_info.admin_names:
for role in server.roles:
if role.name.lower() == admin_name.lower():
permission_info.admin_roles.append(role)
for member in server.members:
if member.name.lower() == admin_name.lower():
permission_info.admins.append(member)
for racer_name in race_private_info.racer_names:
for member in server.members:
if member.name.lower() == racer_name.lower():
permission_info.racers.append(member)
return permission_info
class PermissionInfo(object):
def __init__(self):
self.admins = []
self.admin_roles = []
self.racers = []
def is_admin(self, member):
for role in member.roles:
if role in self.admin_roles:
return True
return member in self.admins
| def get_permission_info(server, race_private_info):
permission_info = permission_info()
for admin_name in race_private_info.admin_names:
for role in server.roles:
if role.name.lower() == admin_name.lower():
permission_info.admin_roles.append(role)
for member in server.members:
if member.name.lower() == admin_name.lower():
permission_info.admins.append(member)
for racer_name in race_private_info.racer_names:
for member in server.members:
if member.name.lower() == racer_name.lower():
permission_info.racers.append(member)
return permission_info
class Permissioninfo(object):
def __init__(self):
self.admins = []
self.admin_roles = []
self.racers = []
def is_admin(self, member):
for role in member.roles:
if role in self.admin_roles:
return True
return member in self.admins |
WORDLIST =\
('dna',
'vor',
'how',
'hot',
'yud',
'fir',
'fit',
'fix',
'dsc',
'ate',
'ira',
'cup',
'fre',
'fry',
'had',
'has',
'hat',
'hav',
'old',
'fou',
'for',
'fox',
'foe',
'fob',
'foi',
'soo',
'son',
'pet',
'veo',
'vel',
'jim',
'bla',
'one',
'san',
'sad',
'say',
'sap',
'saw',
'sat',
'cim',
'ivy',
'wpi',
'pop',
'act',
'her',
'hey',
'hel',
'heh',
'ohn',
'wav',
'its',
'bye',
'bhi',
'cry',
'set',
'sep',
'sez',
'see',
'sea',
'seo',
'sem',
'vow',
'ago',
'age',
'evo',
'eve',
'try',
'tru',
'uea',
'odd',
'led',
'lee',
'leg',
'leo',
'let',
'bay',
'log',
'low',
'jug',
'jul',
'jay',
'jar',
'aes',
'btw',
'tlc',
'off',
'oft',
'web',
'wee',
'wed',
'wes',
'wer',
'wet',
'ink',
'ing',
'ina',
'hps',
'ale',
'ala',
'bro',
'ere',
'lab',
'lay',
'law',
'zen',
'kin',
'sue',
'sun',
'yew',
'ill',
'air',
'aim',
'aid',
'thy',
'thu',
'tho',
'the',
'way',
'wax',
'was',
'war',
'fog',
'gum',
'gus',
'guy',
'fbi',
'jan',
'ibm',
'car',
'caw',
'can',
'aon',
'not',
'nov',
'now',
'nor',
'nos',
'zap',
'yin',
'egg',
'cen',
'sri',
'lol',
'los',
'lot',
'you',
'mph',
'ask',
'ash',
'awe',
'ego',
'dia',
'asc',
'put',
'str',
'lie',
'lia',
'lib',
'lit',
'lip',
'wow',
'won',
'ads',
'phu',
'bon',
'eel',
'run',
'cue',
'nam',
'ech',
'mad',
'mal',
'ben',
'bel',
'beg',
'bed',
'arc',
'bet',
'she',
'ken',
'oak',
'esp',
'dug',
'eat',
'aug',
'neo',
'new',
'net',
'men',
'met',
'dry',
'ise',
'tyr',
'don',
'doc',
'dog',
'bar',
'bag',
'bad',
'ban',
'sam',
'kid',
'yep',
'yes',
'yer',
'yet',
'dio',
'did',
'die',
'dig',
'dip',
'box',
'boy',
'bot',
'bow',
'bob',
'bod',
'bog',
'fly',
'map',
'mas',
'mar',
'may',
'max',
'mac',
'mao',
'man',
'lsd',
'ort',
'orb',
'las',
'get',
'par',
'yrs',
'pay',
'pan',
'oir',
'moy',
'mor',
'mov',
'tap',
'eye',
'two',
'der',
'dew',
'del',
'dec',
'oil',
'gif',
'cfn',
'gas',
'gap',
'fur',
'raw',
'fun',
'ray',
'cut',
'win',
'big',
'bid',
'apt',
'bit',
'per',
'pen',
'ufo',
'lyr',
'hal',
'chi',
'chs',
'iii',
'afa',
'sip',
'tsp',
'dad',
'dai',
'das',
'day',
'cwn',
'red',
'quo',
'mid',
'mix',
'adf',
'add',
'est',
'dcw',
'buy',
'but',
'bud',
'pin',
'pig',
'our',
'pit',
'end',
'gom',
'god',
'sow',
'got',
'tos',
'top',
'tow',
'too',
'tom',
'toe',
'ran',
'rap',
'abc',
'oct',
'nut',
'mud',
'rit',
'via',
'ice',
'ahp',
'uri',
'tir',
'til',
'tim',
'tin',
'rom',
'rob',
'rod',
'ard',
'msg',
'ahn',
'shu',
'iad',
'iaa',
'iau',
'hug',
'and',
'ann',
'any',
'tip',
'tie',
'jun',
'cbs',
'hit',
'ley',
'all',
'ptv',
'far',
'fan',
'fal',
'fad',
'teh',
'ten',
'tea',
'sum',
'hig',
'nan',
'ieo',
'hip',
'his',
'him',
'art',
'are',
'arm',
'lap',
'key',
'dun',
'dub',
'due',
'rim',
'rig',
'rid',
'row',
'cit',
'cad',
'apr',
'use',
'feb',
'usa',
'few',
'tax',
'tao',
'sir',
'sit',
'six',
'sid',
'sin',
'out',
'who',
'why',
'ear',
'joy',
'job',
'joe',
'jog',
'bbi',
'bbs',
'non',
'nob',
'sky',
'own',
'owe',
'van',
'four',
'pack',
'lore',
'lord',
'dell',
'foul',
'hero',
'herb',
'hera',
'here',
'cult',
'dorn',
'unit',
'holy',
'hurt',
'hole',
'hold',
'wand',
'want',
'dyke',
'turn',
'wins',
'wind',
'wine',
'vary',
'inar',
'wast',
'wash',
'legs',
'tree',
'idle',
'apre',
'that',
'cops',
'camp',
'came',
'prif',
'busy',
'ment',
'rich',
'blew',
'fair',
'pads',
'fail',
'fain',
'best',
'lots',
'dorm',
'diff',
'slay',
'much',
'life',
'dave',
'lift',
'suas',
'doth',
'spin',
'topy',
'tune',
'ease',
'wrap',
'nova',
'jane',
'lays',
'dues',
'role',
'enya',
'yhvh',
'time',
'push',
'gown',
'jerk',
'sign',
'ordo',
'melt',
'love',
'spot',
'date',
'such',
'kong',
'torc',
'webs',
'plea',
'raed',
'lbrp',
'vote',
'open',
'city',
'bite',
'cite',
'note',
'take',
'knew',
'knee',
'ways',
'bade',
'salt',
'laws',
'slow',
'robe',
'many',
'twin',
'boar',
'boat',
'west',
'brow',
'monk',
'nile',
'knot',
'rest',
'sums',
'dark',
'dare',
'clad',
'meal',
'bond',
'wade',
'with',
'pull',
'rush',
'rags',
'gone',
'yoga',
'mass',
'adam',
'tain',
'nora',
'sand',
'sank',
'past',
'pass',
'full',
'hast',
'pick',
'luck',
'mord',
'more',
'door',
'doom',
'sent',
'male',
'bogs',
'scam',
'huge',
'hugh',
'hugs',
'bowl',
'bows',
'ally',
'odin',
'shop',
'isle',
'week',
'ness',
'crow',
'zeus',
'hyde',
'sell',
'self',
'play',
'plan',
'tips',
'gold',
'burp',
'rite',
'nope',
'fame',
'thou',
'thor',
'bell',
'sees',
'firm',
'fire',
'fung',
'owed',
'mote',
'owen',
'read',
'caer',
'unto',
'reap',
'hues',
'sion',
'pale',
'into',
'span',
'suit',
'linn',
'link',
'atom',
'line',
'chan',
'chao',
'chap',
'tara',
'bush',
'land',
'code',
'send',
'wipe',
'pout',
'race',
'bird',
'thin',
'stag',
'mens',
'next',
'rick',
'babe',
'baby',
'this',
'pour',
'bent',
'loch',
'rode',
'high',
'bend',
'rods',
'pair',
'tied',
'fits',
'ties',
'hawk',
'move',
'lamp',
'earl',
'ship',
'kiss',
'mete',
'shut',
'veov',
'muin',
'eryn',
'awen',
'soak',
'awed',
'soar',
'visa',
'face',
'brew',
'fact',
'hops',
'mute',
'tape',
'hope',
'fewr',
'reis',
'wire',
'ends',
'drum',
'drug',
'lush',
'site',
'lust',
'sits',
'juan',
'ball',
'dusk',
'upon',
'dust',
'lest',
'paul',
'five',
'does',
'naff',
'iris',
'asks',
'mere',
'veil',
'rule',
'cian',
'owes',
'horn',
'neat',
'bhur',
'plot',
'ploy',
'yard',
'word',
'wore',
'work',
'worn',
'nuts',
'hong',
'arch',
'then',
'them',
'thee',
'safe',
'bang',
'sack',
'they',
'ther',
'bank',
'nudd',
'tops',
'mojo',
'neck',
'airy',
'john',
'rath',
'nana',
'aunt',
'just',
'runs',
'gaul',
'rune',
'rung',
'away',
'bolt',
'brad',
'bran',
'tone',
'tong',
'tons',
'axis',
'easy',
'east',
'cons',
'cone',
'cong',
'muid',
'rail',
'evil',
'hand',
'hans',
'kept',
'gods',
'soap',
'dwyr',
'born',
'bore',
'hare',
'post',
'pays',
'lewd',
'breo',
'crys',
'true',
'iisi',
'isis',
'anew',
'mold',
'test',
'bedw',
'zone',
'slip',
'cost',
'buch',
'labs',
'live',
'club',
'clue',
'coll',
'cold',
'halt',
'evoe',
'half',
'hall',
'wont',
'drop',
'year',
'carl',
'card',
'care',
'size',
'pomp',
'than',
'fork',
'slan',
'loki',
'only',
'urdr',
'pray',
'aura',
'scot',
'ruby',
'joke',
'lite',
'noah',
'real',
'ream',
'lady',
'llew',
'vahv',
'wolf',
'your',
'area',
'ares',
'poor',
'peat',
'peak',
'pooh',
'pool',
'very',
'verb',
'bass',
'cues',
'dion',
'nine',
'alby',
'lyre',
'rude',
'kuno',
'help',
'soon',
'carn',
'held',
'eros',
'hine',
'fool',
'food',
'foot',
'tear',
'jaws',
'bhar',
'bast',
'bald',
'azif',
'dirt',
'base',
'dire',
'bash',
'misc',
'mist',
'ascs',
'grew',
'grey',
'greg',
'hips',
'pans',
'less',
'mell',
'hype',
'oobe',
'both',
'elsa',
'else',
'pact',
'look',
'loop',
'sham',
'used',
'uses',
'moby',
'ioho',
'game',
'some',
'lips',
'gaia',
'step',
'ache',
'eons',
'duly',
'dips',
'reed',
'hail',
'dull',
'info',
'hair',
'gaze',
'hint',
'draw',
'aser',
'mhol',
'drag',
'dram',
'nuns',
'wave',
'orov',
'jump',
'celt',
'cell',
'crab',
'ride',
'meet',
'fare',
'mode',
'ills',
'keep',
'keen',
'omen',
'bare',
'bard',
'need',
'able',
'wyrd',
'envy',
'tire',
'rash',
'tirs',
'gray',
'wish',
'grab',
'cuts',
'tenm',
'joys',
'tend',
'tent',
'sole',
'magi',
'magh',
'poem',
'poee',
'poet',
'ufos',
'mail',
'owns',
'well',
'bohr',
'sufi',
'dose',
'dair',
'dost',
'vide',
'kick',
'fate',
'lost',
'ring',
'roth',
'lose',
'page',
'shed',
'shea',
'hush',
'home',
'eris',
'eric',
'star',
'stay',
'stan',
'bays',
'void',
'vast',
'yack',
'even',
'ever',
'drew',
'omar',
'hiya',
'arms',
'maes',
'call',
'calm',
'type',
'tell',
'wars',
'warn',
'warm',
'room',
'roof',
'akin',
'akim',
'root',
'give',
'egos',
'deck',
'crew',
'meat',
'mead',
'went',
'side',
'bone',
'mean',
'nave',
'navy',
'aids',
'dawn',
'loud',
'hook',
'hoof',
'mini',
'seer',
'mind',
'mine',
'seed',
'seen',
'seem',
'seek',
'stop',
'earn',
'told',
'ears',
'said',
'vows',
'puts',
'tiny',
'neal',
'ugly',
'near',
'make',
'left',
'nota',
'save',
'nude',
'dean',
'deal',
'dead',
'dear',
'veda',
'burn',
'bury',
'down',
'lies',
'dowm',
'form',
'ford',
'fort',
'zeno',
'toss',
'dies',
'felt',
'fell',
'died',
'skip',
'mild',
'mile',
'skin',
'gaea',
'item',
'anna',
'adds',
'stem',
'wait',
'sake',
'thru',
'soul',
'pink',
'rays',
'idir',
'pine',
'till',
'pure',
'pins',
'idic',
'guys',
'grow',
'tale',
'tall',
'talk',
'ours',
'main',
'beil',
'rock',
'girt',
'girl',
'lone',
'fast',
'eyes',
'memo',
'lugh',
'orgy',
'were',
'lick',
'dash',
'pain',
'paid',
'beth',
'shot',
'show',
'data',
'mung',
'seat',
'sean',
'seal',
'ogma',
'nose',
'arts',
'mark',
'mars',
'mary',
'wake',
'manx',
'same',
'tout',
'pile',
'grip',
'grid',
'grin',
'mare',
'roam',
'road',
'gort',
'deer',
'deep',
'film',
'fill',
'sunk',
'fall',
'none',
'tuan',
'hour',
'maps',
'stir',
'sect',
'pens',
'late',
'good',
'otto',
'rank',
'harm',
'hark',
'hard',
'idea',
'fist',
'harp',
'dont',
'done',
'park',
'part',
'ages',
'most',
'fine',
'find',
'ruis',
'sill',
'vine',
'lion',
'acts',
'fang',
'afar',
'amam',
'bill',
'keys',
'task',
'howe',
'snow',
'snag',
'clan',
'back',
'lark',
'epic',
'from',
'trad',
'boys',
'cure',
'curl',
'yang',
'lend',
'papa',
'lens',
'lent',
'crop',
'body',
'sins',
'sinn',
'sink',
'sing',
'oval',
'fete',
'bind',
'koad',
'kids',
'mate',
'tide',
'have',
'text',
'gorm',
'mica',
'isha',
'beat',
'bear',
'beam',
'halo',
'pulp',
'bull',
'bulb',
'amke',
'hubs',
'file',
'deed',
'sets',
'llyr',
'lake',
'atha',
'like',
'heed',
'soft',
'heel',
'guff',
'host',
'tomb',
'wise',
'flys',
'goin',
'oral',
'yell',
'tibs',
'hath',
'hate',
'risk',
'siul',
'rise',
'nail',
'blue',
'hide',
'sung',
'path',
'must',
'join',
'norn',
'gate',
'mess',
'amid',
'over',
'fade',
'alex',
'each',
'laid',
'sane',
'nite',
'hang',
'free',
'fred',
'rain',
'days',
'heck',
'onto',
'tool',
'took',
'glow',
'flow',
'leis',
'pope',
'sage',
'pops',
'kali',
'weak',
'boss',
'wear',
'news',
'been',
'beer',
'jean',
'gave',
'gifs',
'gift',
'hunt',
'hung',
'cord',
'core',
'corn',
'corp',
'bath',
'rely',
'head',
'heal',
'heat',
'hear',
'trim',
'when',
'whem',
'indo',
'bile',
'town',
'cook',
'cool',
'says',
'port',
'hymn',
'goes',
'iron',
'plug',
'plus',
'yule',
'term',
'name',
'miss',
'view',
'cope',
'alan',
'copy',
'wide',
'oath',
'diug',
'duir',
'rent',
'duit',
'urge',
'sure',
'mbeo',
'trom',
'troy',
'hack',
'wood',
'wool',
'ozma',
'come',
'duty',
'pole',
'case',
'cash',
'cast',
'trip',
'lute',
'weep',
'kill',
'blow',
'blot',
'rose',
'lets',
'rosy',
'ross',
'node',
'mood',
'moon',
'quit',
'cent',
'gary',
'fish',
'wife',
'bapa',
'lack',
'dish',
'song',
'sons',
'hemp',
'list',
'rate',
'what',
'womb',
'flat',
'obod',
'mire',
'flag',
'glad',
'eden',
'omit',
'goal',
'okay',
'jove',
'inch',
'hill',
'feed',
'feel',
'feet',
'king',
'kind',
'danu',
'aims',
'dane',
'dana',
'gall',
'fond',
'font',
'luis',
'dumb',
'bark',
'mban',
'solo',
'sold',
'whom',
'edge',
'gems',
'also',
'pros',
'anne',
'prob',
'long',
'mock',
'nice',
'vice',
'once',
'gang',
'agus',
'fold',
'acid',
'folk',
'rede',
'duck',
'fron',
'cili',
'sort',
'sore',
'tthe',
'flew',
'nuit',
'york',
'nuin',
'obvd',
'cain',
'isbn',
'echo',
'july',
'deny',
'gain',
'fear',
'ones',
'spur',
'viet',
'walk',
'walt',
'lyin',
'mike',
'last',
'wilt',
'will',
'wild',
'thus',
'dual',
'thud',
'gets',
'yoou',
'wren',
'myth',
'know',
'leaf',
'lead',
'lean',
'leap',
'leat',
'obey',
'pike',
'rare',
'made',
'gaps',
'cake',
'mady',
'cave',
'book',
'sick',
'junk',
'agla',
'june',
'jung',
'sase',
'pods',
'woods',
'knelt',
'tired',
'pulse',
'atoms',
'china',
'uisci',
'norse',
'spoke',
'music',
'until',
'relax',
'glass',
'blade',
'pints',
'wrong',
'types',
'keeps',
'wales',
'thyme',
'fnord',
'arrow',
'bowls',
'mayan',
'adapt',
'sheet',
'nigel',
'dwale',
'spawn',
'sooth',
'alive',
'doors',
'henge',
'shall',
'wells',
'mouth',
'entry',
'shalt',
'grove',
'runic',
'gauge',
'theme',
'bliss',
'pelen',
'plate',
'plato',
'afall',
'rings',
'score',
'never',
'lamac',
'logic',
'argue',
'asked',
'raith',
'union',
'child',
'chill',
'tapes',
'split',
'josey',
'neter',
'veils',
'osman',
'posed',
'birth',
'bobby',
'steph',
'steps',
'right',
'crowd',
'creed',
'crown',
'bruig',
'nixon',
'nglas',
'waits',
'avail',
'untie',
'halls',
'happy',
'offer',
'batle',
'beech',
'otter',
'proud',
'exist',
'floor',
'warms',
'smell',
'palms',
'roimh',
'chain',
'chair',
'midst',
'macha',
'copse',
'edred',
'stays',
'exact',
'cooks',
'unify',
'leave',
'whome',
'badge',
'snack',
'egypt',
'owuld',
'alone',
'along',
'tasks',
'carol',
'angry',
'papal',
'films',
'scope',
'deign',
'honey',
'privy',
'stole',
'deity',
'limbo',
'apron',
'temen',
'deady',
'abide',
'quite',
'poems',
'dunno',
'monks',
'uriel',
'waist',
'sayer',
'prone',
'herds',
'nicer',
'alley',
'allen',
'aside',
'pages',
'drive',
'lotus',
'cloak',
'tears',
'going',
'imbas',
'touch',
'prime',
'where',
'mecca',
'clips',
'sites',
'acome',
'garda',
'spark',
'geese',
'wants',
'pinks',
'ascii',
'shuti',
'anseo',
'genie',
'lambs',
'nessa',
'being',
'world',
'snare',
'fives',
'brits',
'troth',
'lucid',
'refer',
'power',
'stone',
'niall',
'other',
'image',
'ciabh',
'myths',
'vanir',
'dirty',
'agree',
'tight',
'herbs',
'thorn',
'groom',
'hello',
'thorr',
'smile',
'cable',
'large',
'harry',
'small',
'hours',
'prior',
'pulls',
'trips',
'goeth',
'leary',
'learn',
'salty',
'bated',
'plant',
'plane',
'waves',
'scota',
'paper',
'scott',
'signs',
'trads',
'roots',
'isaac',
'found',
'eddas',
'ditch',
'zwack',
'rises',
'pairs',
'major',
'gazed',
'guess',
'heads',
'saint',
'grace',
'vocal',
'shops',
'virus',
'emyrs',
'seize',
'cover',
'coven',
'piper',
'xeper',
'wayne',
'cowan',
'beams',
'sunny',
'hilts',
'thoth',
'cease',
'river',
'movie',
'kneel',
'death',
'pagan',
'harps',
'whole',
'acted',
'devin',
'devil',
'teann',
'races',
'awake',
'error',
'cages',
'pound',
'sabha',
'chase',
'funny',
'cigar',
'alert',
'leaps',
'focal',
'picks',
'feces',
'kelly',
'ahura',
'quest',
'spine',
'scape',
'canst',
'maige',
'sighs',
'sight',
'pools',
'santa',
'doubt',
'opens',
'codes',
'evohe',
'swirl',
'sided',
'sides',
'holey',
'fresh',
'essay',
'totem',
'stops',
'young',
'mytle',
'darra',
'magic',
'marry',
'fewer',
'reich',
'imply',
'video',
'ithin',
'index',
'anton',
'punch',
'great',
'makes',
'maker',
'tools',
'folks',
'mabon',
'await',
'ombos',
'allow',
'rilla',
'decay',
'necht',
'betty',
'truth',
'doing',
'books',
'banal',
'ewige',
'venom',
'tempo',
'spill',
'could',
'david',
'blown',
'scene',
'stark',
'owner',
'blows',
'prank',
'start',
'stars',
'haven',
'steed',
'false',
'linda',
'bring',
'brink',
'pause',
'meant',
'bonds',
'lucky',
'stuff',
'exude',
'frame',
'liken',
'cense',
'marty',
'muine',
'beach',
'waste',
'eaton',
'groin',
'mutat',
'drink',
'audio',
'snake',
'flesh',
'gulls',
'rooms',
'photo',
'taunt',
'fools',
'criss',
'yearn',
'onnen',
'grids',
'thier',
'avoid',
'hadit',
'stage',
'seeds',
'burma',
'erect',
'roads',
'afoot',
'ovovo',
'yarns',
'gwion',
'count',
'calls',
'irish',
'jesse',
'tides',
'ghost',
'walks',
'worth',
'pinch',
'brill',
'above',
'sinks',
'pluto',
'items',
'study',
'adopt',
'dowth',
'total',
'dilly',
'reign',
'mages',
'india',
'knees',
'sever',
'after',
'uisce',
'greet',
'greek',
'green',
'south',
'worst',
'order',
'greed',
'break',
'bread',
'rocks',
'doled',
'flock',
'forty',
'forth',
'renew',
'comic',
'rated',
'mercy',
'binds',
'guilt',
'banes',
'reall',
'gravy',
'bruce',
'aesir',
'lewis',
'toast',
'elite',
'steel',
'nasty',
'steal',
'draws',
'props',
'drawn',
'terms',
'gable',
'trunk',
'wider',
'speak',
'ahead',
'beith',
'voice',
'wheel',
'horus',
'swell',
'hills',
'shout',
'board',
'night',
'mazes',
'hypoc',
'sends',
'humor',
'hodge',
'float',
'fight',
'palce',
'moors',
'dying',
'songs',
'dance',
'flash',
'turns',
'woven',
'upper',
'curse',
'argee',
'genes',
'trial',
'triad',
'extra',
'prove',
'super',
'ninny',
'gwynn',
'eidos',
'purge',
'heart',
'topic',
'heard',
'occur',
'means',
'write',
'nosed',
'wwhat',
'brain',
'whats',
'still',
'birds',
'forms',
'saxon',
'feats',
'james',
'couls',
'goose',
'fires',
'album',
'shown',
'space',
'shows',
'thong',
'blind',
'madam',
'beest',
'drove',
'sheep',
'dawns',
'baldr',
'muide',
'shady',
'angel',
'craig',
'anger',
'dread',
'begin',
'prick',
'shade',
'price',
'fifth',
'ratio',
'stair',
'title',
'skith',
'truly',
'loath',
'keyed',
'burst',
'sport',
'huggs',
'pluck',
'blame',
'hurts',
'comes',
'jeans',
'cares',
'crumb',
'these',
'trick',
'celts',
'conys',
'worry',
'sould',
'proto',
'media',
'whyte',
'medic',
'noble',
'fruit',
'heaps',
'speed',
'parts',
'verse',
'rules',
'ruler',
'gonna',
'early',
'using',
'stuns',
'ruled',
'faire',
'fairs',
'nuada',
'sixth',
'throw',
'lymph',
'fraud',
'tones',
'moved',
'oisin',
'salem',
'moves',
'valid',
'month',
'corps',
'nodes',
'robes',
'robed',
'coals',
'loose',
'arena',
'aball',
'aimed',
'lagoz',
'teach',
'takes',
'girds',
'taken',
'broke',
'hurry',
'lacks',
'tried',
'tries',
'banks',
'dream',
'match',
'fines',
'finer',
'vomit',
'payer',
'fully',
'bless',
'fairy',
'heavy',
'event',
'warts',
'since',
'dearg',
'issue',
'stead',
'inert',
'knots',
'elder',
'craps',
'horse',
'storm',
'tunic',
'bride',
'quote',
'clear',
'cleat',
'clean',
'blend',
'pucas',
'withe',
'close',
'duinn',
'vault',
'liked',
'stamp',
'empty',
'lived',
'packs',
'heute',
'while',
'smart',
'fleet',
'guide',
'reads',
'ready',
'grant',
'grand',
'older',
'cedar',
'olden',
'elect',
'elven',
'yeahm',
'maeve',
'march',
'wings',
'holes',
'modus',
'infra',
'feill',
'taboo',
'shine',
'faith',
'gnome',
'kwiat',
'alpha',
'frost',
'malik',
'fears',
'orbit',
'neils',
'bribe',
'etain',
'oliva',
'suits',
'suite',
'tonal',
'plays',
'chant',
'pitch',
'cloud',
'cosmo',
'drops',
'duile',
'hides',
'links',
'echos',
'trees',
'ruadh',
'feels',
'ogham',
'boils',
'outer',
'broom',
'abred',
'sword',
'hands',
'front',
'slide',
'chunk',
'cause',
'sneer',
'paten',
'shred',
'timed',
'spots',
'bears',
'ankle',
'final',
'lists',
'claim',
'screw',
'edric',
'based',
'bases',
'dodge',
'slows',
'joint',
'joins',
'years',
'state',
'dogon',
'merry',
'thumb',
'mindy',
'minds',
'admit',
'lofty',
'kings',
'tread',
'wills',
'treat',
'novel',
'chalk',
'bucks',
'began',
'begat',
'party',
'gaoth',
'skill',
'ought',
'clown',
'likes',
'peter',
'murry',
'inner',
'north',
'xerox',
'goals',
'leper',
'cells',
'limit',
'piece',
'beats',
'conan',
'lives',
'liver',
'aided',
'whose',
'sorry',
'fists',
'force',
'saved',
'niche',
'spiel',
'moral',
'barks',
'oscar',
'cuups',
'dogma',
'adult',
'flora',
'guise',
'foods',
'thine',
'laida',
'third',
'jacob',
'weeks',
'kesey',
'grade',
'girls',
'dwell',
'helen',
'bikka',
'silly',
'caled',
'tells',
'chest',
'atman',
'marie',
'doves',
'dover',
'debts',
'coast',
'bhall',
'cower',
'zones',
'sorta',
'sorts',
'weary',
'scuba',
'lowly',
'ether',
'lttle',
'basis',
'three',
'basic',
'threw',
'seven',
'shame',
'grown',
'bella',
'grows',
'bells',
'meets',
'smoke',
'yours',
'human',
'facts',
'nudge',
'meath',
'jeeah',
'dense',
'track',
'beget',
'faery',
'azure',
'nerve',
'coins',
'erinn',
'sagas',
'suebi',
'gland',
'vista',
'holly',
'aware',
'daily',
'souls',
'marks',
'round',
'seidr',
'visit',
'rigid',
'olive',
'bites',
'lords',
'crazy',
'agent',
'swore',
'wicca',
'waxen',
'maybe',
'block',
'serge',
'tales',
'shake',
'clans',
'group',
'thank',
'views',
'boats',
'ruddy',
'cough',
'thing',
'think',
'first',
'carry',
'murky',
'slept',
'fiery',
'gotta',
'kevin',
'squaw',
'trace',
'enter',
'aloud',
'tract',
'eadha',
'fills',
'ladle',
'black',
'helix',
'sidhe',
'hippo',
'hippy',
'skull',
'yield',
'dagda',
'dates',
'among',
'barry',
'sound',
'issac',
'handy',
'weave',
'conor',
'solve',
'gates',
'money',
'forge',
'adams',
'titan',
'erase',
'gross',
'ellis',
'lunar',
'knife',
'tease',
'mixed',
'vigil',
'strip',
'fates',
'rider',
'adler',
'gaels',
'hound',
'midhe',
'boons',
'casts',
'talks',
'those',
'furze',
'steve',
'angus',
'hogan',
'stood',
'garth',
'bible',
'liber',
'wiped',
'canon',
'sylph',
'halts',
'biodh',
'share',
'needs',
'sired',
'lythe',
'blood',
'kegan',
'heirs',
'bosom',
'balor',
'walls',
'ashes',
'token',
'house',
'deals',
'podge',
'print',
'least',
'paint',
'sated',
'rates',
'stirs',
'youth',
'built',
'couch',
'onset',
'build',
'flute',
'chart',
'charm',
'giant',
'gilly',
'celyn',
'ovate',
'aldus',
'rover',
'sigil',
'cakes',
'point',
'raise',
'inoke',
'solid',
'lingo',
'realm',
'spent',
'flags',
'spend',
'alder',
'gheal',
'shape',
'hated',
'hates',
'knock',
'dtoil',
'often',
'scale',
'smail',
'crone',
'goods',
'yorba',
'drama',
'piled',
'ounce',
'phase',
'grave',
'hoped',
'hopes',
'adair',
'metal',
'ellen',
'druim',
'druid',
'druis',
'wards',
'dhuit',
'querc',
'fitch',
'tombs',
'quert',
'helps',
'queen',
'rhyme',
'tinne',
'pipes',
'gimle',
'safer',
'drank',
'climb',
'proof',
'honor',
'named',
'drums',
'names',
'train',
'hints',
'fetch',
'bones',
'holds',
'orson',
'lines',
'linen',
'chief',
'lands',
'horns',
'bunch',
'labor',
'pangs',
'spell',
'cider',
'faidh',
'cures',
'sadly',
'scant',
'loved',
'draoi',
'lover',
'waken',
'hazel',
'eight',
'sally',
'gurus',
'staff',
'areas',
'organ',
'fixed',
'rowan',
'legis',
'equal',
'sexes',
'laugh',
'thsis',
'plain',
'value',
'esras',
'diety',
'whirr',
'again',
'usual',
'chord',
'seats',
'tough',
'spear',
'field',
'crops',
'raven',
'tests',
'testy',
'dirac',
'ozone',
'works',
'awash',
'prose',
'noise',
'panel',
'gifts',
'about',
'evoke',
'guard',
'hexed',
'globe',
'ivory',
'misty',
'glory',
'mists',
'ledge',
'pupil',
'sleep',
'paris',
'under',
'pride',
'every',
'venus',
'enjoy',
'seeks',
'druel',
'forum',
'stray',
'julia',
'would',
'raids',
'naive',
'phone',
'tampa',
'henry',
'shook',
'bothy',
'times',
'badly',
'canto',
'edits',
'diana',
'newly',
'wowed',
'sobek',
'pyres',
'awoke',
'sober',
'serve',
'gulfs',
'roles',
'aztec',
'flame',
'beket',
'mirth',
'beard',
'bards',
'pylon',
'cleff',
'clock',
'radio',
'queer',
'earth',
'spite',
'watch',
'tammy',
'haite',
'aught',
'beads',
'twice',
'shots',
'swept',
'habit',
'wakan',
'tommy',
'mazda',
'faced',
'fault',
'games',
'faces',
'trust',
'drugs',
'craft',
'catch',
'broth',
'wound',
'lusty',
'sings',
'welsh',
'cycle',
'ocean',
'torah',
'thick',
'suzan',
'judge',
'burns',
'rumor',
'apart',
'adieu',
'usher',
'armed',
'foote',
'khaki',
'choke',
'civil',
'class',
'stuck',
'solar',
'annwn',
'adore',
'check',
'eerie',
'navel',
'focus',
'leads',
'tanka',
'level',
'quick',
'doeth',
'fearn',
'cyber',
'colin',
'dried',
'spiro',
'reply',
'hairs',
'dazed',
'water',
'witch',
'boast',
'weird',
'isles',
'vivid',
'runes',
'tubes',
'today',
'altar',
'lazlo',
'cases',
'piano',
'wands',
'rufus',
'boris',
'nexus',
'sense',
'nuber',
'bigot',
'gulik',
'vital',
'rites',
'amuse',
'chips',
'swans',
'bound',
'opera',
'torch',
'torcs',
'begun',
'plans',
'eagle',
'flyer',
'place',
'swing',
'feign',
'given',
'white',
'circa',
'giver',
'gives',
'lacha',
'cards',
'mated',
'sells',
'ideas',
'ideal',
'falls',
'later',
'uncle',
'perch',
'cheap',
'dirge',
'crime',
'trade',
'olaus',
'naked',
'scots',
'fails',
'shiva',
'seers',
'quiet',
'cabal',
'color',
'deeds',
'abdul',
'cords',
'maire',
'shaft',
'mound',
'thses',
'arose',
'raibh',
'model',
'seems',
'kills',
'boyne',
'acute',
'inate',
'fount',
'tower',
'tarot',
'table',
'frees',
'legal',
'freed',
'raths',
'stand',
'hindu',
'amber',
'tribe',
'there',
'beret',
'grasp',
'grass',
'taste',
'tasty',
'abyss',
'wkshp',
'trash',
'brass',
'oriel',
'curve',
'ments',
'seals',
'woman',
'worse',
'awful',
'vibes',
'brief',
'texts',
'faint',
'wield',
'minor',
'knows',
'waxed',
'known',
'ouija',
'brown',
'arise',
'court',
'maith',
'cults',
'short',
'susan',
'style',
'abbey',
'might',
'alter',
'odubh',
'loops',
'huath',
'roofs',
'fancy',
'blank',
'story',
'comfy',
'syrup',
'store',
'pains',
'hotel',
'exert',
'oaken',
'alike',
'fionn',
'added',
'reach',
'react',
'niver',
'liath',
'lying',
'gains',
'wrote',
'blurb',
'latin',
'epona',
'herne',
'roman',
'finds',
'cynic',
'sweet',
'sweep',
'goats',
'brick',
'miles',
'apear',
'paths',
'flows',
'birch',
'lower',
'redes',
'tends',
'jumps',
'aloft',
'plaza',
'range',
'wanne',
'wanna',
'muzak',
'canal',
'files',
'cloth',
'filed',
'crane',
'freak',
'stick',
'rally',
'peace',
'gloss',
'risin',
'karma',
'broad',
'alien',
'winds',
'simon',
'abode',
'notes',
'dealt',
'dealy',
'noted',
'folds',
'poets',
'chuid',
'chose',
'lends',
'matov',
'apple',
'apply',
'grian',
'porch',
'women',
'roich',
'sakes',
'clues',
'asily',
'abuse',
'light',
'looks',
'quake',
'ships',
'crash',
'enemy',
'crass',
'feast',
'chaos',
'chaol',
'pours',
'hence',
'their',
'shell',
'scone',
'reeks',
'which',
'clasp',
'stove',
'utter',
'local',
'words',
'ended',
'truer',
'magus',
'favor',
'swift',
'grain',
'grail',
'tutor',
'ysgaw',
'anois',
'layer',
'motif',
'pikes',
'cross',
'unite',
'unity',
'units',
'slave',
'idris',
'cried',
'cries',
'tawny',
'press',
'gypsy',
'miami',
'loses',
'hosts',
'nagas',
'noose',
'pasts',
'urged',
'swear',
'sweat',
'brush',
'fired',
'siuil',
'funds',
'below',
'ailim',
'hymns',
'lance',
'kinds',
'cliff',
'yellow',
'verses',
'outwit',
'tingle',
'oceans',
'wooden',
'piling',
'ornate',
'second',
'sailed',
'errors',
'golden',
'strike',
'whorls',
'brings',
'hereby',
'locked',
'pursue',
'tuatha',
'exhale',
'unjust',
'travel',
'drying',
'beauty',
'youths',
'kokomo',
'preeve',
'hidden',
'easier',
'enrich',
'silver',
'rumour',
'barton',
'snakes',
'series',
'george',
'speeds',
'needed',
'master',
'listed',
'bitter',
'listen',
'danish',
'wisdom',
'doreen',
'showed',
'outlaw',
'endure',
'person',
'scummy',
'figger',
'object',
'letter',
'snares',
'brehon',
'mating',
'scream',
'saying',
'layout',
'louise',
'fetish',
'jaguar',
'greens',
'radius',
'result',
'hammer',
'stamps',
'extend',
'nature',
'rolled',
'extent',
'summat',
'gheall',
'worked',
'employ',
'played',
'things',
'format',
'beckon',
'babies',
'fairly',
'maxims',
'echoes',
'bergan',
'sleeps',
'prison',
'elders',
'online',
'shadow',
'unique',
'desire',
'remind',
'people',
'hoover',
'bottom',
'shakes',
'losing',
'bowing',
'collen',
'raised',
'danaan',
'beings',
'raises',
'shoots',
'joseph',
'utmost',
'inside',
'solong',
'proved',
'proven',
'oscail',
'intend',
'models',
'taurus',
'intent',
'cupped',
'recipe',
'choice',
'minute',
'amoral',
'skewed',
'solved',
'settle',
'erotic',
'freaks',
'ground',
'honour',
'carill',
'tyoing',
'saints',
'prefer',
'druids',
'helter',
'loving',
'visual',
'virtue',
'riders',
'nether',
'values',
'winter',
'mythos',
'missal',
'stress',
'briony',
'pulled',
'scents',
'aeonic',
'augury',
'course',
'derive',
'solace',
'dwarfs',
'nroogd',
'nation',
'amulet',
'thuinn',
'square',
'herard',
'astral',
'sorcha',
'shores',
'impure',
'routes',
'spoked',
'saving',
'spoken',
'clause',
'submit',
'mannan',
'loveth',
'typing',
'thetis',
'future',
'gwyned',
'russia',
'sophia',
'turned',
'buried',
'nymphs',
'towers',
'airing',
'crealm',
'bright',
'artist',
'borrow',
'priest',
'liable',
'vision',
'pisces',
'dexter',
'harvey',
'bureau',
'jumper',
'screen',
'planes',
'loudly',
'riddle',
'breath',
'enable',
'benoit',
'formed',
'photos',
'extant',
'former',
'tribal',
'region',
'zonked',
'flocks',
'pacing',
'summer',
'joyful',
'around',
'yearly',
'racial',
'divine',
'thinks',
'biased',
'phagos',
'dagdha',
'burial',
'legged',
'lively',
'gennep',
'cultic',
'buying',
'abused',
'naming',
'shevet',
'glenda',
'johnny',
'forgot',
'carved',
'novice',
'waving',
'caused',
'urbane',
'causes',
'paying',
'sabbat',
'laying',
'joined',
'healed',
'healer',
'seemed',
'method',
'dwells',
'legend',
'fergus',
'bestow',
'action',
'filial',
'select',
'casket',
'coyote',
'ghrian',
'stated',
'cosmic',
'staten',
'accept',
'states',
'gallon',
'pogrom',
'refuse',
'termed',
'gerald',
'hounds',
'olivia',
'misuse',
'always',
'truths',
'osiris',
'arrray',
'detect',
'waking',
'reduce',
'finish',
'scribe',
'really',
'missed',
'dianic',
'finnen',
'occurs',
'salute',
'belief',
'bedlam',
'murmur',
'reared',
'castle',
'number',
'fluxes',
'ulster',
'justly',
'warmly',
'stifle',
'wessex',
'uscias',
'barred',
'barren',
'impact',
'failed',
'factor',
'wiccan',
'weaved',
'peleus',
'weaver',
'insane',
'potent',
'europe',
'barely',
'agents',
'church',
'satire',
'lovest',
'admire',
'varies',
'triple',
'vanish',
'satyrs',
'survey',
'levels',
'recent',
'expend',
'papyri',
'mandan',
'couple',
'falcon',
'formal',
'facets',
'yields',
'tribes',
'spring',
'bounce',
'mighty',
'behave',
'dating',
'temple',
'clancy',
'pietra',
'repaid',
'sneaky',
'mythic',
'custom',
'inches',
'jewish',
'pastor',
'posted',
'horned',
'mature',
'pineal',
'purges',
'fixing',
'bianca',
'unplug',
'scotch',
'walked',
'purged',
'oracle',
'gleini',
'menace',
'having',
'gossip',
'garden',
'timely',
'pledge',
'fables',
'victor',
'waning',
'indian',
'orainn',
'engage',
'stairs',
'defeat',
'quests',
'eleven',
'pencil',
'zimmer',
'bodily',
'pieces',
'chakra',
'martyr',
'senach',
'animal',
'blocks',
'tomato',
'shapes',
'chosen',
'traced',
'fields',
'statis',
'jagged',
'wander',
'motifs',
'perish',
'greedy',
'surely',
'thrust',
'length',
'system',
'norton',
'quarry',
'bodrun',
'aztecs',
'gently',
'gentle',
'viewed',
'korean',
'sirius',
'device',
'rubric',
'decade',
'smacks',
'should',
'riding',
'handle',
'summon',
'rapped',
'needto',
'galaxy',
'gnomes',
'getyou',
'ollomh',
'engulf',
'waseth',
'dunnan',
'banish',
'basket',
'hahaha',
'tattoo',
'denial',
'spends',
'colour',
'strive',
'warded',
'height',
'become',
'aillil',
'singin',
'wields',
'gained',
'sister',
'chrome',
'suited',
'assess',
'immune',
'camden',
'heresy',
'apollo',
'tossed',
'places',
'smooth',
'placed',
'rubble',
'denote',
'deadly',
'behold',
'monday',
'chance',
'lasted',
'defend',
'oldest',
'davies',
'rocnat',
'chapel',
'upload',
'gaelic',
'totems',
'follow',
'equals',
'secure',
'highly',
'dannan',
'groves',
'gloria',
'impair',
'chilly',
'verify',
'coined',
'retain',
'office',
'devote',
'pascal',
'denver',
'versus',
'lifted',
'kneels',
'evolve',
'hosted',
'hazels',
'sprigg',
'alskog',
'thuban',
'raisin',
'oppose',
'eremon',
'rooted',
'nooses',
'emblem',
'albert',
'jingle',
'wasted',
'gwynyd',
'target',
'scenes',
'seated',
'powers',
'return',
'manner',
'forced',
'latter',
'forces',
'magnum',
'maiden',
'lindow',
'oftenj',
'hindic',
'notion',
'echlyn',
'subtle',
'latent',
'masons',
'vowels',
'roinnt',
'cattle',
'imbolg',
'imbolc',
'pasted',
'unable',
'arcane',
'accord',
'unfold',
'relics',
'warmth',
'duties',
'excite',
'abrupt',
'vernal',
'avoids',
'depict',
'faiths',
'humble',
'humbly',
'indigo',
'quoted',
'newton',
'quotes',
'thanks',
'victim',
'swears',
'hallow',
'spread',
'jehana',
'viking',
'usable',
'alther',
'libhse',
'scaoil',
'purple',
'denied',
'framed',
'theirs',
'months',
'treble',
'amidst',
'lowest',
'rabbis',
'injury',
'veiled',
'flecks',
'lugaid',
'prayed',
'gather',
'manure',
'prayer',
'shrine',
'scored',
'pefect',
'murias',
'matron',
'global',
'battle',
'rhythm',
'terror',
'eliade',
'drakes',
'appear',
'aneris',
'shared',
'appeal',
'muslin',
'change',
'flames',
'pillow',
'marked',
'marker',
'rarely',
'market',
'salted',
'angels',
'slogan',
'decked',
'social',
'purity',
'heroes',
'indeed',
'aiding',
'selves',
'window',
'norway',
'domain',
'happen',
'opened',
'orphic',
'opener',
'cycles',
'honest',
'styles',
'flying',
'silent',
'caught',
'friend',
'mostly',
'brains',
'fruits',
'neatly',
'steady',
'sunset',
'filing',
'sceach',
'german',
'dougal',
'cannon',
'samuel',
'cannot',
'seldom',
'fanned',
'flatly',
'herbal',
'import',
'notice',
'aradia',
'wheels',
'nearby',
'differ',
'failte',
'beaver',
'poetic',
'cuchul',
'breezy',
'breeze',
'poplar',
'struck',
'dishes',
'pounds',
'twelve',
'verbal',
'oscars',
'willie',
'verily',
'mircea',
'grange',
'poured',
'shower',
'trying',
'sheath',
'merest',
'issian',
'diruit',
'dabble',
'gorias',
'gavity',
'ceased',
'carpet',
'foster',
'eldest',
'minded',
'decide',
'finger',
'heaven',
'orgasm',
'casual',
'edited',
'excess',
'strong',
'amoung',
'losses',
'amount',
'family',
'chunks',
'excuse',
'sweeps',
'visage',
'pushes',
'pushed',
'phrase',
'firmly',
'reject',
'anoint',
'minuto',
'wiener',
'huathe',
'bagage',
'beyond',
'payson',
'robert',
'safety',
'houses',
'reason',
'fenian',
'launch',
'scouts',
'assign',
'meadow',
'prople',
'pinned',
'expand',
'bardai',
'raping',
'kindle',
'toward',
'mickey',
'option',
'adrift',
'trance',
'salary',
'raving',
'sturdy',
'latest',
'jehova',
'pretty',
'circle',
'albeit',
'famous',
'during',
'stored',
'arrien',
'howled',
'cuirim',
'horrid',
'segais',
'header',
'vessel',
'partly',
'hoodoo',
'soiled',
'dictum',
'herein',
'belong',
'margot',
'influx',
'bearer',
'dearly',
'toyota',
'sketch',
'parade',
'urgent',
'savage',
'wealth',
'conrad',
'wicker',
'seeing',
'within',
'smells',
'innate',
'oghams',
'wicked',
'adults',
'willed',
'rupert',
'turedh',
'smiles',
'kansas',
'leaned',
'rested',
'oregon',
'knowth',
'wizard',
'athame',
'button',
'lleian',
'picked',
'rotten',
'infuse',
'scythe',
'ramses',
'orkney',
'danger',
'manage',
'infest',
'hiding',
'cheeks',
'sought',
'poetry',
'beatha',
'chiefs',
'thence',
'upward',
'ankles',
'inputs',
'morton',
'reacts',
'austin',
'boring',
'attack',
'punish',
'mantra',
'weiser',
'sewing',
'saolta',
'spleen',
'affair',
'parker',
'anyway',
'likens',
'argues',
'stance',
'cardan',
'ordain',
'preach',
'poular',
'humans',
'canine',
'tosses',
'limits',
'career',
'jersey',
'agreed',
'inhale',
'slowly',
'senses',
'league',
'sensed',
'harder',
'yeself',
'campus',
'chants',
'absorb',
'effect',
'fierce',
'single',
'hecate',
'trials',
'spells',
'idunna',
'logged',
'killed',
'sarsen',
'burden',
'starry',
'repeat',
'quarts',
'bundle',
'muchly',
'refuge',
'primal',
'museum',
'harken',
'signed',
'pumped',
'devise',
'kisses',
'upsets',
'relive',
'fodder',
'canvas',
'acroos',
'sphinx',
'todays',
'pardon',
'demand',
'fronts',
'sigils',
'rescue',
'govern',
'affect',
'baking',
'skills',
'graced',
'vector',
'graces',
'dogmas',
'likely',
'panama',
'lights',
'active',
'luther',
'credit',
'permit',
'joshua',
'sliced',
'guests',
'opovig',
'janine',
'expose',
'frenzy',
'sumbel',
'rights',
'climax',
'faults',
'answer',
'murray',
'censer',
'oswald',
'before',
'chatti',
'better',
'glazed',
'taught',
'decree',
'reader',
'grease',
'linear',
'resume',
'shaggy',
'setian',
'aphrod',
'starts',
'plains',
'tokens',
'swells',
'begins',
'matter',
'street',
'palace',
'rattle',
'modern',
'wrists',
'points',
'lyrics',
'hunger',
'retire',
'ending',
'poison',
'nevada',
'saturn',
'sinked',
'mayans',
'derwen',
'softly',
'voyage',
'siging',
'staves',
'peyotl',
'peyote',
'tasted',
'bardic',
'lovely',
'deeper',
'sooooo',
'magics',
'jewels',
'deepen',
'affirm',
'tastes',
'melted',
'anchor',
'mexico',
'tugaim',
'parish',
'writer',
'hooded',
'novels',
'butter',
'berate',
'claims',
'givers',
'unfair',
'legion',
'defray',
'rotate',
'dreams',
'signal',
'strife',
'normal',
'goddeu',
'goddes',
'keeper',
'myrdin',
'commit',
'editor',
'builds',
'bounds',
'tucson',
'cosmos',
'boomed',
'sticks',
'covers',
'awhile',
'handed',
'hangin',
'assume',
'undine',
'forthe',
'invent',
'themes',
'primer',
'father',
'string',
'forked',
'nectar',
'gypsie',
'talked',
'eating',
'troops',
'favour',
'filled',
'french',
'merlin',
'monies',
'useful',
'merely',
'pluses',
'cabals',
'repast',
'effort',
'making',
'arrive',
'sample',
'drawer',
'dennis',
'sunday',
'swayed',
'purify',
'hassan',
'shield',
'entity',
'policy',
'truest',
'tucked',
'sooner',
'arrows',
'zurich',
'richly',
'unlock',
'giveth',
'canada',
'living',
'greeks',
'pamela',
'romans',
'pundit',
'waited',
'rachel',
'sounds',
'little',
'anyone',
'knives',
'booted',
'liveth',
'topics',
'voices',
'roster',
'bowels',
'queens',
'jumped',
'uranus',
'corner',
'storms',
'behind',
'dianna',
'stupid',
'moladh',
'asatru',
'wonder',
'enough',
'across',
'august',
'parent',
'cancer',
'cancel',
'lakota',
'unwise',
'rammed',
'coffee',
'middle',
'sudden',
'ooomph',
'straif',
'wisely',
'doctor',
'driseg',
'speech',
'assist',
'driven',
'bottle',
'amazed',
'aspect',
'dipped',
'fucked',
'aiming',
'serves',
'facing',
'served',
'moving',
'images',
'ascent',
'stages',
'overly',
'caring',
'broken',
'visits',
'refers',
'helgen',
'island',
'tupper',
'dagger',
'downey',
'wiping',
'dolmen',
'cabled',
'cables',
'ngetal',
'ofrail',
'waxing',
'tackle',
'grudge',
'neters',
'forget',
'deosil',
'dollar',
'forged',
'washer',
'titled',
'strung',
'titles',
'public',
'beacon',
'enmity',
'stella',
'narrow',
'africa',
'croons',
'landed',
'trelle',
'strain',
'recall',
'remain',
'clergy',
'meeker',
'attain',
'sacred',
'charms',
'advice',
'coming',
'bathed',
'dragon',
'infant',
'odinic',
'winged',
'suffer',
'libido',
'obeyed',
'oxford',
'detach',
'easily',
'habits',
'fiacha',
'mental',
'energy',
'orient',
'lovers',
'flowed',
'backed',
'luisne',
'twenty',
'plexus',
'ordure',
'malice',
'gotten',
'orders',
'salmon',
'syntax',
'thomas',
'cerrig',
'hopped',
'evoked',
'inanna',
'merged',
'remove',
'common',
'gospel',
'devils',) | wordlist = ('dna', 'vor', 'how', 'hot', 'yud', 'fir', 'fit', 'fix', 'dsc', 'ate', 'ira', 'cup', 'fre', 'fry', 'had', 'has', 'hat', 'hav', 'old', 'fou', 'for', 'fox', 'foe', 'fob', 'foi', 'soo', 'son', 'pet', 'veo', 'vel', 'jim', 'bla', 'one', 'san', 'sad', 'say', 'sap', 'saw', 'sat', 'cim', 'ivy', 'wpi', 'pop', 'act', 'her', 'hey', 'hel', 'heh', 'ohn', 'wav', 'its', 'bye', 'bhi', 'cry', 'set', 'sep', 'sez', 'see', 'sea', 'seo', 'sem', 'vow', 'ago', 'age', 'evo', 'eve', 'try', 'tru', 'uea', 'odd', 'led', 'lee', 'leg', 'leo', 'let', 'bay', 'log', 'low', 'jug', 'jul', 'jay', 'jar', 'aes', 'btw', 'tlc', 'off', 'oft', 'web', 'wee', 'wed', 'wes', 'wer', 'wet', 'ink', 'ing', 'ina', 'hps', 'ale', 'ala', 'bro', 'ere', 'lab', 'lay', 'law', 'zen', 'kin', 'sue', 'sun', 'yew', 'ill', 'air', 'aim', 'aid', 'thy', 'thu', 'tho', 'the', 'way', 'wax', 'was', 'war', 'fog', 'gum', 'gus', 'guy', 'fbi', 'jan', 'ibm', 'car', 'caw', 'can', 'aon', 'not', 'nov', 'now', 'nor', 'nos', 'zap', 'yin', 'egg', 'cen', 'sri', 'lol', 'los', 'lot', 'you', 'mph', 'ask', 'ash', 'awe', 'ego', 'dia', 'asc', 'put', 'str', 'lie', 'lia', 'lib', 'lit', 'lip', 'wow', 'won', 'ads', 'phu', 'bon', 'eel', 'run', 'cue', 'nam', 'ech', 'mad', 'mal', 'ben', 'bel', 'beg', 'bed', 'arc', 'bet', 'she', 'ken', 'oak', 'esp', 'dug', 'eat', 'aug', 'neo', 'new', 'net', 'men', 'met', 'dry', 'ise', 'tyr', 'don', 'doc', 'dog', 'bar', 'bag', 'bad', 'ban', 'sam', 'kid', 'yep', 'yes', 'yer', 'yet', 'dio', 'did', 'die', 'dig', 'dip', 'box', 'boy', 'bot', 'bow', 'bob', 'bod', 'bog', 'fly', 'map', 'mas', 'mar', 'may', 'max', 'mac', 'mao', 'man', 'lsd', 'ort', 'orb', 'las', 'get', 'par', 'yrs', 'pay', 'pan', 'oir', 'moy', 'mor', 'mov', 'tap', 'eye', 'two', 'der', 'dew', 'del', 'dec', 'oil', 'gif', 'cfn', 'gas', 'gap', 'fur', 'raw', 'fun', 'ray', 'cut', 'win', 'big', 'bid', 'apt', 'bit', 'per', 'pen', 'ufo', 'lyr', 'hal', 'chi', 'chs', 'iii', 'afa', 'sip', 'tsp', 'dad', 'dai', 'das', 'day', 'cwn', 'red', 'quo', 'mid', 'mix', 'adf', 'add', 'est', 'dcw', 'buy', 'but', 'bud', 'pin', 'pig', 'our', 'pit', 'end', 'gom', 'god', 'sow', 'got', 'tos', 'top', 'tow', 'too', 'tom', 'toe', 'ran', 'rap', 'abc', 'oct', 'nut', 'mud', 'rit', 'via', 'ice', 'ahp', 'uri', 'tir', 'til', 'tim', 'tin', 'rom', 'rob', 'rod', 'ard', 'msg', 'ahn', 'shu', 'iad', 'iaa', 'iau', 'hug', 'and', 'ann', 'any', 'tip', 'tie', 'jun', 'cbs', 'hit', 'ley', 'all', 'ptv', 'far', 'fan', 'fal', 'fad', 'teh', 'ten', 'tea', 'sum', 'hig', 'nan', 'ieo', 'hip', 'his', 'him', 'art', 'are', 'arm', 'lap', 'key', 'dun', 'dub', 'due', 'rim', 'rig', 'rid', 'row', 'cit', 'cad', 'apr', 'use', 'feb', 'usa', 'few', 'tax', 'tao', 'sir', 'sit', 'six', 'sid', 'sin', 'out', 'who', 'why', 'ear', 'joy', 'job', 'joe', 'jog', 'bbi', 'bbs', 'non', 'nob', 'sky', 'own', 'owe', 'van', 'four', 'pack', 'lore', 'lord', 'dell', 'foul', 'hero', 'herb', 'hera', 'here', 'cult', 'dorn', 'unit', 'holy', 'hurt', 'hole', 'hold', 'wand', 'want', 'dyke', 'turn', 'wins', 'wind', 'wine', 'vary', 'inar', 'wast', 'wash', 'legs', 'tree', 'idle', 'apre', 'that', 'cops', 'camp', 'came', 'prif', 'busy', 'ment', 'rich', 'blew', 'fair', 'pads', 'fail', 'fain', 'best', 'lots', 'dorm', 'diff', 'slay', 'much', 'life', 'dave', 'lift', 'suas', 'doth', 'spin', 'topy', 'tune', 'ease', 'wrap', 'nova', 'jane', 'lays', 'dues', 'role', 'enya', 'yhvh', 'time', 'push', 'gown', 'jerk', 'sign', 'ordo', 'melt', 'love', 'spot', 'date', 'such', 'kong', 'torc', 'webs', 'plea', 'raed', 'lbrp', 'vote', 'open', 'city', 'bite', 'cite', 'note', 'take', 'knew', 'knee', 'ways', 'bade', 'salt', 'laws', 'slow', 'robe', 'many', 'twin', 'boar', 'boat', 'west', 'brow', 'monk', 'nile', 'knot', 'rest', 'sums', 'dark', 'dare', 'clad', 'meal', 'bond', 'wade', 'with', 'pull', 'rush', 'rags', 'gone', 'yoga', 'mass', 'adam', 'tain', 'nora', 'sand', 'sank', 'past', 'pass', 'full', 'hast', 'pick', 'luck', 'mord', 'more', 'door', 'doom', 'sent', 'male', 'bogs', 'scam', 'huge', 'hugh', 'hugs', 'bowl', 'bows', 'ally', 'odin', 'shop', 'isle', 'week', 'ness', 'crow', 'zeus', 'hyde', 'sell', 'self', 'play', 'plan', 'tips', 'gold', 'burp', 'rite', 'nope', 'fame', 'thou', 'thor', 'bell', 'sees', 'firm', 'fire', 'fung', 'owed', 'mote', 'owen', 'read', 'caer', 'unto', 'reap', 'hues', 'sion', 'pale', 'into', 'span', 'suit', 'linn', 'link', 'atom', 'line', 'chan', 'chao', 'chap', 'tara', 'bush', 'land', 'code', 'send', 'wipe', 'pout', 'race', 'bird', 'thin', 'stag', 'mens', 'next', 'rick', 'babe', 'baby', 'this', 'pour', 'bent', 'loch', 'rode', 'high', 'bend', 'rods', 'pair', 'tied', 'fits', 'ties', 'hawk', 'move', 'lamp', 'earl', 'ship', 'kiss', 'mete', 'shut', 'veov', 'muin', 'eryn', 'awen', 'soak', 'awed', 'soar', 'visa', 'face', 'brew', 'fact', 'hops', 'mute', 'tape', 'hope', 'fewr', 'reis', 'wire', 'ends', 'drum', 'drug', 'lush', 'site', 'lust', 'sits', 'juan', 'ball', 'dusk', 'upon', 'dust', 'lest', 'paul', 'five', 'does', 'naff', 'iris', 'asks', 'mere', 'veil', 'rule', 'cian', 'owes', 'horn', 'neat', 'bhur', 'plot', 'ploy', 'yard', 'word', 'wore', 'work', 'worn', 'nuts', 'hong', 'arch', 'then', 'them', 'thee', 'safe', 'bang', 'sack', 'they', 'ther', 'bank', 'nudd', 'tops', 'mojo', 'neck', 'airy', 'john', 'rath', 'nana', 'aunt', 'just', 'runs', 'gaul', 'rune', 'rung', 'away', 'bolt', 'brad', 'bran', 'tone', 'tong', 'tons', 'axis', 'easy', 'east', 'cons', 'cone', 'cong', 'muid', 'rail', 'evil', 'hand', 'hans', 'kept', 'gods', 'soap', 'dwyr', 'born', 'bore', 'hare', 'post', 'pays', 'lewd', 'breo', 'crys', 'true', 'iisi', 'isis', 'anew', 'mold', 'test', 'bedw', 'zone', 'slip', 'cost', 'buch', 'labs', 'live', 'club', 'clue', 'coll', 'cold', 'halt', 'evoe', 'half', 'hall', 'wont', 'drop', 'year', 'carl', 'card', 'care', 'size', 'pomp', 'than', 'fork', 'slan', 'loki', 'only', 'urdr', 'pray', 'aura', 'scot', 'ruby', 'joke', 'lite', 'noah', 'real', 'ream', 'lady', 'llew', 'vahv', 'wolf', 'your', 'area', 'ares', 'poor', 'peat', 'peak', 'pooh', 'pool', 'very', 'verb', 'bass', 'cues', 'dion', 'nine', 'alby', 'lyre', 'rude', 'kuno', 'help', 'soon', 'carn', 'held', 'eros', 'hine', 'fool', 'food', 'foot', 'tear', 'jaws', 'bhar', 'bast', 'bald', 'azif', 'dirt', 'base', 'dire', 'bash', 'misc', 'mist', 'ascs', 'grew', 'grey', 'greg', 'hips', 'pans', 'less', 'mell', 'hype', 'oobe', 'both', 'elsa', 'else', 'pact', 'look', 'loop', 'sham', 'used', 'uses', 'moby', 'ioho', 'game', 'some', 'lips', 'gaia', 'step', 'ache', 'eons', 'duly', 'dips', 'reed', 'hail', 'dull', 'info', 'hair', 'gaze', 'hint', 'draw', 'aser', 'mhol', 'drag', 'dram', 'nuns', 'wave', 'orov', 'jump', 'celt', 'cell', 'crab', 'ride', 'meet', 'fare', 'mode', 'ills', 'keep', 'keen', 'omen', 'bare', 'bard', 'need', 'able', 'wyrd', 'envy', 'tire', 'rash', 'tirs', 'gray', 'wish', 'grab', 'cuts', 'tenm', 'joys', 'tend', 'tent', 'sole', 'magi', 'magh', 'poem', 'poee', 'poet', 'ufos', 'mail', 'owns', 'well', 'bohr', 'sufi', 'dose', 'dair', 'dost', 'vide', 'kick', 'fate', 'lost', 'ring', 'roth', 'lose', 'page', 'shed', 'shea', 'hush', 'home', 'eris', 'eric', 'star', 'stay', 'stan', 'bays', 'void', 'vast', 'yack', 'even', 'ever', 'drew', 'omar', 'hiya', 'arms', 'maes', 'call', 'calm', 'type', 'tell', 'wars', 'warn', 'warm', 'room', 'roof', 'akin', 'akim', 'root', 'give', 'egos', 'deck', 'crew', 'meat', 'mead', 'went', 'side', 'bone', 'mean', 'nave', 'navy', 'aids', 'dawn', 'loud', 'hook', 'hoof', 'mini', 'seer', 'mind', 'mine', 'seed', 'seen', 'seem', 'seek', 'stop', 'earn', 'told', 'ears', 'said', 'vows', 'puts', 'tiny', 'neal', 'ugly', 'near', 'make', 'left', 'nota', 'save', 'nude', 'dean', 'deal', 'dead', 'dear', 'veda', 'burn', 'bury', 'down', 'lies', 'dowm', 'form', 'ford', 'fort', 'zeno', 'toss', 'dies', 'felt', 'fell', 'died', 'skip', 'mild', 'mile', 'skin', 'gaea', 'item', 'anna', 'adds', 'stem', 'wait', 'sake', 'thru', 'soul', 'pink', 'rays', 'idir', 'pine', 'till', 'pure', 'pins', 'idic', 'guys', 'grow', 'tale', 'tall', 'talk', 'ours', 'main', 'beil', 'rock', 'girt', 'girl', 'lone', 'fast', 'eyes', 'memo', 'lugh', 'orgy', 'were', 'lick', 'dash', 'pain', 'paid', 'beth', 'shot', 'show', 'data', 'mung', 'seat', 'sean', 'seal', 'ogma', 'nose', 'arts', 'mark', 'mars', 'mary', 'wake', 'manx', 'same', 'tout', 'pile', 'grip', 'grid', 'grin', 'mare', 'roam', 'road', 'gort', 'deer', 'deep', 'film', 'fill', 'sunk', 'fall', 'none', 'tuan', 'hour', 'maps', 'stir', 'sect', 'pens', 'late', 'good', 'otto', 'rank', 'harm', 'hark', 'hard', 'idea', 'fist', 'harp', 'dont', 'done', 'park', 'part', 'ages', 'most', 'fine', 'find', 'ruis', 'sill', 'vine', 'lion', 'acts', 'fang', 'afar', 'amam', 'bill', 'keys', 'task', 'howe', 'snow', 'snag', 'clan', 'back', 'lark', 'epic', 'from', 'trad', 'boys', 'cure', 'curl', 'yang', 'lend', 'papa', 'lens', 'lent', 'crop', 'body', 'sins', 'sinn', 'sink', 'sing', 'oval', 'fete', 'bind', 'koad', 'kids', 'mate', 'tide', 'have', 'text', 'gorm', 'mica', 'isha', 'beat', 'bear', 'beam', 'halo', 'pulp', 'bull', 'bulb', 'amke', 'hubs', 'file', 'deed', 'sets', 'llyr', 'lake', 'atha', 'like', 'heed', 'soft', 'heel', 'guff', 'host', 'tomb', 'wise', 'flys', 'goin', 'oral', 'yell', 'tibs', 'hath', 'hate', 'risk', 'siul', 'rise', 'nail', 'blue', 'hide', 'sung', 'path', 'must', 'join', 'norn', 'gate', 'mess', 'amid', 'over', 'fade', 'alex', 'each', 'laid', 'sane', 'nite', 'hang', 'free', 'fred', 'rain', 'days', 'heck', 'onto', 'tool', 'took', 'glow', 'flow', 'leis', 'pope', 'sage', 'pops', 'kali', 'weak', 'boss', 'wear', 'news', 'been', 'beer', 'jean', 'gave', 'gifs', 'gift', 'hunt', 'hung', 'cord', 'core', 'corn', 'corp', 'bath', 'rely', 'head', 'heal', 'heat', 'hear', 'trim', 'when', 'whem', 'indo', 'bile', 'town', 'cook', 'cool', 'says', 'port', 'hymn', 'goes', 'iron', 'plug', 'plus', 'yule', 'term', 'name', 'miss', 'view', 'cope', 'alan', 'copy', 'wide', 'oath', 'diug', 'duir', 'rent', 'duit', 'urge', 'sure', 'mbeo', 'trom', 'troy', 'hack', 'wood', 'wool', 'ozma', 'come', 'duty', 'pole', 'case', 'cash', 'cast', 'trip', 'lute', 'weep', 'kill', 'blow', 'blot', 'rose', 'lets', 'rosy', 'ross', 'node', 'mood', 'moon', 'quit', 'cent', 'gary', 'fish', 'wife', 'bapa', 'lack', 'dish', 'song', 'sons', 'hemp', 'list', 'rate', 'what', 'womb', 'flat', 'obod', 'mire', 'flag', 'glad', 'eden', 'omit', 'goal', 'okay', 'jove', 'inch', 'hill', 'feed', 'feel', 'feet', 'king', 'kind', 'danu', 'aims', 'dane', 'dana', 'gall', 'fond', 'font', 'luis', 'dumb', 'bark', 'mban', 'solo', 'sold', 'whom', 'edge', 'gems', 'also', 'pros', 'anne', 'prob', 'long', 'mock', 'nice', 'vice', 'once', 'gang', 'agus', 'fold', 'acid', 'folk', 'rede', 'duck', 'fron', 'cili', 'sort', 'sore', 'tthe', 'flew', 'nuit', 'york', 'nuin', 'obvd', 'cain', 'isbn', 'echo', 'july', 'deny', 'gain', 'fear', 'ones', 'spur', 'viet', 'walk', 'walt', 'lyin', 'mike', 'last', 'wilt', 'will', 'wild', 'thus', 'dual', 'thud', 'gets', 'yoou', 'wren', 'myth', 'know', 'leaf', 'lead', 'lean', 'leap', 'leat', 'obey', 'pike', 'rare', 'made', 'gaps', 'cake', 'mady', 'cave', 'book', 'sick', 'junk', 'agla', 'june', 'jung', 'sase', 'pods', 'woods', 'knelt', 'tired', 'pulse', 'atoms', 'china', 'uisci', 'norse', 'spoke', 'music', 'until', 'relax', 'glass', 'blade', 'pints', 'wrong', 'types', 'keeps', 'wales', 'thyme', 'fnord', 'arrow', 'bowls', 'mayan', 'adapt', 'sheet', 'nigel', 'dwale', 'spawn', 'sooth', 'alive', 'doors', 'henge', 'shall', 'wells', 'mouth', 'entry', 'shalt', 'grove', 'runic', 'gauge', 'theme', 'bliss', 'pelen', 'plate', 'plato', 'afall', 'rings', 'score', 'never', 'lamac', 'logic', 'argue', 'asked', 'raith', 'union', 'child', 'chill', 'tapes', 'split', 'josey', 'neter', 'veils', 'osman', 'posed', 'birth', 'bobby', 'steph', 'steps', 'right', 'crowd', 'creed', 'crown', 'bruig', 'nixon', 'nglas', 'waits', 'avail', 'untie', 'halls', 'happy', 'offer', 'batle', 'beech', 'otter', 'proud', 'exist', 'floor', 'warms', 'smell', 'palms', 'roimh', 'chain', 'chair', 'midst', 'macha', 'copse', 'edred', 'stays', 'exact', 'cooks', 'unify', 'leave', 'whome', 'badge', 'snack', 'egypt', 'owuld', 'alone', 'along', 'tasks', 'carol', 'angry', 'papal', 'films', 'scope', 'deign', 'honey', 'privy', 'stole', 'deity', 'limbo', 'apron', 'temen', 'deady', 'abide', 'quite', 'poems', 'dunno', 'monks', 'uriel', 'waist', 'sayer', 'prone', 'herds', 'nicer', 'alley', 'allen', 'aside', 'pages', 'drive', 'lotus', 'cloak', 'tears', 'going', 'imbas', 'touch', 'prime', 'where', 'mecca', 'clips', 'sites', 'acome', 'garda', 'spark', 'geese', 'wants', 'pinks', 'ascii', 'shuti', 'anseo', 'genie', 'lambs', 'nessa', 'being', 'world', 'snare', 'fives', 'brits', 'troth', 'lucid', 'refer', 'power', 'stone', 'niall', 'other', 'image', 'ciabh', 'myths', 'vanir', 'dirty', 'agree', 'tight', 'herbs', 'thorn', 'groom', 'hello', 'thorr', 'smile', 'cable', 'large', 'harry', 'small', 'hours', 'prior', 'pulls', 'trips', 'goeth', 'leary', 'learn', 'salty', 'bated', 'plant', 'plane', 'waves', 'scota', 'paper', 'scott', 'signs', 'trads', 'roots', 'isaac', 'found', 'eddas', 'ditch', 'zwack', 'rises', 'pairs', 'major', 'gazed', 'guess', 'heads', 'saint', 'grace', 'vocal', 'shops', 'virus', 'emyrs', 'seize', 'cover', 'coven', 'piper', 'xeper', 'wayne', 'cowan', 'beams', 'sunny', 'hilts', 'thoth', 'cease', 'river', 'movie', 'kneel', 'death', 'pagan', 'harps', 'whole', 'acted', 'devin', 'devil', 'teann', 'races', 'awake', 'error', 'cages', 'pound', 'sabha', 'chase', 'funny', 'cigar', 'alert', 'leaps', 'focal', 'picks', 'feces', 'kelly', 'ahura', 'quest', 'spine', 'scape', 'canst', 'maige', 'sighs', 'sight', 'pools', 'santa', 'doubt', 'opens', 'codes', 'evohe', 'swirl', 'sided', 'sides', 'holey', 'fresh', 'essay', 'totem', 'stops', 'young', 'mytle', 'darra', 'magic', 'marry', 'fewer', 'reich', 'imply', 'video', 'ithin', 'index', 'anton', 'punch', 'great', 'makes', 'maker', 'tools', 'folks', 'mabon', 'await', 'ombos', 'allow', 'rilla', 'decay', 'necht', 'betty', 'truth', 'doing', 'books', 'banal', 'ewige', 'venom', 'tempo', 'spill', 'could', 'david', 'blown', 'scene', 'stark', 'owner', 'blows', 'prank', 'start', 'stars', 'haven', 'steed', 'false', 'linda', 'bring', 'brink', 'pause', 'meant', 'bonds', 'lucky', 'stuff', 'exude', 'frame', 'liken', 'cense', 'marty', 'muine', 'beach', 'waste', 'eaton', 'groin', 'mutat', 'drink', 'audio', 'snake', 'flesh', 'gulls', 'rooms', 'photo', 'taunt', 'fools', 'criss', 'yearn', 'onnen', 'grids', 'thier', 'avoid', 'hadit', 'stage', 'seeds', 'burma', 'erect', 'roads', 'afoot', 'ovovo', 'yarns', 'gwion', 'count', 'calls', 'irish', 'jesse', 'tides', 'ghost', 'walks', 'worth', 'pinch', 'brill', 'above', 'sinks', 'pluto', 'items', 'study', 'adopt', 'dowth', 'total', 'dilly', 'reign', 'mages', 'india', 'knees', 'sever', 'after', 'uisce', 'greet', 'greek', 'green', 'south', 'worst', 'order', 'greed', 'break', 'bread', 'rocks', 'doled', 'flock', 'forty', 'forth', 'renew', 'comic', 'rated', 'mercy', 'binds', 'guilt', 'banes', 'reall', 'gravy', 'bruce', 'aesir', 'lewis', 'toast', 'elite', 'steel', 'nasty', 'steal', 'draws', 'props', 'drawn', 'terms', 'gable', 'trunk', 'wider', 'speak', 'ahead', 'beith', 'voice', 'wheel', 'horus', 'swell', 'hills', 'shout', 'board', 'night', 'mazes', 'hypoc', 'sends', 'humor', 'hodge', 'float', 'fight', 'palce', 'moors', 'dying', 'songs', 'dance', 'flash', 'turns', 'woven', 'upper', 'curse', 'argee', 'genes', 'trial', 'triad', 'extra', 'prove', 'super', 'ninny', 'gwynn', 'eidos', 'purge', 'heart', 'topic', 'heard', 'occur', 'means', 'write', 'nosed', 'wwhat', 'brain', 'whats', 'still', 'birds', 'forms', 'saxon', 'feats', 'james', 'couls', 'goose', 'fires', 'album', 'shown', 'space', 'shows', 'thong', 'blind', 'madam', 'beest', 'drove', 'sheep', 'dawns', 'baldr', 'muide', 'shady', 'angel', 'craig', 'anger', 'dread', 'begin', 'prick', 'shade', 'price', 'fifth', 'ratio', 'stair', 'title', 'skith', 'truly', 'loath', 'keyed', 'burst', 'sport', 'huggs', 'pluck', 'blame', 'hurts', 'comes', 'jeans', 'cares', 'crumb', 'these', 'trick', 'celts', 'conys', 'worry', 'sould', 'proto', 'media', 'whyte', 'medic', 'noble', 'fruit', 'heaps', 'speed', 'parts', 'verse', 'rules', 'ruler', 'gonna', 'early', 'using', 'stuns', 'ruled', 'faire', 'fairs', 'nuada', 'sixth', 'throw', 'lymph', 'fraud', 'tones', 'moved', 'oisin', 'salem', 'moves', 'valid', 'month', 'corps', 'nodes', 'robes', 'robed', 'coals', 'loose', 'arena', 'aball', 'aimed', 'lagoz', 'teach', 'takes', 'girds', 'taken', 'broke', 'hurry', 'lacks', 'tried', 'tries', 'banks', 'dream', 'match', 'fines', 'finer', 'vomit', 'payer', 'fully', 'bless', 'fairy', 'heavy', 'event', 'warts', 'since', 'dearg', 'issue', 'stead', 'inert', 'knots', 'elder', 'craps', 'horse', 'storm', 'tunic', 'bride', 'quote', 'clear', 'cleat', 'clean', 'blend', 'pucas', 'withe', 'close', 'duinn', 'vault', 'liked', 'stamp', 'empty', 'lived', 'packs', 'heute', 'while', 'smart', 'fleet', 'guide', 'reads', 'ready', 'grant', 'grand', 'older', 'cedar', 'olden', 'elect', 'elven', 'yeahm', 'maeve', 'march', 'wings', 'holes', 'modus', 'infra', 'feill', 'taboo', 'shine', 'faith', 'gnome', 'kwiat', 'alpha', 'frost', 'malik', 'fears', 'orbit', 'neils', 'bribe', 'etain', 'oliva', 'suits', 'suite', 'tonal', 'plays', 'chant', 'pitch', 'cloud', 'cosmo', 'drops', 'duile', 'hides', 'links', 'echos', 'trees', 'ruadh', 'feels', 'ogham', 'boils', 'outer', 'broom', 'abred', 'sword', 'hands', 'front', 'slide', 'chunk', 'cause', 'sneer', 'paten', 'shred', 'timed', 'spots', 'bears', 'ankle', 'final', 'lists', 'claim', 'screw', 'edric', 'based', 'bases', 'dodge', 'slows', 'joint', 'joins', 'years', 'state', 'dogon', 'merry', 'thumb', 'mindy', 'minds', 'admit', 'lofty', 'kings', 'tread', 'wills', 'treat', 'novel', 'chalk', 'bucks', 'began', 'begat', 'party', 'gaoth', 'skill', 'ought', 'clown', 'likes', 'peter', 'murry', 'inner', 'north', 'xerox', 'goals', 'leper', 'cells', 'limit', 'piece', 'beats', 'conan', 'lives', 'liver', 'aided', 'whose', 'sorry', 'fists', 'force', 'saved', 'niche', 'spiel', 'moral', 'barks', 'oscar', 'cuups', 'dogma', 'adult', 'flora', 'guise', 'foods', 'thine', 'laida', 'third', 'jacob', 'weeks', 'kesey', 'grade', 'girls', 'dwell', 'helen', 'bikka', 'silly', 'caled', 'tells', 'chest', 'atman', 'marie', 'doves', 'dover', 'debts', 'coast', 'bhall', 'cower', 'zones', 'sorta', 'sorts', 'weary', 'scuba', 'lowly', 'ether', 'lttle', 'basis', 'three', 'basic', 'threw', 'seven', 'shame', 'grown', 'bella', 'grows', 'bells', 'meets', 'smoke', 'yours', 'human', 'facts', 'nudge', 'meath', 'jeeah', 'dense', 'track', 'beget', 'faery', 'azure', 'nerve', 'coins', 'erinn', 'sagas', 'suebi', 'gland', 'vista', 'holly', 'aware', 'daily', 'souls', 'marks', 'round', 'seidr', 'visit', 'rigid', 'olive', 'bites', 'lords', 'crazy', 'agent', 'swore', 'wicca', 'waxen', 'maybe', 'block', 'serge', 'tales', 'shake', 'clans', 'group', 'thank', 'views', 'boats', 'ruddy', 'cough', 'thing', 'think', 'first', 'carry', 'murky', 'slept', 'fiery', 'gotta', 'kevin', 'squaw', 'trace', 'enter', 'aloud', 'tract', 'eadha', 'fills', 'ladle', 'black', 'helix', 'sidhe', 'hippo', 'hippy', 'skull', 'yield', 'dagda', 'dates', 'among', 'barry', 'sound', 'issac', 'handy', 'weave', 'conor', 'solve', 'gates', 'money', 'forge', 'adams', 'titan', 'erase', 'gross', 'ellis', 'lunar', 'knife', 'tease', 'mixed', 'vigil', 'strip', 'fates', 'rider', 'adler', 'gaels', 'hound', 'midhe', 'boons', 'casts', 'talks', 'those', 'furze', 'steve', 'angus', 'hogan', 'stood', 'garth', 'bible', 'liber', 'wiped', 'canon', 'sylph', 'halts', 'biodh', 'share', 'needs', 'sired', 'lythe', 'blood', 'kegan', 'heirs', 'bosom', 'balor', 'walls', 'ashes', 'token', 'house', 'deals', 'podge', 'print', 'least', 'paint', 'sated', 'rates', 'stirs', 'youth', 'built', 'couch', 'onset', 'build', 'flute', 'chart', 'charm', 'giant', 'gilly', 'celyn', 'ovate', 'aldus', 'rover', 'sigil', 'cakes', 'point', 'raise', 'inoke', 'solid', 'lingo', 'realm', 'spent', 'flags', 'spend', 'alder', 'gheal', 'shape', 'hated', 'hates', 'knock', 'dtoil', 'often', 'scale', 'smail', 'crone', 'goods', 'yorba', 'drama', 'piled', 'ounce', 'phase', 'grave', 'hoped', 'hopes', 'adair', 'metal', 'ellen', 'druim', 'druid', 'druis', 'wards', 'dhuit', 'querc', 'fitch', 'tombs', 'quert', 'helps', 'queen', 'rhyme', 'tinne', 'pipes', 'gimle', 'safer', 'drank', 'climb', 'proof', 'honor', 'named', 'drums', 'names', 'train', 'hints', 'fetch', 'bones', 'holds', 'orson', 'lines', 'linen', 'chief', 'lands', 'horns', 'bunch', 'labor', 'pangs', 'spell', 'cider', 'faidh', 'cures', 'sadly', 'scant', 'loved', 'draoi', 'lover', 'waken', 'hazel', 'eight', 'sally', 'gurus', 'staff', 'areas', 'organ', 'fixed', 'rowan', 'legis', 'equal', 'sexes', 'laugh', 'thsis', 'plain', 'value', 'esras', 'diety', 'whirr', 'again', 'usual', 'chord', 'seats', 'tough', 'spear', 'field', 'crops', 'raven', 'tests', 'testy', 'dirac', 'ozone', 'works', 'awash', 'prose', 'noise', 'panel', 'gifts', 'about', 'evoke', 'guard', 'hexed', 'globe', 'ivory', 'misty', 'glory', 'mists', 'ledge', 'pupil', 'sleep', 'paris', 'under', 'pride', 'every', 'venus', 'enjoy', 'seeks', 'druel', 'forum', 'stray', 'julia', 'would', 'raids', 'naive', 'phone', 'tampa', 'henry', 'shook', 'bothy', 'times', 'badly', 'canto', 'edits', 'diana', 'newly', 'wowed', 'sobek', 'pyres', 'awoke', 'sober', 'serve', 'gulfs', 'roles', 'aztec', 'flame', 'beket', 'mirth', 'beard', 'bards', 'pylon', 'cleff', 'clock', 'radio', 'queer', 'earth', 'spite', 'watch', 'tammy', 'haite', 'aught', 'beads', 'twice', 'shots', 'swept', 'habit', 'wakan', 'tommy', 'mazda', 'faced', 'fault', 'games', 'faces', 'trust', 'drugs', 'craft', 'catch', 'broth', 'wound', 'lusty', 'sings', 'welsh', 'cycle', 'ocean', 'torah', 'thick', 'suzan', 'judge', 'burns', 'rumor', 'apart', 'adieu', 'usher', 'armed', 'foote', 'khaki', 'choke', 'civil', 'class', 'stuck', 'solar', 'annwn', 'adore', 'check', 'eerie', 'navel', 'focus', 'leads', 'tanka', 'level', 'quick', 'doeth', 'fearn', 'cyber', 'colin', 'dried', 'spiro', 'reply', 'hairs', 'dazed', 'water', 'witch', 'boast', 'weird', 'isles', 'vivid', 'runes', 'tubes', 'today', 'altar', 'lazlo', 'cases', 'piano', 'wands', 'rufus', 'boris', 'nexus', 'sense', 'nuber', 'bigot', 'gulik', 'vital', 'rites', 'amuse', 'chips', 'swans', 'bound', 'opera', 'torch', 'torcs', 'begun', 'plans', 'eagle', 'flyer', 'place', 'swing', 'feign', 'given', 'white', 'circa', 'giver', 'gives', 'lacha', 'cards', 'mated', 'sells', 'ideas', 'ideal', 'falls', 'later', 'uncle', 'perch', 'cheap', 'dirge', 'crime', 'trade', 'olaus', 'naked', 'scots', 'fails', 'shiva', 'seers', 'quiet', 'cabal', 'color', 'deeds', 'abdul', 'cords', 'maire', 'shaft', 'mound', 'thses', 'arose', 'raibh', 'model', 'seems', 'kills', 'boyne', 'acute', 'inate', 'fount', 'tower', 'tarot', 'table', 'frees', 'legal', 'freed', 'raths', 'stand', 'hindu', 'amber', 'tribe', 'there', 'beret', 'grasp', 'grass', 'taste', 'tasty', 'abyss', 'wkshp', 'trash', 'brass', 'oriel', 'curve', 'ments', 'seals', 'woman', 'worse', 'awful', 'vibes', 'brief', 'texts', 'faint', 'wield', 'minor', 'knows', 'waxed', 'known', 'ouija', 'brown', 'arise', 'court', 'maith', 'cults', 'short', 'susan', 'style', 'abbey', 'might', 'alter', 'odubh', 'loops', 'huath', 'roofs', 'fancy', 'blank', 'story', 'comfy', 'syrup', 'store', 'pains', 'hotel', 'exert', 'oaken', 'alike', 'fionn', 'added', 'reach', 'react', 'niver', 'liath', 'lying', 'gains', 'wrote', 'blurb', 'latin', 'epona', 'herne', 'roman', 'finds', 'cynic', 'sweet', 'sweep', 'goats', 'brick', 'miles', 'apear', 'paths', 'flows', 'birch', 'lower', 'redes', 'tends', 'jumps', 'aloft', 'plaza', 'range', 'wanne', 'wanna', 'muzak', 'canal', 'files', 'cloth', 'filed', 'crane', 'freak', 'stick', 'rally', 'peace', 'gloss', 'risin', 'karma', 'broad', 'alien', 'winds', 'simon', 'abode', 'notes', 'dealt', 'dealy', 'noted', 'folds', 'poets', 'chuid', 'chose', 'lends', 'matov', 'apple', 'apply', 'grian', 'porch', 'women', 'roich', 'sakes', 'clues', 'asily', 'abuse', 'light', 'looks', 'quake', 'ships', 'crash', 'enemy', 'crass', 'feast', 'chaos', 'chaol', 'pours', 'hence', 'their', 'shell', 'scone', 'reeks', 'which', 'clasp', 'stove', 'utter', 'local', 'words', 'ended', 'truer', 'magus', 'favor', 'swift', 'grain', 'grail', 'tutor', 'ysgaw', 'anois', 'layer', 'motif', 'pikes', 'cross', 'unite', 'unity', 'units', 'slave', 'idris', 'cried', 'cries', 'tawny', 'press', 'gypsy', 'miami', 'loses', 'hosts', 'nagas', 'noose', 'pasts', 'urged', 'swear', 'sweat', 'brush', 'fired', 'siuil', 'funds', 'below', 'ailim', 'hymns', 'lance', 'kinds', 'cliff', 'yellow', 'verses', 'outwit', 'tingle', 'oceans', 'wooden', 'piling', 'ornate', 'second', 'sailed', 'errors', 'golden', 'strike', 'whorls', 'brings', 'hereby', 'locked', 'pursue', 'tuatha', 'exhale', 'unjust', 'travel', 'drying', 'beauty', 'youths', 'kokomo', 'preeve', 'hidden', 'easier', 'enrich', 'silver', 'rumour', 'barton', 'snakes', 'series', 'george', 'speeds', 'needed', 'master', 'listed', 'bitter', 'listen', 'danish', 'wisdom', 'doreen', 'showed', 'outlaw', 'endure', 'person', 'scummy', 'figger', 'object', 'letter', 'snares', 'brehon', 'mating', 'scream', 'saying', 'layout', 'louise', 'fetish', 'jaguar', 'greens', 'radius', 'result', 'hammer', 'stamps', 'extend', 'nature', 'rolled', 'extent', 'summat', 'gheall', 'worked', 'employ', 'played', 'things', 'format', 'beckon', 'babies', 'fairly', 'maxims', 'echoes', 'bergan', 'sleeps', 'prison', 'elders', 'online', 'shadow', 'unique', 'desire', 'remind', 'people', 'hoover', 'bottom', 'shakes', 'losing', 'bowing', 'collen', 'raised', 'danaan', 'beings', 'raises', 'shoots', 'joseph', 'utmost', 'inside', 'solong', 'proved', 'proven', 'oscail', 'intend', 'models', 'taurus', 'intent', 'cupped', 'recipe', 'choice', 'minute', 'amoral', 'skewed', 'solved', 'settle', 'erotic', 'freaks', 'ground', 'honour', 'carill', 'tyoing', 'saints', 'prefer', 'druids', 'helter', 'loving', 'visual', 'virtue', 'riders', 'nether', 'values', 'winter', 'mythos', 'missal', 'stress', 'briony', 'pulled', 'scents', 'aeonic', 'augury', 'course', 'derive', 'solace', 'dwarfs', 'nroogd', 'nation', 'amulet', 'thuinn', 'square', 'herard', 'astral', 'sorcha', 'shores', 'impure', 'routes', 'spoked', 'saving', 'spoken', 'clause', 'submit', 'mannan', 'loveth', 'typing', 'thetis', 'future', 'gwyned', 'russia', 'sophia', 'turned', 'buried', 'nymphs', 'towers', 'airing', 'crealm', 'bright', 'artist', 'borrow', 'priest', 'liable', 'vision', 'pisces', 'dexter', 'harvey', 'bureau', 'jumper', 'screen', 'planes', 'loudly', 'riddle', 'breath', 'enable', 'benoit', 'formed', 'photos', 'extant', 'former', 'tribal', 'region', 'zonked', 'flocks', 'pacing', 'summer', 'joyful', 'around', 'yearly', 'racial', 'divine', 'thinks', 'biased', 'phagos', 'dagdha', 'burial', 'legged', 'lively', 'gennep', 'cultic', 'buying', 'abused', 'naming', 'shevet', 'glenda', 'johnny', 'forgot', 'carved', 'novice', 'waving', 'caused', 'urbane', 'causes', 'paying', 'sabbat', 'laying', 'joined', 'healed', 'healer', 'seemed', 'method', 'dwells', 'legend', 'fergus', 'bestow', 'action', 'filial', 'select', 'casket', 'coyote', 'ghrian', 'stated', 'cosmic', 'staten', 'accept', 'states', 'gallon', 'pogrom', 'refuse', 'termed', 'gerald', 'hounds', 'olivia', 'misuse', 'always', 'truths', 'osiris', 'arrray', 'detect', 'waking', 'reduce', 'finish', 'scribe', 'really', 'missed', 'dianic', 'finnen', 'occurs', 'salute', 'belief', 'bedlam', 'murmur', 'reared', 'castle', 'number', 'fluxes', 'ulster', 'justly', 'warmly', 'stifle', 'wessex', 'uscias', 'barred', 'barren', 'impact', 'failed', 'factor', 'wiccan', 'weaved', 'peleus', 'weaver', 'insane', 'potent', 'europe', 'barely', 'agents', 'church', 'satire', 'lovest', 'admire', 'varies', 'triple', 'vanish', 'satyrs', 'survey', 'levels', 'recent', 'expend', 'papyri', 'mandan', 'couple', 'falcon', 'formal', 'facets', 'yields', 'tribes', 'spring', 'bounce', 'mighty', 'behave', 'dating', 'temple', 'clancy', 'pietra', 'repaid', 'sneaky', 'mythic', 'custom', 'inches', 'jewish', 'pastor', 'posted', 'horned', 'mature', 'pineal', 'purges', 'fixing', 'bianca', 'unplug', 'scotch', 'walked', 'purged', 'oracle', 'gleini', 'menace', 'having', 'gossip', 'garden', 'timely', 'pledge', 'fables', 'victor', 'waning', 'indian', 'orainn', 'engage', 'stairs', 'defeat', 'quests', 'eleven', 'pencil', 'zimmer', 'bodily', 'pieces', 'chakra', 'martyr', 'senach', 'animal', 'blocks', 'tomato', 'shapes', 'chosen', 'traced', 'fields', 'statis', 'jagged', 'wander', 'motifs', 'perish', 'greedy', 'surely', 'thrust', 'length', 'system', 'norton', 'quarry', 'bodrun', 'aztecs', 'gently', 'gentle', 'viewed', 'korean', 'sirius', 'device', 'rubric', 'decade', 'smacks', 'should', 'riding', 'handle', 'summon', 'rapped', 'needto', 'galaxy', 'gnomes', 'getyou', 'ollomh', 'engulf', 'waseth', 'dunnan', 'banish', 'basket', 'hahaha', 'tattoo', 'denial', 'spends', 'colour', 'strive', 'warded', 'height', 'become', 'aillil', 'singin', 'wields', 'gained', 'sister', 'chrome', 'suited', 'assess', 'immune', 'camden', 'heresy', 'apollo', 'tossed', 'places', 'smooth', 'placed', 'rubble', 'denote', 'deadly', 'behold', 'monday', 'chance', 'lasted', 'defend', 'oldest', 'davies', 'rocnat', 'chapel', 'upload', 'gaelic', 'totems', 'follow', 'equals', 'secure', 'highly', 'dannan', 'groves', 'gloria', 'impair', 'chilly', 'verify', 'coined', 'retain', 'office', 'devote', 'pascal', 'denver', 'versus', 'lifted', 'kneels', 'evolve', 'hosted', 'hazels', 'sprigg', 'alskog', 'thuban', 'raisin', 'oppose', 'eremon', 'rooted', 'nooses', 'emblem', 'albert', 'jingle', 'wasted', 'gwynyd', 'target', 'scenes', 'seated', 'powers', 'return', 'manner', 'forced', 'latter', 'forces', 'magnum', 'maiden', 'lindow', 'oftenj', 'hindic', 'notion', 'echlyn', 'subtle', 'latent', 'masons', 'vowels', 'roinnt', 'cattle', 'imbolg', 'imbolc', 'pasted', 'unable', 'arcane', 'accord', 'unfold', 'relics', 'warmth', 'duties', 'excite', 'abrupt', 'vernal', 'avoids', 'depict', 'faiths', 'humble', 'humbly', 'indigo', 'quoted', 'newton', 'quotes', 'thanks', 'victim', 'swears', 'hallow', 'spread', 'jehana', 'viking', 'usable', 'alther', 'libhse', 'scaoil', 'purple', 'denied', 'framed', 'theirs', 'months', 'treble', 'amidst', 'lowest', 'rabbis', 'injury', 'veiled', 'flecks', 'lugaid', 'prayed', 'gather', 'manure', 'prayer', 'shrine', 'scored', 'pefect', 'murias', 'matron', 'global', 'battle', 'rhythm', 'terror', 'eliade', 'drakes', 'appear', 'aneris', 'shared', 'appeal', 'muslin', 'change', 'flames', 'pillow', 'marked', 'marker', 'rarely', 'market', 'salted', 'angels', 'slogan', 'decked', 'social', 'purity', 'heroes', 'indeed', 'aiding', 'selves', 'window', 'norway', 'domain', 'happen', 'opened', 'orphic', 'opener', 'cycles', 'honest', 'styles', 'flying', 'silent', 'caught', 'friend', 'mostly', 'brains', 'fruits', 'neatly', 'steady', 'sunset', 'filing', 'sceach', 'german', 'dougal', 'cannon', 'samuel', 'cannot', 'seldom', 'fanned', 'flatly', 'herbal', 'import', 'notice', 'aradia', 'wheels', 'nearby', 'differ', 'failte', 'beaver', 'poetic', 'cuchul', 'breezy', 'breeze', 'poplar', 'struck', 'dishes', 'pounds', 'twelve', 'verbal', 'oscars', 'willie', 'verily', 'mircea', 'grange', 'poured', 'shower', 'trying', 'sheath', 'merest', 'issian', 'diruit', 'dabble', 'gorias', 'gavity', 'ceased', 'carpet', 'foster', 'eldest', 'minded', 'decide', 'finger', 'heaven', 'orgasm', 'casual', 'edited', 'excess', 'strong', 'amoung', 'losses', 'amount', 'family', 'chunks', 'excuse', 'sweeps', 'visage', 'pushes', 'pushed', 'phrase', 'firmly', 'reject', 'anoint', 'minuto', 'wiener', 'huathe', 'bagage', 'beyond', 'payson', 'robert', 'safety', 'houses', 'reason', 'fenian', 'launch', 'scouts', 'assign', 'meadow', 'prople', 'pinned', 'expand', 'bardai', 'raping', 'kindle', 'toward', 'mickey', 'option', 'adrift', 'trance', 'salary', 'raving', 'sturdy', 'latest', 'jehova', 'pretty', 'circle', 'albeit', 'famous', 'during', 'stored', 'arrien', 'howled', 'cuirim', 'horrid', 'segais', 'header', 'vessel', 'partly', 'hoodoo', 'soiled', 'dictum', 'herein', 'belong', 'margot', 'influx', 'bearer', 'dearly', 'toyota', 'sketch', 'parade', 'urgent', 'savage', 'wealth', 'conrad', 'wicker', 'seeing', 'within', 'smells', 'innate', 'oghams', 'wicked', 'adults', 'willed', 'rupert', 'turedh', 'smiles', 'kansas', 'leaned', 'rested', 'oregon', 'knowth', 'wizard', 'athame', 'button', 'lleian', 'picked', 'rotten', 'infuse', 'scythe', 'ramses', 'orkney', 'danger', 'manage', 'infest', 'hiding', 'cheeks', 'sought', 'poetry', 'beatha', 'chiefs', 'thence', 'upward', 'ankles', 'inputs', 'morton', 'reacts', 'austin', 'boring', 'attack', 'punish', 'mantra', 'weiser', 'sewing', 'saolta', 'spleen', 'affair', 'parker', 'anyway', 'likens', 'argues', 'stance', 'cardan', 'ordain', 'preach', 'poular', 'humans', 'canine', 'tosses', 'limits', 'career', 'jersey', 'agreed', 'inhale', 'slowly', 'senses', 'league', 'sensed', 'harder', 'yeself', 'campus', 'chants', 'absorb', 'effect', 'fierce', 'single', 'hecate', 'trials', 'spells', 'idunna', 'logged', 'killed', 'sarsen', 'burden', 'starry', 'repeat', 'quarts', 'bundle', 'muchly', 'refuge', 'primal', 'museum', 'harken', 'signed', 'pumped', 'devise', 'kisses', 'upsets', 'relive', 'fodder', 'canvas', 'acroos', 'sphinx', 'todays', 'pardon', 'demand', 'fronts', 'sigils', 'rescue', 'govern', 'affect', 'baking', 'skills', 'graced', 'vector', 'graces', 'dogmas', 'likely', 'panama', 'lights', 'active', 'luther', 'credit', 'permit', 'joshua', 'sliced', 'guests', 'opovig', 'janine', 'expose', 'frenzy', 'sumbel', 'rights', 'climax', 'faults', 'answer', 'murray', 'censer', 'oswald', 'before', 'chatti', 'better', 'glazed', 'taught', 'decree', 'reader', 'grease', 'linear', 'resume', 'shaggy', 'setian', 'aphrod', 'starts', 'plains', 'tokens', 'swells', 'begins', 'matter', 'street', 'palace', 'rattle', 'modern', 'wrists', 'points', 'lyrics', 'hunger', 'retire', 'ending', 'poison', 'nevada', 'saturn', 'sinked', 'mayans', 'derwen', 'softly', 'voyage', 'siging', 'staves', 'peyotl', 'peyote', 'tasted', 'bardic', 'lovely', 'deeper', 'sooooo', 'magics', 'jewels', 'deepen', 'affirm', 'tastes', 'melted', 'anchor', 'mexico', 'tugaim', 'parish', 'writer', 'hooded', 'novels', 'butter', 'berate', 'claims', 'givers', 'unfair', 'legion', 'defray', 'rotate', 'dreams', 'signal', 'strife', 'normal', 'goddeu', 'goddes', 'keeper', 'myrdin', 'commit', 'editor', 'builds', 'bounds', 'tucson', 'cosmos', 'boomed', 'sticks', 'covers', 'awhile', 'handed', 'hangin', 'assume', 'undine', 'forthe', 'invent', 'themes', 'primer', 'father', 'string', 'forked', 'nectar', 'gypsie', 'talked', 'eating', 'troops', 'favour', 'filled', 'french', 'merlin', 'monies', 'useful', 'merely', 'pluses', 'cabals', 'repast', 'effort', 'making', 'arrive', 'sample', 'drawer', 'dennis', 'sunday', 'swayed', 'purify', 'hassan', 'shield', 'entity', 'policy', 'truest', 'tucked', 'sooner', 'arrows', 'zurich', 'richly', 'unlock', 'giveth', 'canada', 'living', 'greeks', 'pamela', 'romans', 'pundit', 'waited', 'rachel', 'sounds', 'little', 'anyone', 'knives', 'booted', 'liveth', 'topics', 'voices', 'roster', 'bowels', 'queens', 'jumped', 'uranus', 'corner', 'storms', 'behind', 'dianna', 'stupid', 'moladh', 'asatru', 'wonder', 'enough', 'across', 'august', 'parent', 'cancer', 'cancel', 'lakota', 'unwise', 'rammed', 'coffee', 'middle', 'sudden', 'ooomph', 'straif', 'wisely', 'doctor', 'driseg', 'speech', 'assist', 'driven', 'bottle', 'amazed', 'aspect', 'dipped', 'fucked', 'aiming', 'serves', 'facing', 'served', 'moving', 'images', 'ascent', 'stages', 'overly', 'caring', 'broken', 'visits', 'refers', 'helgen', 'island', 'tupper', 'dagger', 'downey', 'wiping', 'dolmen', 'cabled', 'cables', 'ngetal', 'ofrail', 'waxing', 'tackle', 'grudge', 'neters', 'forget', 'deosil', 'dollar', 'forged', 'washer', 'titled', 'strung', 'titles', 'public', 'beacon', 'enmity', 'stella', 'narrow', 'africa', 'croons', 'landed', 'trelle', 'strain', 'recall', 'remain', 'clergy', 'meeker', 'attain', 'sacred', 'charms', 'advice', 'coming', 'bathed', 'dragon', 'infant', 'odinic', 'winged', 'suffer', 'libido', 'obeyed', 'oxford', 'detach', 'easily', 'habits', 'fiacha', 'mental', 'energy', 'orient', 'lovers', 'flowed', 'backed', 'luisne', 'twenty', 'plexus', 'ordure', 'malice', 'gotten', 'orders', 'salmon', 'syntax', 'thomas', 'cerrig', 'hopped', 'evoked', 'inanna', 'merged', 'remove', 'common', 'gospel', 'devils') |
n1 = float(input("Type the first number: "))
n2 = float(input("Type the second number: "))
print("Are equals?", n1 == n2)
print("Are different?", n1 != n2)
print("First number is greater than Second number? =", n1 > n2)
print("Second is greater or equal than First number ? =", n2 >= n1)
strTest = input("Type a string: ")
conditions = 3 <= len(strTest) < 10
print("The string is greater or equal than 3 and less than 10? =", conditions)
magicNumber = 12345679
userNumber = int(input("Type a random number between 1 and 9:"))
userNumber *= 9
magicNumber *= userNumber
print("The magic number is: ", magicNumber)
| n1 = float(input('Type the first number: '))
n2 = float(input('Type the second number: '))
print('Are equals?', n1 == n2)
print('Are different?', n1 != n2)
print('First number is greater than Second number? =', n1 > n2)
print('Second is greater or equal than First number ? =', n2 >= n1)
str_test = input('Type a string: ')
conditions = 3 <= len(strTest) < 10
print('The string is greater or equal than 3 and less than 10? =', conditions)
magic_number = 12345679
user_number = int(input('Type a random number between 1 and 9:'))
user_number *= 9
magic_number *= userNumber
print('The magic number is: ', magicNumber) |
track = dict(
author_username='ryanholbrook',
course_name='Computer Vision',
course_url='https://www.kaggle.com/ryanholbrook/computer-vision',
course_forum_url='https://www.kaggle.com/learn-forum',
)
TOPICS = [
'The Convolutional Classifier',
'Convolution and ReLU',
'Maximum Pooling',
'The Moving Window',
'Custom Convnets',
'Data Augmentation',
]
lessons = [{'topic': topic_name} for topic_name in TOPICS]
notebooks = [
dict(
filename="tut1.ipynb",
lesson_idx=0,
type='tutorial',
enable_gpu=True,
),
dict(
filename="ex1.ipynb",
lesson_idx=0,
type='exercise',
enable_gpu=True,
),
dict(
filename="tut2.ipynb",
lesson_idx=1,
type='tutorial',
),
dict(
filename="ex2.ipynb",
lesson_idx=1,
type='exercise',
),
dict(
filename="tut3.ipynb",
lesson_idx=2,
type='tutorial',
),
dict(
filename="ex3.ipynb",
lesson_idx=2,
type='exercise',
),
dict(
filename="tut4.ipynb",
lesson_idx=3,
type='tutorial',
),
dict(
filename="ex4.ipynb",
lesson_idx=3,
type='exercise',
),
dict(
filename="tut5.ipynb",
lesson_idx=4,
type='tutorial',
enable_gpu=True,
),
dict(
filename="ex5.ipynb",
lesson_idx=4,
type='exercise',
enable_gpu=True,
),
dict(
filename="tut6.ipynb",
lesson_idx=5,
type='tutorial',
enable_gpu=True,
),
dict(
filename="ex6.ipynb",
lesson_idx=5,
type='exercise',
enable_gpu=True,
),
]
for nb in notebooks:
nb['dataset_sources'] = [
'ryanholbrook/car-or-truck',
'ryanholbrook/computer-vision-resources',
'ryanholbrook/cv-course-models',
]
# Add extra datasets to Exercise 6
if '6' in nb['filename']:
nb['dataset_sources'] += [
'ryanholbrook/tensorflow-flowers',
'ryanholbrook/eurosat',
]
| track = dict(author_username='ryanholbrook', course_name='Computer Vision', course_url='https://www.kaggle.com/ryanholbrook/computer-vision', course_forum_url='https://www.kaggle.com/learn-forum')
topics = ['The Convolutional Classifier', 'Convolution and ReLU', 'Maximum Pooling', 'The Moving Window', 'Custom Convnets', 'Data Augmentation']
lessons = [{'topic': topic_name} for topic_name in TOPICS]
notebooks = [dict(filename='tut1.ipynb', lesson_idx=0, type='tutorial', enable_gpu=True), dict(filename='ex1.ipynb', lesson_idx=0, type='exercise', enable_gpu=True), dict(filename='tut2.ipynb', lesson_idx=1, type='tutorial'), dict(filename='ex2.ipynb', lesson_idx=1, type='exercise'), dict(filename='tut3.ipynb', lesson_idx=2, type='tutorial'), dict(filename='ex3.ipynb', lesson_idx=2, type='exercise'), dict(filename='tut4.ipynb', lesson_idx=3, type='tutorial'), dict(filename='ex4.ipynb', lesson_idx=3, type='exercise'), dict(filename='tut5.ipynb', lesson_idx=4, type='tutorial', enable_gpu=True), dict(filename='ex5.ipynb', lesson_idx=4, type='exercise', enable_gpu=True), dict(filename='tut6.ipynb', lesson_idx=5, type='tutorial', enable_gpu=True), dict(filename='ex6.ipynb', lesson_idx=5, type='exercise', enable_gpu=True)]
for nb in notebooks:
nb['dataset_sources'] = ['ryanholbrook/car-or-truck', 'ryanholbrook/computer-vision-resources', 'ryanholbrook/cv-course-models']
if '6' in nb['filename']:
nb['dataset_sources'] += ['ryanholbrook/tensorflow-flowers', 'ryanholbrook/eurosat'] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved.
"""Contains a dict to validate the app configs"""
VALIDATE_DICT = {
"num_workers": {
"required": False,
"valid_condition": lambda c: True if c >= 1 and c <= 50 else False,
"invalid_msg": "num_workers must be in the range 1 <= 50"
}
}
| """Contains a dict to validate the app configs"""
validate_dict = {'num_workers': {'required': False, 'valid_condition': lambda c: True if c >= 1 and c <= 50 else False, 'invalid_msg': 'num_workers must be in the range 1 <= 50'}} |
'''
PythonExercicios\from math import factorial
number = int(input('Choose a number: '))
result = factorial(number)
print('The factorial of {}! is = {}'.format(number, result))
'''
number = int(input('Choose a number: '))
control = number
result = 1
print('Calculating {}! = '.format(number), end='')
while control > 0:
if control > 1:
print('{} X '.format(control), end='')
else:
print('{} = '.format(control), end='')
if control > 0:
result = result * control
control -= 1
print('{}'.format(result)) | """
PythonExercicios\x0crom math import factorial
number = int(input('Choose a number: '))
result = factorial(number)
print('The factorial of {}! is = {}'.format(number, result))
"""
number = int(input('Choose a number: '))
control = number
result = 1
print('Calculating {}! = '.format(number), end='')
while control > 0:
if control > 1:
print('{} X '.format(control), end='')
else:
print('{} = '.format(control), end='')
if control > 0:
result = result * control
control -= 1
print('{}'.format(result)) |
exclusions = ['\bCHAPTER (\d*|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3}))\.*\b',
'CHAPTER',
'\bChapter \d*\b',
'\d{2}:\d{2}:\d{2},\d{3}\s-->\s\d{2}:\d{2}:\d{2},\d{3}',
'^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\.?\n',
'^[^\w\d\s]*\n',
'^(CLOV|HAMM|NAGG|NELL)\s\([\w\s\d]*\):',
'^(HAMM|NAGG|NELL|CLOV):', '^-\s',
'(Merryn|Hygd|Physician|Goneril|Cordeil|Gormflaith|The Younger Woman|The Elder Woman).*\.',
'^Scene:.+\.\n',
'^Lear.*\.\n',
'^ACT I{0,3}V{0,1}\. Scene \w\.\n',
'^Enter.*\.\n',
'\[.*\n*.*\]',
'Exeunt\.',
'(Glou|Edm|Bur|Corn|Alb|Edg|Cur|Doct|Osw|Capt|Gent|Her|\d\. Serv|Gon|Reg|Cor|Knight)(\.+|,+)\s*\n*',
'(Bast|Glost|Cord|Edgar|Kent|Lear|Alb|Burg|Duke|Reg|Gon|Att|Gent)\.+\n+',
'S C E N E(\.|,)',
'A C T\s+(IV|I+|V)\.?',
'^\^\).*\n',
'Mme\.+\s+',
'^\*\).*\n',
'\d+\n',
'\b\d+\b',
'\d+',
'\"',
'\s+\.\s+'
]
| exclusions = ['\x08CHAPTER (\\d*|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3}))\\.*\x08', 'CHAPTER', '\x08Chapter \\d*\x08', '\\d{2}:\\d{2}:\\d{2},\\d{3}\\s-->\\s\\d{2}:\\d{2}:\\d{2},\\d{3}', '^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\\.?\n', '^[^\\w\\d\\s]*\n', '^(CLOV|HAMM|NAGG|NELL)\\s\\([\\w\\s\\d]*\\):', '^(HAMM|NAGG|NELL|CLOV):', '^-\\s', '(Merryn|Hygd|Physician|Goneril|Cordeil|Gormflaith|The Younger Woman|The Elder Woman).*\\.', '^Scene:.+\\.\n', '^Lear.*\\.\n', '^ACT I{0,3}V{0,1}\\. Scene \\w\\.\n', '^Enter.*\\.\n', '\\[.*\n*.*\\]', 'Exeunt\\.', '(Glou|Edm|Bur|Corn|Alb|Edg|Cur|Doct|Osw|Capt|Gent|Her|\\d\\. Serv|Gon|Reg|Cor|Knight)(\\.+|,+)\\s*\n*', '(Bast|Glost|Cord|Edgar|Kent|Lear|Alb|Burg|Duke|Reg|Gon|Att|Gent)\\.+\n+', 'S C E N E(\\.|,)', 'A C T\\s+(IV|I+|V)\\.?', '^\\^\\).*\n', 'Mme\\.+\\s+', '^\\*\\).*\n', '\\d+\n', '\x08\\d+\x08', '\\d+', '"', '\\s+\\.\\s+'] |
class Agent:
def __init__(self, env, q_function, action_selector, logger):
self.__env = env
self.__q_function = q_function
self.__action_selector = action_selector
self.__logger = logger
def train(self, steps, episodes, filepath, filename):
episode_reward = 0
total_reward = 0
self.__q_function.reset()
self.__action_selector.reset()
for episode in range(episodes):
current_state = self.__env.reset()
episode_reward = 0
episode_length = 0
for t in range(steps):
action = self.__action_selector.select_action(current_state, self.__q_function, self.__env)
next_state, reward, done, info = self.__env.step(action)
td_error = self.__q_function.update_q_function(current_state, next_state, action, reward)
self.__action_selector.post_update(current_state, action, td_error)
current_state = next_state
episode_reward += reward
episode_length += 1
if done:
break
total_reward += episode_reward
self.__logger.log(episode, episode_reward, total_reward, episode_length)
self.__logger.write(filepath + '/training-data/' + filename + '.csv')
self.__logger.write(filepath + '/q_function/' + filename + '-q-function.csv', self.__q_function.get_q_function())
def solve(self, steps, render):
episode_reward = 0
current_state = self.__env.reset()
if render:
self.__env.render()
for i in range(steps):
action = self.__q_function.get_best_action(current_state)
next_state, reward, done, info = self.__env.step(action)
current_state = next_state
episode_reward += reward
if render:
self.__env.render()
if done:
break
print("Episode finished after {} timesteps".format(i+1))
print("Cumulative reward at end = " + str(episode_reward))
| class Agent:
def __init__(self, env, q_function, action_selector, logger):
self.__env = env
self.__q_function = q_function
self.__action_selector = action_selector
self.__logger = logger
def train(self, steps, episodes, filepath, filename):
episode_reward = 0
total_reward = 0
self.__q_function.reset()
self.__action_selector.reset()
for episode in range(episodes):
current_state = self.__env.reset()
episode_reward = 0
episode_length = 0
for t in range(steps):
action = self.__action_selector.select_action(current_state, self.__q_function, self.__env)
(next_state, reward, done, info) = self.__env.step(action)
td_error = self.__q_function.update_q_function(current_state, next_state, action, reward)
self.__action_selector.post_update(current_state, action, td_error)
current_state = next_state
episode_reward += reward
episode_length += 1
if done:
break
total_reward += episode_reward
self.__logger.log(episode, episode_reward, total_reward, episode_length)
self.__logger.write(filepath + '/training-data/' + filename + '.csv')
self.__logger.write(filepath + '/q_function/' + filename + '-q-function.csv', self.__q_function.get_q_function())
def solve(self, steps, render):
episode_reward = 0
current_state = self.__env.reset()
if render:
self.__env.render()
for i in range(steps):
action = self.__q_function.get_best_action(current_state)
(next_state, reward, done, info) = self.__env.step(action)
current_state = next_state
episode_reward += reward
if render:
self.__env.render()
if done:
break
print('Episode finished after {} timesteps'.format(i + 1))
print('Cumulative reward at end = ' + str(episode_reward)) |
student = {"name":"Rolf", "grades":(89,9,93,78,90)}
def average(seq):
return sum(seq)/len(seq)
print(average(student["grades"]))
class Student:
def __init__(self,name,grades):
self.name = name
self.grades = grades
def averageGrade(self):
return sum(self.grades)/len(self.grades)
student = Student("Bob", (89,90,93,78,90) )
student2 = Student("Rolf", (89,9,93,78,90) )
print(student.name)
print(student.grades)
print(student.averageGrade())
print(student2.name)
print(student2.grades)
print(student2.averageGrade())
| student = {'name': 'Rolf', 'grades': (89, 9, 93, 78, 90)}
def average(seq):
return sum(seq) / len(seq)
print(average(student['grades']))
class Student:
def __init__(self, name, grades):
self.name = name
self.grades = grades
def average_grade(self):
return sum(self.grades) / len(self.grades)
student = student('Bob', (89, 90, 93, 78, 90))
student2 = student('Rolf', (89, 9, 93, 78, 90))
print(student.name)
print(student.grades)
print(student.averageGrade())
print(student2.name)
print(student2.grades)
print(student2.averageGrade()) |
VERSION = '2.0b9'
DEFAULT_TIMEOUT = 60000
REQUEST_ID_HEADER = 'Cko-Request-Id'
API_VERSION_HEADER = 'Cko-Version'
| version = '2.0b9'
default_timeout = 60000
request_id_header = 'Cko-Request-Id'
api_version_header = 'Cko-Version' |
#Leia um numero real e imprima a quinta parte deste numero
n=float(input("Informe um numero real: "))
n=n/5
print(n) | n = float(input('Informe um numero real: '))
n = n / 5
print(n) |
expected_output = {
'instance': {
'default': {
'vrf': {
'red': {
'address_family': {
'': {
'prefixes': {
'11.11.11.11/32': {
'available_path': '1',
'best_path': '1',
'index': {
1: {
'binding_sid': {
'color': '7',
'sid': '22',
'state': 'UP',
},
'cluster_list': '8.8.8.9',
'ext_community': 'RT:2:2 Color:1 Color:2 Color:3 Color:4 Color:7',
'gateway': '7.7.7.9',
'imported_path_from': '1:1:11.11.11.11/32 (global)',
'localpref': 100,
'metric': 0,
'mpls_labels': {
'in': 'nolabel',
'out': '19',
},
'next_hop': '4.4.4.4',
'next_hop_igp_metric': '20',
'next_hop_via': 'default',
'origin_codes': '?',
'originator': '8.8.8.9',
'recipient_pathid': '0',
'refresh_epoch': 5,
'route_info': '1',
'status_codes': '*>',
'transfer_pathid': '0x0',
'update_group': 5,
},
},
'paths': '1 available, best #1, table red',
'table_version': '17',
},
},
},
},
},
},
},
},
}
| expected_output = {'instance': {'default': {'vrf': {'red': {'address_family': {'': {'prefixes': {'11.11.11.11/32': {'available_path': '1', 'best_path': '1', 'index': {1: {'binding_sid': {'color': '7', 'sid': '22', 'state': 'UP'}, 'cluster_list': '8.8.8.9', 'ext_community': 'RT:2:2 Color:1 Color:2 Color:3 Color:4 Color:7', 'gateway': '7.7.7.9', 'imported_path_from': '1:1:11.11.11.11/32 (global)', 'localpref': 100, 'metric': 0, 'mpls_labels': {'in': 'nolabel', 'out': '19'}, 'next_hop': '4.4.4.4', 'next_hop_igp_metric': '20', 'next_hop_via': 'default', 'origin_codes': '?', 'originator': '8.8.8.9', 'recipient_pathid': '0', 'refresh_epoch': 5, 'route_info': '1', 'status_codes': '*>', 'transfer_pathid': '0x0', 'update_group': 5}}, 'paths': '1 available, best #1, table red', 'table_version': '17'}}}}}}}}} |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
if not headA or not headB:
return None
# compute the length of each seq
lenA = lenB = 1
nodeA = headA
while nodeA.next:
nodeA = nodeA.next
lenA += 1
nodeB = headB
while nodeB.next:
nodeB = nodeB.next
lenB += 1
if lenA < lenB: # make sure seq A is longer or equal to seq B
headA, headB = headB, headA
lenA, lenB = lenB, lenA
for i in range(lenA - lenB): # move only the seqA part longer than seq B forward
headA = headA.next
while headA and headB and headA != headB: # find the intersection
headA = headA.next
headB = headB.next
return headA | class Solution:
def get_intersection_node(self, headA: ListNode, headB: ListNode) -> ListNode:
if not headA or not headB:
return None
len_a = len_b = 1
node_a = headA
while nodeA.next:
node_a = nodeA.next
len_a += 1
node_b = headB
while nodeB.next:
node_b = nodeB.next
len_b += 1
if lenA < lenB:
(head_a, head_b) = (headB, headA)
(len_a, len_b) = (lenB, lenA)
for i in range(lenA - lenB):
head_a = headA.next
while headA and headB and (headA != headB):
head_a = headA.next
head_b = headB.next
return headA |
def list_users_in_account(request_ctx, account_id, search_term=None,
include=None, per_page=None, **request_kwargs):
"""
Retrieve the list of users associated with this account.
@example_request
curl https://<canvas>/api/v1/accounts/self/users?search_term=<search value> \
-X GET \
-H 'Authorization: Bearer <token>'
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param account_id: (required) ID
:type account_id: string
:param search_term: (optional) The partial name or full ID of the users to match and return in the
results list. Must be at least 3 characters.
Note that the API will prefer matching on canonical user ID if the ID has
a numeric form. It will only search against other fields if non-numeric
in form, or if the numeric value doesn't yield any matches. Queries by
administrative users will search on SIS ID, name, or email address; non-
administrative queries will only be compared against name.
:type search_term: string or None
:param include: (optional) One of (avatar_url, email, last_login, time_zone)
:type include: array or None
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: List users in account
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
include_types = ('avatar_url', 'email', 'last_login', 'time_zone')
utils.validate_attr_is_acceptable(include, include_types)
path = '/v1/accounts/{account_id}/users'
payload = {
'include[]': include,
'search_term': search_term,
'per_page': per_page,
}
url = request_ctx.base_api_url + path.format(account_id=account_id)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
| def list_users_in_account(request_ctx, account_id, search_term=None, include=None, per_page=None, **request_kwargs):
"""
Retrieve the list of users associated with this account.
@example_request
curl https://<canvas>/api/v1/accounts/self/users?search_term=<search value> -X GET -H 'Authorization: Bearer <token>'
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param account_id: (required) ID
:type account_id: string
:param search_term: (optional) The partial name or full ID of the users to match and return in the
results list. Must be at least 3 characters.
Note that the API will prefer matching on canonical user ID if the ID has
a numeric form. It will only search against other fields if non-numeric
in form, or if the numeric value doesn't yield any matches. Queries by
administrative users will search on SIS ID, name, or email address; non-
administrative queries will only be compared against name.
:type search_term: string or None
:param include: (optional) One of (avatar_url, email, last_login, time_zone)
:type include: array or None
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: List users in account
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
include_types = ('avatar_url', 'email', 'last_login', 'time_zone')
utils.validate_attr_is_acceptable(include, include_types)
path = '/v1/accounts/{account_id}/users'
payload = {'include[]': include, 'search_term': search_term, 'per_page': per_page}
url = request_ctx.base_api_url + path.format(account_id=account_id)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response |
# Autogenerated file for HID Mouse
# Add missing from ... import const
_JD_SERVICE_CLASS_HID_MOUSE = const(0x1885dc1c)
_JD_HID_MOUSE_BUTTON_LEFT = const(0x1)
_JD_HID_MOUSE_BUTTON_RIGHT = const(0x2)
_JD_HID_MOUSE_BUTTON_MIDDLE = const(0x4)
_JD_HID_MOUSE_BUTTON_EVENT_UP = const(0x1)
_JD_HID_MOUSE_BUTTON_EVENT_DOWN = const(0x2)
_JD_HID_MOUSE_BUTTON_EVENT_CLICK = const(0x3)
_JD_HID_MOUSE_BUTTON_EVENT_DOUBLE_CLICK = const(0x4)
_JD_HID_MOUSE_CMD_SET_BUTTON = const(0x80)
_JD_HID_MOUSE_CMD_MOVE = const(0x81)
_JD_HID_MOUSE_CMD_WHEEL = const(0x82) | _jd_service_class_hid_mouse = const(411425820)
_jd_hid_mouse_button_left = const(1)
_jd_hid_mouse_button_right = const(2)
_jd_hid_mouse_button_middle = const(4)
_jd_hid_mouse_button_event_up = const(1)
_jd_hid_mouse_button_event_down = const(2)
_jd_hid_mouse_button_event_click = const(3)
_jd_hid_mouse_button_event_double_click = const(4)
_jd_hid_mouse_cmd_set_button = const(128)
_jd_hid_mouse_cmd_move = const(129)
_jd_hid_mouse_cmd_wheel = const(130) |
def is_substitution_cipher(s1, s2):
dict1={}
dict2={}
for i,j in zip(s1, s2):
dict1[i]=dict1.get(i, 0)+1
dict2[j]=dict2.get(j, 0)+1
if len(dict1)!=len(dict2):
return False
return True | def is_substitution_cipher(s1, s2):
dict1 = {}
dict2 = {}
for (i, j) in zip(s1, s2):
dict1[i] = dict1.get(i, 0) + 1
dict2[j] = dict2.get(j, 0) + 1
if len(dict1) != len(dict2):
return False
return True |
"""properties.py module"""
DEFAULT_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)"
DEFAULT_FILE_NAME = ".secret.txt"
DEFAULT_LENGTH_OF_SECRET_KEY = 50
| """properties.py module"""
default_chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
default_file_name = '.secret.txt'
default_length_of_secret_key = 50 |
# A program to rearrange array in alternating positive & negative items with O(1) extra space
class ArrayRearrange:
def __init__(self, arr, n):
self.arr = arr
self.n = n
def rearrange_array(self):
arr = self.arr.copy()
out_of_place = -1
for i in range(self.n):
if out_of_place == -1:
# conditions for A[i] to
# be in out of place
if (arr[i] >= 0 and i % 2 == 0) or (arr[i] < 0 and i % 2 == 1):
out_of_place = i
if out_of_place >= 0:
if (arr[i] >= 0 and arr[out_of_place] < 0) or (arr[i] < 0 and arr[out_of_place] >= 0):
arr = self.right_rotate(arr, out_of_place, i)
if i - out_of_place > 2:
out_of_place += 2
else:
out_of_place = -1
return arr
@staticmethod
def right_rotate(arr, out_of_place, cur):
temp = arr[cur]
for i in range(cur, out_of_place, -1):
arr[i] = arr[i - 1]
arr[out_of_place] = temp
return arr
# Driver Code
arr = [-5, -2, 5, 2, 4,7, 1, 8, 0, -8]
s= ArrayRearrange(arr, len(arr))
print(f"Rearranged array is: {s.rearrange_array()}") | class Arrayrearrange:
def __init__(self, arr, n):
self.arr = arr
self.n = n
def rearrange_array(self):
arr = self.arr.copy()
out_of_place = -1
for i in range(self.n):
if out_of_place == -1:
if arr[i] >= 0 and i % 2 == 0 or (arr[i] < 0 and i % 2 == 1):
out_of_place = i
if out_of_place >= 0:
if arr[i] >= 0 and arr[out_of_place] < 0 or (arr[i] < 0 and arr[out_of_place] >= 0):
arr = self.right_rotate(arr, out_of_place, i)
if i - out_of_place > 2:
out_of_place += 2
else:
out_of_place = -1
return arr
@staticmethod
def right_rotate(arr, out_of_place, cur):
temp = arr[cur]
for i in range(cur, out_of_place, -1):
arr[i] = arr[i - 1]
arr[out_of_place] = temp
return arr
arr = [-5, -2, 5, 2, 4, 7, 1, 8, 0, -8]
s = array_rearrange(arr, len(arr))
print(f'Rearranged array is: {s.rearrange_array()}') |
expected_output = {
'pid': 'WS-C4507R',
'os': 'ios',
'platform': 'cat4k',
'version': '12.2(18)EW5',
}
| expected_output = {'pid': 'WS-C4507R', 'os': 'ios', 'platform': 'cat4k', 'version': '12.2(18)EW5'} |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 22 17:22:59 2021
Default paths for the different folders.
Should be changed priori to any computation.
@author: amarmore
"""
# RWC
path_data_persisted_rwc = "C:/Users/amarmore/Desktop/data_persisted" ## Path where pre-computed data on RWC Pop should be stored (spectrograms, NTD, neural networks, etc)
path_annotation_rwc = "C:/Users/amarmore/Desktop/Audio samples/RWC Pop/annotations" ## Path of the annotations of RWC Pop. Should be parent folder of "AIST" and/or "MIREX10"
path_entire_rwc = "C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Entire RWC" ## Path where are stored wav files of RWC
path_even_songs_rwc = "C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Even songs" ## Path containing only the wav files of songs of odd numbers
path_odd_songs_rwc = "C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Odd songs" ## Path containing only the wav files of songs of even numbers
path_debug_rwc = "C:/Users/amarmore/Desktop/Audio samples/RWC Pop/debug" ## Debug path, containing only two songs, to fix functions quickly
# SALAMI
path_data_persisted_salami = "C:/Users/amarmore/Desktop/Audio samples/Salami/data_persisted" ## Path where pre-computed data on the SALAMI dataset should be stored (spectrograms, NTD, neural networks, etc)
path_entire_salami = "C:/Users/amarmore/Desktop/Audio samples/Salami" ## Path where are stored wav files of SALAMI (path where it is downloaded by mirdata also) | """
Created on Wed Sep 22 17:22:59 2021
Default paths for the different folders.
Should be changed priori to any computation.
@author: amarmore
"""
path_data_persisted_rwc = 'C:/Users/amarmore/Desktop/data_persisted'
path_annotation_rwc = 'C:/Users/amarmore/Desktop/Audio samples/RWC Pop/annotations'
path_entire_rwc = 'C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Entire RWC'
path_even_songs_rwc = 'C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Even songs'
path_odd_songs_rwc = 'C:/Users/amarmore/Desktop/Audio samples/RWC Pop/Odd songs'
path_debug_rwc = 'C:/Users/amarmore/Desktop/Audio samples/RWC Pop/debug'
path_data_persisted_salami = 'C:/Users/amarmore/Desktop/Audio samples/Salami/data_persisted'
path_entire_salami = 'C:/Users/amarmore/Desktop/Audio samples/Salami' |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""http://www.testingperspective.com/wiki/doku.php/collaboration/chetan/designpatternsinpython/chain-of-responsibilitypattern"""
class Handler:
def __init__(self):
self._successor = None
def successor(self, successor):
self._successor = successor
def handle(self, request):
raise NotImplementedError('Must provide implementation in subclass.')
class ConcreteHandler1(Handler):
def handle(self, request):
if 0 < request <= 10:
print('request {} handled in handler 1'.format(request))
elif self._successor:
self._successor.handle(request)
class ConcreteHandler2(Handler):
def handle(self, request):
if 10 < request <= 20:
print('request {} handled in handler 2'.format(request))
elif self._successor:
self._successor.handle(request)
class ConcreteHandler3(Handler):
def handle(self, request):
if 20 < request <= 30:
print('request {} handled in handler 3'.format(request))
elif self._successor:
self._successor.handle(request)
class DefaultHandler(Handler):
def handle(self, request):
print('end of chain, no handler for {}'.format(request))
class Client:
def __init__(self):
h1 = ConcreteHandler1()
h2 = ConcreteHandler2()
h3 = ConcreteHandler3()
h4 = DefaultHandler()
h1.successor(h2)
h2.successor(h3)
h3.successor(h4)
self.handlers = (h1, h2, h3, h4,)
def delegate(self, requests):
for request in requests:
self.handlers[0].handle(request)
if __name__ == "__main__":
client = Client()
requests = [2, 5, 14, 22, 18, 3, 35, 27, 20]
client.delegate(requests)
### OUTPUT ###
# request 2 handled in handler 1
# request 5 handled in handler 1
# request 14 handled in handler 2
# request 22 handled in handler 3
# request 18 handled in handler 2
# request 3 handled in handler 1
# end of chain, no handler for 35
# request 27 handled in handler 3
# request 20 handled in handler 2
| """http://www.testingperspective.com/wiki/doku.php/collaboration/chetan/designpatternsinpython/chain-of-responsibilitypattern"""
class Handler:
def __init__(self):
self._successor = None
def successor(self, successor):
self._successor = successor
def handle(self, request):
raise not_implemented_error('Must provide implementation in subclass.')
class Concretehandler1(Handler):
def handle(self, request):
if 0 < request <= 10:
print('request {} handled in handler 1'.format(request))
elif self._successor:
self._successor.handle(request)
class Concretehandler2(Handler):
def handle(self, request):
if 10 < request <= 20:
print('request {} handled in handler 2'.format(request))
elif self._successor:
self._successor.handle(request)
class Concretehandler3(Handler):
def handle(self, request):
if 20 < request <= 30:
print('request {} handled in handler 3'.format(request))
elif self._successor:
self._successor.handle(request)
class Defaulthandler(Handler):
def handle(self, request):
print('end of chain, no handler for {}'.format(request))
class Client:
def __init__(self):
h1 = concrete_handler1()
h2 = concrete_handler2()
h3 = concrete_handler3()
h4 = default_handler()
h1.successor(h2)
h2.successor(h3)
h3.successor(h4)
self.handlers = (h1, h2, h3, h4)
def delegate(self, requests):
for request in requests:
self.handlers[0].handle(request)
if __name__ == '__main__':
client = client()
requests = [2, 5, 14, 22, 18, 3, 35, 27, 20]
client.delegate(requests) |
"""
A block cipher is a method of encrypting text,
in which a cryptographic key and algorithm are applied to a block of data
(for example, 64 contiguous bits) at once as a group rather than to one bit at a time.
A block cipher is a deterministic algorithm operating on fixed-length groups of bits,
called a block, with an unvarying transformation that is specified by a symmetric key.
Block ciphers operate as important elementary components in the design of many cryptographic protocols,
and are widely used to implement encryption of bulk data.
"""
def dummy():
pass
| """
A block cipher is a method of encrypting text,
in which a cryptographic key and algorithm are applied to a block of data
(for example, 64 contiguous bits) at once as a group rather than to one bit at a time.
A block cipher is a deterministic algorithm operating on fixed-length groups of bits,
called a block, with an unvarying transformation that is specified by a symmetric key.
Block ciphers operate as important elementary components in the design of many cryptographic protocols,
and are widely used to implement encryption of bulk data.
"""
def dummy():
pass |
_MAJOR = 0
_MINOR = 6
_PATCH = 4
__version__ = str(_MAJOR) + '.' + str(_MINOR) + '.' + str(_PATCH)
def version():
'''
Returns a string representation of the version
'''
return __version__
def version_tuple():
'''
Returns a 3-tuple of ints that represent the version
'''
return (_MAJOR, _MINOR, _PATCH)
| _major = 0
_minor = 6
_patch = 4
__version__ = str(_MAJOR) + '.' + str(_MINOR) + '.' + str(_PATCH)
def version():
"""
Returns a string representation of the version
"""
return __version__
def version_tuple():
"""
Returns a 3-tuple of ints that represent the version
"""
return (_MAJOR, _MINOR, _PATCH) |
#!/usr/bin/env python3
# https://www.hackerrank.com/challenges/python-lists/
if __name__ == '__main__':
N = int(input())
lst = []
for i in range(N):
cmd = input().rstrip().split()
if(cmd[0] == 'insert'):
lst.insert(int(cmd[1]), int(cmd[2]))
elif(cmd[0] == 'print'):
print(lst)
elif(cmd[0] == 'remove'):
lst.remove(int(cmd[1]))
elif(cmd[0] == 'append'):
lst.append(int(cmd[1]))
elif(cmd[0] == 'sort'):
lst.sort()
elif(cmd[0] == 'pop'):
lst.pop()
elif(cmd[0] == 'reverse'):
lst.reverse()
| if __name__ == '__main__':
n = int(input())
lst = []
for i in range(N):
cmd = input().rstrip().split()
if cmd[0] == 'insert':
lst.insert(int(cmd[1]), int(cmd[2]))
elif cmd[0] == 'print':
print(lst)
elif cmd[0] == 'remove':
lst.remove(int(cmd[1]))
elif cmd[0] == 'append':
lst.append(int(cmd[1]))
elif cmd[0] == 'sort':
lst.sort()
elif cmd[0] == 'pop':
lst.pop()
elif cmd[0] == 'reverse':
lst.reverse() |
class Solution:
def minSwap(self, A: List[int], B: List[int]) -> int:
n1, s1 = 0, 1
for i in range(1, len(A)):
n2 = s2 = float("inf")
if A[i - 1] < A[i] and B[i - 1] < B[i]:
n2 = min(n2, n1)
s2 = min(s2, s1 + 1)
if A[i - 1] < B[i] and B[i - 1] < A[i]:
n2 = min(n2, s1)
s2 = min(s2, n1 + 1)
n1, s1 = n2, s2
print(n1, s2)
return min(n1, s1)
| class Solution:
def min_swap(self, A: List[int], B: List[int]) -> int:
(n1, s1) = (0, 1)
for i in range(1, len(A)):
n2 = s2 = float('inf')
if A[i - 1] < A[i] and B[i - 1] < B[i]:
n2 = min(n2, n1)
s2 = min(s2, s1 + 1)
if A[i - 1] < B[i] and B[i - 1] < A[i]:
n2 = min(n2, s1)
s2 = min(s2, n1 + 1)
(n1, s1) = (n2, s2)
print(n1, s2)
return min(n1, s1) |
__author__ = 'xelhark'
class ErrorWithList(ValueError):
def __init__(self, message, errors_list=None):
self.errors_list = errors_list
super(ErrorWithList, self).__init__(message)
class ModelValidationError(ErrorWithList):
pass
class InstanceValidationError(ErrorWithList):
pass
| __author__ = 'xelhark'
class Errorwithlist(ValueError):
def __init__(self, message, errors_list=None):
self.errors_list = errors_list
super(ErrorWithList, self).__init__(message)
class Modelvalidationerror(ErrorWithList):
pass
class Instancevalidationerror(ErrorWithList):
pass |
config = {
"username": "",
"password": "",
"phonename": "iPhone",
"sms_csv": ""
} | config = {'username': '', 'password': '', 'phonename': 'iPhone', 'sms_csv': ''} |
class BitDocument:
"""Wrapper for Firestore document (https://firebase.google.com/docs/firestore/reference/rest/v1beta1/projects.databases.documents)
"""
def __init__(self, doc):
self.id = doc['id']['stringValue']
self.title = self._get_field(doc, 'title', 'stringValue', '')
self.content = self._get_field(doc, 'content', 'stringValue', '')
self.tags = self._get_field(doc, 'tags', 'arrayValue', [])
def _get_field(self, doc, name, field_type, default_value=None):
if name in doc:
if field_type == 'arrayValue':
if doc[name][field_type]:
return [val['stringValue'] for val in doc[name][field_type]['values']]
else:
return doc[name][field_type]
return default_value
def as_partial(self):
"""Return string representing a partial bit document, used for
displaying search results, mapped to term / id in our index.
"""
return dict(id=self.id, title=self.title, tags=self.tags)
def as_indexable_str(self):
"""Concatenated string of all indexable fields.
"""
return ' '.join([self.title, self.content, ' '.join(self.tags or [])])
| class Bitdocument:
"""Wrapper for Firestore document (https://firebase.google.com/docs/firestore/reference/rest/v1beta1/projects.databases.documents)
"""
def __init__(self, doc):
self.id = doc['id']['stringValue']
self.title = self._get_field(doc, 'title', 'stringValue', '')
self.content = self._get_field(doc, 'content', 'stringValue', '')
self.tags = self._get_field(doc, 'tags', 'arrayValue', [])
def _get_field(self, doc, name, field_type, default_value=None):
if name in doc:
if field_type == 'arrayValue':
if doc[name][field_type]:
return [val['stringValue'] for val in doc[name][field_type]['values']]
else:
return doc[name][field_type]
return default_value
def as_partial(self):
"""Return string representing a partial bit document, used for
displaying search results, mapped to term / id in our index.
"""
return dict(id=self.id, title=self.title, tags=self.tags)
def as_indexable_str(self):
"""Concatenated string of all indexable fields.
"""
return ' '.join([self.title, self.content, ' '.join(self.tags or [])]) |
#This program takes in a postive integer and applies a calculation to it.
# It then outputs a sequence that ends in 1
#creates a list called L
mylist=[]
#take the input for the user
value = int(input("Please enter a positive integer: "))
# Adds the input to the list.
# The append wouldnt work unless I made i an int value when tring to append
mylist.append(int(value))
#starts a while loop that will stop when i reaches 1
# The next value is gotten by taking the current value and
# if it is even, divide it by two, but if it is odd, multiply it by three and add one.
# The program ends if the current value is one., if the user enters 1 then the loop wont run
while value != 1:
if value % 2 == 0:
value /= 2
mylist.append(int(value))
else:
value = (value*3)+1
mylist.append(int(value))
print(mylist)
#based on andrew's feedback I tried to make my variable names more meaning full | mylist = []
value = int(input('Please enter a positive integer: '))
mylist.append(int(value))
while value != 1:
if value % 2 == 0:
value /= 2
mylist.append(int(value))
else:
value = value * 3 + 1
mylist.append(int(value))
print(mylist) |
class Aritmatika:
@staticmethod
def tambah(a, b):
return a + b
@staticmethod
def kurang(a, b):
return a - b
@staticmethod
def bagi(a, b):
return a / b
@staticmethod
def bagi_int(a, b):
return a // b
@staticmethod
def pangkat(a, b):
return a ** b
# Langsung call class dan method
print(Aritmatika.tambah(5, 5))
# Bikin object dlu
objekA = Aritmatika()
print(objekA.pangkat(2, 3)) | class Aritmatika:
@staticmethod
def tambah(a, b):
return a + b
@staticmethod
def kurang(a, b):
return a - b
@staticmethod
def bagi(a, b):
return a / b
@staticmethod
def bagi_int(a, b):
return a // b
@staticmethod
def pangkat(a, b):
return a ** b
print(Aritmatika.tambah(5, 5))
objek_a = aritmatika()
print(objekA.pangkat(2, 3)) |
# Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.
# A region is captured by flipping all 'O's into 'X's in that surrounded region.
def solve(board):
"""
Do not return anything, modify board in-place instead.
"""
if not board: return board
nrow = len(board)
ncol = len(board[0])
if nrow <= 2 or ncol <= 2: return board
for i in range(nrow):
for j in range(ncol):
if (i == 0 or i == nrow-1 or j == 0 or j == ncol-1) and board[i][j] == 'O':
dfs(board, i, j)
for i in range(nrow):
for j in range(ncol):
if board[i][j] == 'O':
board[i][j] = 'X'
elif board[i][j] == 'o':
board[i][j] = 'O'
return board
def dfs(self, board, i, j):
nrow = len(board)
ncol = len(board[0])
if i >= 0 and i < nrow and j >= 0 and j < ncol and board[i][j] == 'O':
board[i][j] = 'o'
dfs(board, i-1, j)
dfs(board, i+1, j)
dfs(board, i, j-1)
dfs(board, i, j+1)
return
| def solve(board):
"""
Do not return anything, modify board in-place instead.
"""
if not board:
return board
nrow = len(board)
ncol = len(board[0])
if nrow <= 2 or ncol <= 2:
return board
for i in range(nrow):
for j in range(ncol):
if (i == 0 or i == nrow - 1 or j == 0 or (j == ncol - 1)) and board[i][j] == 'O':
dfs(board, i, j)
for i in range(nrow):
for j in range(ncol):
if board[i][j] == 'O':
board[i][j] = 'X'
elif board[i][j] == 'o':
board[i][j] = 'O'
return board
def dfs(self, board, i, j):
nrow = len(board)
ncol = len(board[0])
if i >= 0 and i < nrow and (j >= 0) and (j < ncol) and (board[i][j] == 'O'):
board[i][j] = 'o'
dfs(board, i - 1, j)
dfs(board, i + 1, j)
dfs(board, i, j - 1)
dfs(board, i, j + 1)
return |
def calculate_similarity(my, theirs, tags):
similarity = {}
for group in ('personal', 'hobbies'):
all_names = {tag.code for tag in tags if tag.group == group}
my_names = all_names & my
their_names = all_names & theirs
both = my_names | their_names
same = my_names & their_names
similarity[group] = len(same) * 100 / len(both) if both else 0
return similarity
def is_role_manageable_by_user(role, user):
if role in (user.ROLE_GOD, user.ROLE_MODERATOR):
return user.is_god
if role == user.ROLE_CURATOR:
return user.is_moderator
return False
| def calculate_similarity(my, theirs, tags):
similarity = {}
for group in ('personal', 'hobbies'):
all_names = {tag.code for tag in tags if tag.group == group}
my_names = all_names & my
their_names = all_names & theirs
both = my_names | their_names
same = my_names & their_names
similarity[group] = len(same) * 100 / len(both) if both else 0
return similarity
def is_role_manageable_by_user(role, user):
if role in (user.ROLE_GOD, user.ROLE_MODERATOR):
return user.is_god
if role == user.ROLE_CURATOR:
return user.is_moderator
return False |
"""
:copyright: (c) 2020 Yotam Rechnitz
:license: MIT, see LICENSE for more details
"""
class Average:
def __init__(self, js: dict):
self._allDamageDoneAvgPer10Min = js["allDamageDoneAvgPer10Min"] if "allDamageDoneAvgPer10Min" in js else 0
self._barrierDamageDoneAvgPer10Min = js[
"barrierDamageDoneAvgPer10Min"] if "barrierDamageDoneAvgPer10Min" in js else 0
self._deathsAvgPer10Min = js["deathsAvgPer10Min"] if "deathsAvgPer10Min" in js else 0
self._eliminationsAvgPer10Min = js["eliminationsAvgPer10Min"] if "eliminationsAvgPer10Min" in js else 0
self._finalBlowsAvgPer10Min = js["finalBlowsAvgPer10Min"] if "finalBlowsAvgPer10Min" in js else 0
self._healingDoneAvgPer10Min = js["healingDoneAvgPer10Min"] if "healingDoneAvgPer10Min" in js else 0
self._heroDamageDoneAvgPer10Min = js["heroDamageDoneAvgPer10Min"] if "heroDamageDoneAvgPer10Min" in js else 0
self._objectiveKillsAvgPer10Min = js["objectiveKillsAvgPer10Min"] if "objectiveKillsAvgPer10Min" in js else 0
self._objectiveTimeAvgPer10Min = js["objectiveTimeAvgPer10Min"] if "objectiveTimeAvgPer10Min" in js else 0
self._soloKillsAvgPer10Min = js["_soloKillsAvgPer10Min"] if "_soloKillsAvgPer10Min" in js else 0
self._timeSpentOnFireAvgPer10Min = js["timeSpentOnFireAvgPer10Min"] if "timeSpentOnFireAvgPer10Min" in js else 0
@property
def allDamageDoneAvgPer10Min(self) -> int:
return self._allDamageDoneAvgPer10Min
@property
def barrierDamageDoneAvgPer10Min(self) -> int:
return self._barrierDamageDoneAvgPer10Min
@property
def deathsAvgPer10Min(self) -> int:
return self._deathsAvgPer10Min
@property
def eliminationsAvgPer10Min(self) -> int:
return self._eliminationsAvgPer10Min
@property
def finalBlowsAvgPer10Min(self) -> int:
return self._finalBlowsAvgPer10Min
@property
def healingDoneAvgPer10Min(self) -> int:
return self._healingDoneAvgPer10Min
@property
def heroDamageDoneAvgPer10Min(self) -> int:
return self._heroDamageDoneAvgPer10Min
@property
def objectiveKillsAvgPer10Min(self) -> int:
return self._objectiveKillsAvgPer10Min
@property
def objectiveTimeAvgPer10Min(self) -> int:
return self._objectiveTimeAvgPer10Min
@property
def soloKillsAvgPer10Min(self) -> int:
return self._soloKillsAvgPer10Min
@property
def timeSpentOnFireAvgPer10Min(self) -> int:
return self._timeSpentOnFireAvgPer10Min
| """
:copyright: (c) 2020 Yotam Rechnitz
:license: MIT, see LICENSE for more details
"""
class Average:
def __init__(self, js: dict):
self._allDamageDoneAvgPer10Min = js['allDamageDoneAvgPer10Min'] if 'allDamageDoneAvgPer10Min' in js else 0
self._barrierDamageDoneAvgPer10Min = js['barrierDamageDoneAvgPer10Min'] if 'barrierDamageDoneAvgPer10Min' in js else 0
self._deathsAvgPer10Min = js['deathsAvgPer10Min'] if 'deathsAvgPer10Min' in js else 0
self._eliminationsAvgPer10Min = js['eliminationsAvgPer10Min'] if 'eliminationsAvgPer10Min' in js else 0
self._finalBlowsAvgPer10Min = js['finalBlowsAvgPer10Min'] if 'finalBlowsAvgPer10Min' in js else 0
self._healingDoneAvgPer10Min = js['healingDoneAvgPer10Min'] if 'healingDoneAvgPer10Min' in js else 0
self._heroDamageDoneAvgPer10Min = js['heroDamageDoneAvgPer10Min'] if 'heroDamageDoneAvgPer10Min' in js else 0
self._objectiveKillsAvgPer10Min = js['objectiveKillsAvgPer10Min'] if 'objectiveKillsAvgPer10Min' in js else 0
self._objectiveTimeAvgPer10Min = js['objectiveTimeAvgPer10Min'] if 'objectiveTimeAvgPer10Min' in js else 0
self._soloKillsAvgPer10Min = js['_soloKillsAvgPer10Min'] if '_soloKillsAvgPer10Min' in js else 0
self._timeSpentOnFireAvgPer10Min = js['timeSpentOnFireAvgPer10Min'] if 'timeSpentOnFireAvgPer10Min' in js else 0
@property
def all_damage_done_avg_per10_min(self) -> int:
return self._allDamageDoneAvgPer10Min
@property
def barrier_damage_done_avg_per10_min(self) -> int:
return self._barrierDamageDoneAvgPer10Min
@property
def deaths_avg_per10_min(self) -> int:
return self._deathsAvgPer10Min
@property
def eliminations_avg_per10_min(self) -> int:
return self._eliminationsAvgPer10Min
@property
def final_blows_avg_per10_min(self) -> int:
return self._finalBlowsAvgPer10Min
@property
def healing_done_avg_per10_min(self) -> int:
return self._healingDoneAvgPer10Min
@property
def hero_damage_done_avg_per10_min(self) -> int:
return self._heroDamageDoneAvgPer10Min
@property
def objective_kills_avg_per10_min(self) -> int:
return self._objectiveKillsAvgPer10Min
@property
def objective_time_avg_per10_min(self) -> int:
return self._objectiveTimeAvgPer10Min
@property
def solo_kills_avg_per10_min(self) -> int:
return self._soloKillsAvgPer10Min
@property
def time_spent_on_fire_avg_per10_min(self) -> int:
return self._timeSpentOnFireAvgPer10Min |
# Method 1: using index find the max first, and then process
def validMountainArray(self, A):
if len(A) < 3: return False
index = A.index(max(A))
if index == 0 or index == len(A) -1: return False
for i in range(1, len(A)):
if i <= index:
if A[i] <= A[i - 1]: return False
else:
if A[i] >= A[i - 1]: return False
return True
# Method 2: one pass, using two pointers trace from the begining and end
def validMountainArray(self, A):
i, j = 0, len(A) - 1
while i < len(A) - 1 and A[i] < A[i + 1]: i += 1
while j > 0 and A[j - 1] > A[j]: j -= 1
return 0 < i == j < len(A) - 1 | def valid_mountain_array(self, A):
if len(A) < 3:
return False
index = A.index(max(A))
if index == 0 or index == len(A) - 1:
return False
for i in range(1, len(A)):
if i <= index:
if A[i] <= A[i - 1]:
return False
elif A[i] >= A[i - 1]:
return False
return True
def valid_mountain_array(self, A):
(i, j) = (0, len(A) - 1)
while i < len(A) - 1 and A[i] < A[i + 1]:
i += 1
while j > 0 and A[j - 1] > A[j]:
j -= 1
return 0 < i == j < len(A) - 1 |
# 69. Sqrt(x) Easy
# Implement int sqrt(int x).
#
# Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
#
# Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
#
# Example 1:
#
# Input: 4
# Output: 2
# Example 2:
#
# Input: 8
# Output: 2
# Explanation: The square root of 8 is 2.82842..., and since
# the decimal part is truncated, 2 is returned.
def mySqrt(self, x: int) -> int:
'''
Runtime: 56 ms, faster than 54.11% of Python3 online submissions for Sqrt(x).
Memory Usage: 13.1 MB, less than 79.16% of Python3 online submissions for Sqrt(x).
'''
# 2^2 = 4
# 2.82842^2 = 8
# x > 1, range(1, x)
# x < 1, range(0, 1)
if x == 1 or x == 0:
return x
max_range = max(1, x)
min_range = 0
result = 0
while (max_range - min_range != 0):
mid = min_range + (max_range - min_range) // 2
result = mid * mid
print(result)
if int(result) <= x < (mid + 1) * (mid + 1):
return int(mid)
if result < x:
min_range = mid
else:
max_range = mid
| def my_sqrt(self, x: int) -> int:
"""
Runtime: 56 ms, faster than 54.11% of Python3 online submissions for Sqrt(x).
Memory Usage: 13.1 MB, less than 79.16% of Python3 online submissions for Sqrt(x).
"""
if x == 1 or x == 0:
return x
max_range = max(1, x)
min_range = 0
result = 0
while max_range - min_range != 0:
mid = min_range + (max_range - min_range) // 2
result = mid * mid
print(result)
if int(result) <= x < (mid + 1) * (mid + 1):
return int(mid)
if result < x:
min_range = mid
else:
max_range = mid |
class Line(object):
"""Represents a line on the road, which consists of a list of coordinates.
Attributes:
line_id: an integer indicating which line this is.
coordinates: a list of tuples indicating the coordinates on the line.
"""
def __init__(self, line_id, coordinates):
"""Initializes the Line class."""
self.line_id = line_id
self.coordinates = coordinates
def get_coordinates(self):
"""Returns the array of coordinates."""
return self.coordinates
def get_id(self):
"""Returns the line's id."""
return self.line_id
| class Line(object):
"""Represents a line on the road, which consists of a list of coordinates.
Attributes:
line_id: an integer indicating which line this is.
coordinates: a list of tuples indicating the coordinates on the line.
"""
def __init__(self, line_id, coordinates):
"""Initializes the Line class."""
self.line_id = line_id
self.coordinates = coordinates
def get_coordinates(self):
"""Returns the array of coordinates."""
return self.coordinates
def get_id(self):
"""Returns the line's id."""
return self.line_id |
class UncleEngineer:
'''
test = UncleEngineer()
test.art()
'''
def __init__(self):
self.name = 'Uncle Engineer'
def art(self):
asciiart = '''
Z
Z
.,., z
(((((()) z
((('_ _`) '
((G \ |)
(((` " ,
.((\.:~: .--------------.
__.| `"'.__ | \ |
.~~ `---' ~. | . :
/ ` | `-.__________)
| ~ | : :
| | : |
| _ | | [ ## :
\ ~~-. | , oo_______.'
`_ ( \) _____/~~~~ `--___
| ~`-) ) `-. `--- ( - a:f -
| '///` | `-.
| | | | `-.
| | | | `-.
| | |\ |
| | | \|
`-. | | |
`-| '
'''
print(asciiart)
def __str__(self):
return self.name
class UncleEngineer:
'''
test = BTT()
test.art()
'''
def __init__(self):
self.name = 'BTT'
def art(self):
asciiart = '''
;::::;
;::::; :;
;:::::' :;
;:::::; ;.
,:::::' ; OOO\
::::::; ; OOOOO\
;:::::; ; OOOOOOOO
,;::::::; ;' / OOOOOOO
;:::::::::`. ,,,;. / / DOOOOOO
.';:::::::::::::::::;, / / DOOOO
,::::::;::::::;;;;::::;, / / DOOO
;`::::::`'::::::;;;::::: ,#/ / DOOO
:`:::::::`;::::::;;::: ;::# / DOOO
::`:::::::`;:::::::: ;::::# / DOO
`:`:::::::`;:::::: ;::::::#/ DOO
:::`:::::::`;; ;:::::::::## OO
::::`:::::::`;::::::::;:::# OO
`:::::`::::::::::::;'`:;::# O
`:::::`::::::::;' / / `:#
::::::`:::::;' / / `#
'''
print(asciiart)
def __str__(self):
return self.name
| class Uncleengineer:
"""
test = UncleEngineer()
test.art()
"""
def __init__(self):
self.name = 'Uncle Engineer'
def art(self):
asciiart = '\n Z \n Z \n .,., z \n (((((()) z \n (((\'_ _`) \' \n ((G \\ |) \n (((` " , \n .((\\.:~: .--------------. \n __.| `"\'.__ | \\ | \n .~~ `---\' ~. | . : \n / ` | `-.__________) \n| ~ | : : \n| | : | \n| _ | | [ ## : \n \\ ~~-. | , oo_______.\' \n `_ ( \\) _____/~~~~ `--___ \n | ~`-) ) `-. `--- ( - a:f - \n | \'///` | `-. \n | | | | `-. \n | | | | `-. \n | | |\\ | \n | | | \\| \n `-. | | | \n `-| \'\n '
print(asciiart)
def __str__(self):
return self.name
class Uncleengineer:
"""
test = BTT()
test.art()
"""
def __init__(self):
self.name = 'BTT'
def art(self):
asciiart = "\n\n ;::::; \n ;::::; :; \n ;:::::' :; \n ;:::::; ;. \n ,:::::' ; OOO\\ \n ::::::; ; OOOOO\\ \n ;:::::; ; OOOOOOOO \n ,;::::::; ;' / OOOOOOO \n ;:::::::::`. ,,,;. / / DOOOOOO \n .';:::::::::::::::::;, / / DOOOO \n ,::::::;::::::;;;;::::;, / / DOOO \n;`::::::`'::::::;;;::::: ,#/ / DOOO \n:`:::::::`;::::::;;::: ;::# / DOOO\n::`:::::::`;:::::::: ;::::# / DOO\n`:`:::::::`;:::::: ;::::::#/ DOO\n :::`:::::::`;; ;:::::::::## OO\n ::::`:::::::`;::::::::;:::# OO\n `:::::`::::::::::::;'`:;::# O \n `:::::`::::::::;' / / `:# \n ::::::`:::::;' / / `# \n\n "
print(asciiart)
def __str__(self):
return self.name |
class Vscode():
def execute(self):
print("code is compiling and code is running")
class Pycharm():
def execute(self):
print("code is compiling and code is running")
class python():
def execute(self):
print("python is using")
class CPP():
def execute(self):
print("C++ is using")
class Laptop():
def code(self,ide,lang):
ide.execute(self)
lang.execute(self)
lap1=Laptop()
lap1.code(Vscode,python)
lap1.code(Pycharm,CPP)
| class Vscode:
def execute(self):
print('code is compiling and code is running')
class Pycharm:
def execute(self):
print('code is compiling and code is running')
class Python:
def execute(self):
print('python is using')
class Cpp:
def execute(self):
print('C++ is using')
class Laptop:
def code(self, ide, lang):
ide.execute(self)
lang.execute(self)
lap1 = laptop()
lap1.code(Vscode, python)
lap1.code(Pycharm, CPP) |
#! /usr/bin/python
__version__ = "0.1.0"
__description__ = "Connection facilitator"
__logo__ = """
___ ____ ____ __ ____ __ __ ___
/ __)(_ _)( _ \ /__\ (_ _)( )( )/ __)
\__ \ )( ) / /(__)\ )( )(__)( \__ \\
(___/ (__) (_)\_)(__)(__)(__) (______)(___/
"""
PORT = 5678
TIME_OUT = 20
BIND_TIME = 0.1
ALL_CLIENTS = "__all__"
DOUBLE_LINE_BREAK = "\r\n\r\n"
CONNECTION_REFUSED = "Connection Refused"
| __version__ = '0.1.0'
__description__ = 'Connection facilitator'
__logo__ = '\n ___ ____ ____ __ ____ __ __ ___\n/ __)(_ _)( _ \\ /__\\ (_ _)( )( )/ __)\n\\__ \\ )( ) / /(__)\\ )( )(__)( \\__ \\\n(___/ (__) (_)\\_)(__)(__)(__) (______)(___/\n'
port = 5678
time_out = 20
bind_time = 0.1
all_clients = '__all__'
double_line_break = '\r\n\r\n'
connection_refused = 'Connection Refused' |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 4 10:28:28 2019
@author: Paul
"""
def generate_passwords(start, stop):
"""
Generates and returns a list strings of all possible passwords in the range
start-stop, meeting the following requirements:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
passwords = []
for i in range(start, stop+1, 1):
passwords.append(str(i))
return passwords
def valid_passwords_1(passwords):
"""
Takes a list of password strings, and returns the number of passwords in
the list meeting the following criteria:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
valid = 0
for entry in passwords:
adjacent = False
order = True
#Check for adjacent duplicate numbers
for i in range(len(entry) - 1):
if entry[i] == entry[i+1]:
adjacent = True
for i in range(len(entry) - 1):
if entry[i] > entry[i+1]:
order = False
if adjacent and order:
valid += 1
return valid
def valid_passwords_2(passwords):
"""
Takes a list of password strings, and returns the number of passwords in
the list meeting the following criteria:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- The two adjacent digits meeting the above requirement must not be
part of a larger repeated block ie. 123455 is valid, 123444 is not.
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
valid = 0
for entry in passwords:
adjacent = False
order = True
#Check for adjacent duplicate numbers
for i in range(len(entry) - 1):
if (entry[i] == entry[i+1]):
test_num = entry[i]
if entry.count(test_num) == 2:
adjacent = True
for i in range(len(entry) - 1):
if entry[i] > entry[i+1]:
order = False
if adjacent and order:
valid += 1
return valid
#passwords = ["112233", "123444", "111122"] #Test Passwords
passwords = generate_passwords(256310, 732736)
valid_pass_num1 = valid_passwords_1(passwords)
valid_pass_num2 = valid_passwords_2(passwords)
print("Part 1: Number of valid passwords in range: ", valid_pass_num1)
print("Part 2: Number of valid passwords in range: ", valid_pass_num2) | """
Created on Wed Dec 4 10:28:28 2019
@author: Paul
"""
def generate_passwords(start, stop):
"""
Generates and returns a list strings of all possible passwords in the range
start-stop, meeting the following requirements:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
passwords = []
for i in range(start, stop + 1, 1):
passwords.append(str(i))
return passwords
def valid_passwords_1(passwords):
"""
Takes a list of password strings, and returns the number of passwords in
the list meeting the following criteria:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
valid = 0
for entry in passwords:
adjacent = False
order = True
for i in range(len(entry) - 1):
if entry[i] == entry[i + 1]:
adjacent = True
for i in range(len(entry) - 1):
if entry[i] > entry[i + 1]:
order = False
if adjacent and order:
valid += 1
return valid
def valid_passwords_2(passwords):
"""
Takes a list of password strings, and returns the number of passwords in
the list meeting the following criteria:
- Passwords are six digit numbers
- In each password two adjacent digits must be the same
- The two adjacent digits meeting the above requirement must not be
part of a larger repeated block ie. 123455 is valid, 123444 is not.
- In each password, going from largest to smallest digit, the size of
the digit does not decrease:
111123, 135679, 111111 meet the criteria
223450 does not (decreasing pair of digits 50)
123789 does not (no double adjacent digits)
"""
valid = 0
for entry in passwords:
adjacent = False
order = True
for i in range(len(entry) - 1):
if entry[i] == entry[i + 1]:
test_num = entry[i]
if entry.count(test_num) == 2:
adjacent = True
for i in range(len(entry) - 1):
if entry[i] > entry[i + 1]:
order = False
if adjacent and order:
valid += 1
return valid
passwords = generate_passwords(256310, 732736)
valid_pass_num1 = valid_passwords_1(passwords)
valid_pass_num2 = valid_passwords_2(passwords)
print('Part 1: Number of valid passwords in range: ', valid_pass_num1)
print('Part 2: Number of valid passwords in range: ', valid_pass_num2) |
nums = [2, 3, 4, 5, 7, 10, 12]
for n in nums:
print(n, end=", ")
class CartItem:
def __init__(self, name, price) -> None:
self.price = price
self.name = name
def __repr__(self) -> str:
return "({0}, ${1})".format(self.name, self.price)
class ShoppingCart:
def __init__(self) -> None:
self.items = []
def add(self, cart_item):
self.items.append(cart_item)
def __iter__(self):
return self.items.__iter__()
@property
def total_price(self):
total = 0.0
for item in self.items:
total += item.price
return total
print()
print()
cart = ShoppingCart()
cart.add(CartItem("CD", 9.99))
cart.add(CartItem("Vinyle", 14.99))
for c in cart:
print(c)
print("Total is ${0:,}".format(cart.total_price))
| nums = [2, 3, 4, 5, 7, 10, 12]
for n in nums:
print(n, end=', ')
class Cartitem:
def __init__(self, name, price) -> None:
self.price = price
self.name = name
def __repr__(self) -> str:
return '({0}, ${1})'.format(self.name, self.price)
class Shoppingcart:
def __init__(self) -> None:
self.items = []
def add(self, cart_item):
self.items.append(cart_item)
def __iter__(self):
return self.items.__iter__()
@property
def total_price(self):
total = 0.0
for item in self.items:
total += item.price
return total
print()
print()
cart = shopping_cart()
cart.add(cart_item('CD', 9.99))
cart.add(cart_item('Vinyle', 14.99))
for c in cart:
print(c)
print('Total is ${0:,}'.format(cart.total_price)) |
highest_seat_id = 0
with open("input.txt", "r") as f:
lines = [line.rstrip() for line in f.readlines()]
for line in lines:
rows = [0, 127]
row = None
columns = [0, 7]
column = None
for command in list(line):
if command == "F":
rows = [rows[0], ((rows[1] - rows[0]) // 2) + rows[0]]
elif command == "B":
rows = [((rows[1] - rows[0]) // 2) + rows[0] + 1, rows[1]]
elif command == "L":
columns = [columns[0], ((columns[1] - columns[0]) // 2) + columns[0]]
elif command == "R":
columns = [((columns[1] - columns[0]) // 2) + columns[0] + 1, columns[1]]
if rows[0] == rows[1]:
row = rows[0]
if columns[0] == columns[1]:
column = columns[0]
seat_id = row * 8 + column
if seat_id > highest_seat_id:
highest_seat_id = seat_id
#print(f"line: {line}, row: {row}, column: {column}, seat ID: {seat_id}")
print(f"\nWhat is the highest seat ID on a boarding pass? {highest_seat_id}")
| highest_seat_id = 0
with open('input.txt', 'r') as f:
lines = [line.rstrip() for line in f.readlines()]
for line in lines:
rows = [0, 127]
row = None
columns = [0, 7]
column = None
for command in list(line):
if command == 'F':
rows = [rows[0], (rows[1] - rows[0]) // 2 + rows[0]]
elif command == 'B':
rows = [(rows[1] - rows[0]) // 2 + rows[0] + 1, rows[1]]
elif command == 'L':
columns = [columns[0], (columns[1] - columns[0]) // 2 + columns[0]]
elif command == 'R':
columns = [(columns[1] - columns[0]) // 2 + columns[0] + 1, columns[1]]
if rows[0] == rows[1]:
row = rows[0]
if columns[0] == columns[1]:
column = columns[0]
seat_id = row * 8 + column
if seat_id > highest_seat_id:
highest_seat_id = seat_id
print(f'\nWhat is the highest seat ID on a boarding pass? {highest_seat_id}') |
#! /usr/bin/env python
"""
Make a small MDV file containing a grid with X and Y axes in degrees.
Partial grid is taken from full sized file 000000.mdv which is contained in
the 200202.MASTER15.mdv.tar.gz file available online at:
http://www2.mmm.ucar.edu/imagearchive/WSI/mdv/
"""
# The MDV RLE decoding routine ends at the end of the data stream even if not
# all data point have been read. Therefore a file truncated at a break in the
# RLE can still be read but data past the last data point will be filled with
# random data. Here we end after the first non-keyed RLE byte.
infile = open('000000.mdv', 'rb')
outfile = open('example_mdv_grid.mdv', 'wb')
outfile.write(infile.read(8134))
infile.close()
outfile.close()
| """
Make a small MDV file containing a grid with X and Y axes in degrees.
Partial grid is taken from full sized file 000000.mdv which is contained in
the 200202.MASTER15.mdv.tar.gz file available online at:
http://www2.mmm.ucar.edu/imagearchive/WSI/mdv/
"""
infile = open('000000.mdv', 'rb')
outfile = open('example_mdv_grid.mdv', 'wb')
outfile.write(infile.read(8134))
infile.close()
outfile.close() |
class Vertex:
def __init__(self, label: str = None, weight: int = float("inf"), key: int = None):
self.label: str = label
self.weight: int = weight
self.key: int = key
| class Vertex:
def __init__(self, label: str=None, weight: int=float('inf'), key: int=None):
self.label: str = label
self.weight: int = weight
self.key: int = key |
class Solution:
def dfs(self, s:str, n:int, pos:int, sub_res:list, total_res:list, left:int):
if left == 0 and pos >= n:
total_res.append(sub_res[:])
return
if left == 0 and pos < n:
return
if pos < n and s[pos] == '0':
sub_res.append(s[pos])
self.dfs(s,n,pos + 1, sub_res,total_res, left - 1)
sub_res.pop()
return
for delt in range(3, 0, -1):
if delt + pos > n:
continue
target = int(s[pos:delt + pos])
if target > 255:
continue
sub_res.append(s[pos:delt + pos])
self.dfs(s, n, pos + delt, sub_res, total_res, left - 1)
sub_res.pop()
def restoreIpAddresses(self, s: str):
n = len(s)
if n < 4:
return []
if n == 4:
return [".".join(s)]
res = []
self.dfs(s, n, 0, [], res, 4)
return [".".join(x) for x in res]
# sl = Solution()
# t1 = "25525511135"
# res = sl.restoreIpAddresses(t1)
# print(res)
sl = Solution()
t1 = "010010"
res = sl.restoreIpAddresses(t1)
print(res)
| class Solution:
def dfs(self, s: str, n: int, pos: int, sub_res: list, total_res: list, left: int):
if left == 0 and pos >= n:
total_res.append(sub_res[:])
return
if left == 0 and pos < n:
return
if pos < n and s[pos] == '0':
sub_res.append(s[pos])
self.dfs(s, n, pos + 1, sub_res, total_res, left - 1)
sub_res.pop()
return
for delt in range(3, 0, -1):
if delt + pos > n:
continue
target = int(s[pos:delt + pos])
if target > 255:
continue
sub_res.append(s[pos:delt + pos])
self.dfs(s, n, pos + delt, sub_res, total_res, left - 1)
sub_res.pop()
def restore_ip_addresses(self, s: str):
n = len(s)
if n < 4:
return []
if n == 4:
return ['.'.join(s)]
res = []
self.dfs(s, n, 0, [], res, 4)
return ['.'.join(x) for x in res]
sl = solution()
t1 = '010010'
res = sl.restoreIpAddresses(t1)
print(res) |
collection = ["gold", "silver", "bronze"]
# list comprehension
new_list = [item.upper for item in collection]
# generator expression
# it is similar to list comprehension, but use () round brackets
my_gen = (item.upper for item in collection) | collection = ['gold', 'silver', 'bronze']
new_list = [item.upper for item in collection]
my_gen = (item.upper for item in collection) |
grader_tools = {}
def tool(f):
grader_tools[f.__name__] = f
return f
@tool
def percentage(x, y):
"""
Convert x/y into a percentage. Useful for calculating success rate
Args:
x (int)
y (int)
Returns:
str: percentage formatted into a string
"""
return '%.2f%%' % (100 * x / y)
| grader_tools = {}
def tool(f):
grader_tools[f.__name__] = f
return f
@tool
def percentage(x, y):
"""
Convert x/y into a percentage. Useful for calculating success rate
Args:
x (int)
y (int)
Returns:
str: percentage formatted into a string
"""
return '%.2f%%' % (100 * x / y) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.