content
stringlengths 7
1.05M
|
---|
class dotRebarEndDetailStrip_t(object):
# no doc
RebarHookData=None
RebarStrip=None
RebarThreading=None
|
x = 1
if x == 1:
print("x is 1")
else:
print("x is not 1")
|
# lextab.py. This file automatically created by PLY (version 3.4). Don't edit!
_tabversion = "3.4"
_lextokens = {
"SHORT": 1,
"BOOLCONSTANT": 1,
"USHORT": 1,
"UBYTE": 1,
"DUBCONSTANT": 1,
"FILE_IDENTIFIER": 1,
"ULONG": 1,
"FILE_EXTENSION": 1,
"LONG": 1,
"UNION": 1,
"TABLE": 1,
"IDENTIFIER": 1,
"STRING": 1,
"INTCONSTANT": 1,
"ENUM": 1,
"NAMESPACE": 1,
"LITERAL": 1,
"UINT": 1,
"BYTE": 1,
"INCLUDE": 1,
"STRUCT": 1,
"ROOT_TYPE": 1,
"INT": 1,
"ATTRIBUTE": 1,
"FLOAT": 1,
"BOOL": 1,
"DOUBLE": 1,
}
_lexreflags = 0
_lexliterals = ":;,=*{}()<>[]"
_lexstateinfo = {"INITIAL": "inclusive"}
_lexstatere = {
"INITIAL": [
(
"(?P<t_newline>\\n+)|(?P<t_ignore_SILLYCOMM>\\/\\*\\**\\*\\/)|(?P<t_ignore_MULTICOMM>\\/\\*[^*]\\/*([^*/]|[^*]\\/|\\*[^/])*\\**\\*\\/)|(?P<t_ignore_DOCTEXT>\\/\\*\\*([^*/]|[^*]\\/|\\*[^/])*\\**\\*\\/)|(?P<t_BOOLCONSTANT>\\btrue\\b|\\bfalse\\b)|(?P<t_DUBCONSTANT>-?\\d+\\.\\d*(e-?\\d+)?)|(?P<t_HEXCONSTANT>0x[0-9A-Fa-f]+)|(?P<t_INTCONSTANT>[+-]?[0-9]+)|(?P<t_LITERAL>(\\\"([^\\\\\\n]|(\\\\.))*?\\\")|\\'([^\\\\\\n]|(\\\\.))*?\\')|(?P<t_IDENTIFIER>[a-zA-Z_](\\.[a-zA-Z_0-9]|[a-zA-Z_0-9])*)|(?P<t_ignore_COMMENT>\\/\\/[^\\n]*)|(?P<t_ignore_UNIXCOMMENT>\\#[^\\n]*)",
[
None,
("t_newline", "newline"),
("t_ignore_SILLYCOMM", "ignore_SILLYCOMM"),
("t_ignore_MULTICOMM", "ignore_MULTICOMM"),
None,
("t_ignore_DOCTEXT", "ignore_DOCTEXT"),
None,
("t_BOOLCONSTANT", "BOOLCONSTANT"),
("t_DUBCONSTANT", "DUBCONSTANT"),
None,
("t_HEXCONSTANT", "HEXCONSTANT"),
("t_INTCONSTANT", "INTCONSTANT"),
("t_LITERAL", "LITERAL"),
None,
None,
None,
None,
None,
("t_IDENTIFIER", "IDENTIFIER"),
None,
(None, None),
(None, None),
],
)
]
}
_lexstateignore = {"INITIAL": " \t\r"}
_lexstateerrorf = {"INITIAL": "t_error"}
|
#
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.Core')
def gem():
@export
def execute(f):
f()
return execute
#
# intern_arrange
#
@built_in
def intern_arrange(format, *arguments):
return intern_string(format % arguments)
#
# line
#
flush_standard_output = PythonSystem.stdout.flush
write_standard_output = PythonSystem.stdout.write
@built_in
def line(format = none, *arguments):
if format is none:
assert length(arguments) is 0
write_standard_output('\n')
else:
write_standard_output((format % arguments if arguments else format) + '\n')
flush_standard_output()
#
# privileged_2
#
if is_python_2:
export(
'privileged_2', rename_function('privileged_2', privileged)
)
else:
@export
def privileged_2(f):
return f
built_in(
#
# Types
#
'Boolean', PythonBuiltIn.bool,
'Bytes', PythonBuiltIn.bytes,
'Integer', PythonBuiltIn.int,
'FrozenSet', PythonBuiltIn.frozenset,
'List', PythonBuiltIn.list,
'Map', PythonBuiltIn.dict,
'Object', PythonBuiltIn.object,
'Tuple', PythonBuiltIn.tuple,
#
# Functions
#
'character', PythonBuiltIn.chr,
'enumerate', PythonBuiltIn.enumerate,
'globals', PythonBuiltIn.globals,
'introspection', PythonBuiltIn.dir,
'iterate', PythonBuiltIn.iter,
'iterate_range', PythonBuiltIn.range,
'maximum', PythonBuiltIn.max,
'ordinal', PythonBuiltIn.ord,
'portray', PythonBuiltIn.repr,
'property', PythonBuiltIn.property,
'sorted_list', PythonBuiltIn.sorted,
'static_method', PythonBuiltIn.staticmethod,
'type', PythonBuiltIn.type,
#
# Values
#
'__debug__', PythonBuiltIn.__debug__,
)
if __debug__:
built_in(PythonException.AssertionError)
|
set_name(0x8013923C, "PreGameOnlyTestRoutine__Fv", SN_NOWARN)
set_name(0x8013B300, "DRLG_PlaceDoor__Fii", SN_NOWARN)
set_name(0x8013B7D4, "DRLG_L1Shadows__Fv", SN_NOWARN)
set_name(0x8013BBEC, "DRLG_PlaceMiniSet__FPCUciiiiiii", SN_NOWARN)
set_name(0x8013C058, "DRLG_L1Floor__Fv", SN_NOWARN)
set_name(0x8013C144, "StoreBlock__FPiii", SN_NOWARN)
set_name(0x8013C1F0, "DRLG_L1Pass3__Fv", SN_NOWARN)
set_name(0x8013C3A4, "DRLG_LoadL1SP__Fv", SN_NOWARN)
set_name(0x8013C480, "DRLG_FreeL1SP__Fv", SN_NOWARN)
set_name(0x8013C4B0, "DRLG_Init_Globals__Fv", SN_NOWARN)
set_name(0x8013C554, "set_restore_lighting__Fv", SN_NOWARN)
set_name(0x8013C5E4, "DRLG_InitL1Vals__Fv", SN_NOWARN)
set_name(0x8013C5EC, "LoadL1Dungeon__FPcii", SN_NOWARN)
set_name(0x8013C7B8, "LoadPreL1Dungeon__FPcii", SN_NOWARN)
set_name(0x8013C970, "InitL5Dungeon__Fv", SN_NOWARN)
set_name(0x8013C9D0, "L5ClearFlags__Fv", SN_NOWARN)
set_name(0x8013CA1C, "L5drawRoom__Fiiii", SN_NOWARN)
set_name(0x8013CA88, "L5checkRoom__Fiiii", SN_NOWARN)
set_name(0x8013CB1C, "L5roomGen__Fiiiii", SN_NOWARN)
set_name(0x8013CE18, "L5firstRoom__Fv", SN_NOWARN)
set_name(0x8013D1D4, "L5GetArea__Fv", SN_NOWARN)
set_name(0x8013D234, "L5makeDungeon__Fv", SN_NOWARN)
set_name(0x8013D2C0, "L5makeDmt__Fv", SN_NOWARN)
set_name(0x8013D3A8, "L5HWallOk__Fii", SN_NOWARN)
set_name(0x8013D4E4, "L5VWallOk__Fii", SN_NOWARN)
set_name(0x8013D630, "L5HorizWall__Fiici", SN_NOWARN)
set_name(0x8013D870, "L5VertWall__Fiici", SN_NOWARN)
set_name(0x8013DAA4, "L5AddWall__Fv", SN_NOWARN)
set_name(0x8013DD14, "DRLG_L5GChamber__Fiiiiii", SN_NOWARN)
set_name(0x8013DFD4, "DRLG_L5GHall__Fiiii", SN_NOWARN)
set_name(0x8013E088, "L5tileFix__Fv", SN_NOWARN)
set_name(0x8013E94C, "DRLG_L5Subs__Fv", SN_NOWARN)
set_name(0x8013EB44, "DRLG_L5SetRoom__Fii", SN_NOWARN)
set_name(0x8013EC44, "L5FillChambers__Fv", SN_NOWARN)
set_name(0x8013F330, "DRLG_L5FTVR__Fiiiii", SN_NOWARN)
set_name(0x8013F878, "DRLG_L5FloodTVal__Fv", SN_NOWARN)
set_name(0x8013F97C, "DRLG_L5TransFix__Fv", SN_NOWARN)
set_name(0x8013FB8C, "DRLG_L5DirtFix__Fv", SN_NOWARN)
set_name(0x8013FCE8, "DRLG_L5CornerFix__Fv", SN_NOWARN)
set_name(0x8013FDF8, "DRLG_L5__Fi", SN_NOWARN)
set_name(0x80140318, "CreateL5Dungeon__FUii", SN_NOWARN)
set_name(0x801428F0, "DRLG_L2PlaceMiniSet__FPUciiiiii", SN_NOWARN)
set_name(0x80142CE4, "DRLG_L2PlaceRndSet__FPUci", SN_NOWARN)
set_name(0x80142FE4, "DRLG_L2Subs__Fv", SN_NOWARN)
set_name(0x801431D8, "DRLG_L2Shadows__Fv", SN_NOWARN)
set_name(0x8014339C, "InitDungeon__Fv", SN_NOWARN)
set_name(0x801433FC, "DRLG_LoadL2SP__Fv", SN_NOWARN)
set_name(0x801434BC, "DRLG_FreeL2SP__Fv", SN_NOWARN)
set_name(0x801434EC, "DRLG_L2SetRoom__Fii", SN_NOWARN)
set_name(0x801435EC, "DefineRoom__Fiiiii", SN_NOWARN)
set_name(0x801437F8, "CreateDoorType__Fii", SN_NOWARN)
set_name(0x801438DC, "PlaceHallExt__Fii", SN_NOWARN)
set_name(0x80143914, "AddHall__Fiiiii", SN_NOWARN)
set_name(0x801439EC, "CreateRoom__Fiiiiiiiii", SN_NOWARN)
set_name(0x80144074, "GetHall__FPiN40", SN_NOWARN)
set_name(0x8014410C, "ConnectHall__Fiiiii", SN_NOWARN)
set_name(0x80144774, "DoPatternCheck__Fii", SN_NOWARN)
set_name(0x80144A2C, "L2TileFix__Fv", SN_NOWARN)
set_name(0x80144B50, "DL2_Cont__FUcUcUcUc", SN_NOWARN)
set_name(0x80144BD0, "DL2_NumNoChar__Fv", SN_NOWARN)
set_name(0x80144C2C, "DL2_DrawRoom__Fiiii", SN_NOWARN)
set_name(0x80144D30, "DL2_KnockWalls__Fiiii", SN_NOWARN)
set_name(0x80144F00, "DL2_FillVoids__Fv", SN_NOWARN)
set_name(0x80145884, "CreateDungeon__Fv", SN_NOWARN)
set_name(0x80145B90, "DRLG_L2Pass3__Fv", SN_NOWARN)
set_name(0x80145D28, "DRLG_L2FTVR__Fiiiii", SN_NOWARN)
set_name(0x80146270, "DRLG_L2FloodTVal__Fv", SN_NOWARN)
set_name(0x80146374, "DRLG_L2TransFix__Fv", SN_NOWARN)
set_name(0x80146584, "L2DirtFix__Fv", SN_NOWARN)
set_name(0x801466E4, "L2LockoutFix__Fv", SN_NOWARN)
set_name(0x80146A70, "L2DoorFix__Fv", SN_NOWARN)
set_name(0x80146B20, "DRLG_L2__Fi", SN_NOWARN)
set_name(0x8014756C, "DRLG_InitL2Vals__Fv", SN_NOWARN)
set_name(0x80147574, "LoadL2Dungeon__FPcii", SN_NOWARN)
set_name(0x80147764, "LoadPreL2Dungeon__FPcii", SN_NOWARN)
set_name(0x80147950, "CreateL2Dungeon__FUii", SN_NOWARN)
set_name(0x80148308, "InitL3Dungeon__Fv", SN_NOWARN)
set_name(0x80148390, "DRLG_L3FillRoom__Fiiii", SN_NOWARN)
set_name(0x801485EC, "DRLG_L3CreateBlock__Fiiii", SN_NOWARN)
set_name(0x80148888, "DRLG_L3FloorArea__Fiiii", SN_NOWARN)
set_name(0x801488F0, "DRLG_L3FillDiags__Fv", SN_NOWARN)
set_name(0x80148A20, "DRLG_L3FillSingles__Fv", SN_NOWARN)
set_name(0x80148AEC, "DRLG_L3FillStraights__Fv", SN_NOWARN)
set_name(0x80148EB0, "DRLG_L3Edges__Fv", SN_NOWARN)
set_name(0x80148EF0, "DRLG_L3GetFloorArea__Fv", SN_NOWARN)
set_name(0x80148F40, "DRLG_L3MakeMegas__Fv", SN_NOWARN)
set_name(0x80149084, "DRLG_L3River__Fv", SN_NOWARN)
set_name(0x80149AC4, "DRLG_L3SpawnEdge__FiiPi", SN_NOWARN)
set_name(0x80149D50, "DRLG_L3Spawn__FiiPi", SN_NOWARN)
set_name(0x80149F64, "DRLG_L3Pool__Fv", SN_NOWARN)
set_name(0x8014A1B8, "DRLG_L3PoolFix__Fv", SN_NOWARN)
set_name(0x8014A2EC, "DRLG_L3PlaceMiniSet__FPCUciiiiii", SN_NOWARN)
set_name(0x8014A66C, "DRLG_L3PlaceRndSet__FPCUci", SN_NOWARN)
set_name(0x8014A9B4, "WoodVertU__Fii", SN_NOWARN)
set_name(0x8014AA60, "WoodVertD__Fii", SN_NOWARN)
set_name(0x8014AAFC, "WoodHorizL__Fii", SN_NOWARN)
set_name(0x8014AB90, "WoodHorizR__Fii", SN_NOWARN)
set_name(0x8014AC14, "AddFenceDoors__Fv", SN_NOWARN)
set_name(0x8014ACF8, "FenceDoorFix__Fv", SN_NOWARN)
set_name(0x8014AEEC, "DRLG_L3Wood__Fv", SN_NOWARN)
set_name(0x8014B6DC, "DRLG_L3Anvil__Fv", SN_NOWARN)
set_name(0x8014B938, "FixL3Warp__Fv", SN_NOWARN)
set_name(0x8014BA20, "FixL3HallofHeroes__Fv", SN_NOWARN)
set_name(0x8014BB74, "DRLG_L3LockRec__Fii", SN_NOWARN)
set_name(0x8014BC10, "DRLG_L3Lockout__Fv", SN_NOWARN)
set_name(0x8014BCD0, "DRLG_L3__Fi", SN_NOWARN)
set_name(0x8014C3F0, "DRLG_L3Pass3__Fv", SN_NOWARN)
set_name(0x8014C594, "CreateL3Dungeon__FUii", SN_NOWARN)
set_name(0x8014C6A8, "LoadL3Dungeon__FPcii", SN_NOWARN)
set_name(0x8014C8CC, "LoadPreL3Dungeon__FPcii", SN_NOWARN)
set_name(0x8014E718, "DRLG_L4Shadows__Fv", SN_NOWARN)
set_name(0x8014E7DC, "InitL4Dungeon__Fv", SN_NOWARN)
set_name(0x8014E878, "DRLG_LoadL4SP__Fv", SN_NOWARN)
set_name(0x8014E91C, "DRLG_FreeL4SP__Fv", SN_NOWARN)
set_name(0x8014E944, "DRLG_L4SetSPRoom__Fii", SN_NOWARN)
set_name(0x8014EA44, "L4makeDmt__Fv", SN_NOWARN)
set_name(0x8014EAE8, "L4HWallOk__Fii", SN_NOWARN)
set_name(0x8014EC38, "L4VWallOk__Fii", SN_NOWARN)
set_name(0x8014EDB4, "L4HorizWall__Fiii", SN_NOWARN)
set_name(0x8014EF84, "L4VertWall__Fiii", SN_NOWARN)
set_name(0x8014F14C, "L4AddWall__Fv", SN_NOWARN)
set_name(0x8014F62C, "L4tileFix__Fv", SN_NOWARN)
set_name(0x80151814, "DRLG_L4Subs__Fv", SN_NOWARN)
set_name(0x801519EC, "L4makeDungeon__Fv", SN_NOWARN)
set_name(0x80151C24, "uShape__Fv", SN_NOWARN)
set_name(0x80151EC8, "GetArea__Fv", SN_NOWARN)
set_name(0x80151F24, "L4drawRoom__Fiiii", SN_NOWARN)
set_name(0x80151F8C, "L4checkRoom__Fiiii", SN_NOWARN)
set_name(0x80152028, "L4roomGen__Fiiiii", SN_NOWARN)
set_name(0x80152324, "L4firstRoom__Fv", SN_NOWARN)
set_name(0x80152540, "L4SaveQuads__Fv", SN_NOWARN)
set_name(0x801525E0, "DRLG_L4SetRoom__FPUcii", SN_NOWARN)
set_name(0x801526B4, "DRLG_LoadDiabQuads__FUc", SN_NOWARN)
set_name(0x80152838, "DRLG_L4PlaceMiniSet__FPCUciiiiii", SN_NOWARN)
set_name(0x80152C50, "DRLG_L4FTVR__Fiiiii", SN_NOWARN)
set_name(0x80153198, "DRLG_L4FloodTVal__Fv", SN_NOWARN)
set_name(0x8015329C, "IsDURWall__Fc", SN_NOWARN)
set_name(0x801532CC, "IsDLLWall__Fc", SN_NOWARN)
set_name(0x801532FC, "DRLG_L4TransFix__Fv", SN_NOWARN)
set_name(0x80153654, "DRLG_L4Corners__Fv", SN_NOWARN)
set_name(0x801536E8, "L4FixRim__Fv", SN_NOWARN)
set_name(0x80153724, "DRLG_L4GeneralFix__Fv", SN_NOWARN)
set_name(0x801537C8, "DRLG_L4__Fi", SN_NOWARN)
set_name(0x801540C4, "DRLG_L4Pass3__Fv", SN_NOWARN)
set_name(0x80154268, "CreateL4Dungeon__FUii", SN_NOWARN)
set_name(0x80154348, "ObjIndex__Fii", SN_NOWARN)
set_name(0x801543FC, "AddSKingObjs__Fv", SN_NOWARN)
set_name(0x8015452C, "AddSChamObjs__Fv", SN_NOWARN)
set_name(0x801545A8, "AddVileObjs__Fv", SN_NOWARN)
set_name(0x80154654, "DRLG_SetMapTrans__FPc", SN_NOWARN)
set_name(0x80154718, "LoadSetMap__Fv", SN_NOWARN)
set_name(0x80154A40, "CM_QuestToBitPattern__Fi", SN_NOWARN)
set_name(0x80154B18, "CM_ShowMonsterList__Fii", SN_NOWARN)
set_name(0x80154B90, "CM_ChooseMonsterList__FiUl", SN_NOWARN)
set_name(0x80154C30, "NoUiListChoose__FiUl", SN_NOWARN)
set_name(0x80154C38, "ChooseTask__FP4TASK", SN_NOWARN)
set_name(0x8015514C, "ShowTask__FP4TASK", SN_NOWARN)
set_name(0x8015537C, "GetListsAvailable__FiUlPUc", SN_NOWARN)
set_name(0x801554A0, "GetDown__C4CPad", SN_NOWARN)
set_name(0x801554C8, "FillSolidBlockTbls__Fv", SN_NOWARN)
set_name(0x80155674, "SetDungeonMicros__Fv", SN_NOWARN)
set_name(0x8015567C, "DRLG_InitTrans__Fv", SN_NOWARN)
set_name(0x801556F0, "DRLG_RectTrans__Fiiii", SN_NOWARN)
set_name(0x80155770, "DRLG_CopyTrans__Fiiii", SN_NOWARN)
set_name(0x801557D8, "DRLG_ListTrans__FiPUc", SN_NOWARN)
set_name(0x8015584C, "DRLG_AreaTrans__FiPUc", SN_NOWARN)
set_name(0x801558DC, "DRLG_InitSetPC__Fv", SN_NOWARN)
set_name(0x801558F4, "DRLG_SetPC__Fv", SN_NOWARN)
set_name(0x801559A4, "Make_SetPC__Fiiii", SN_NOWARN)
set_name(0x80155A44, "DRLG_WillThemeRoomFit__FiiiiiPiT5", SN_NOWARN)
set_name(0x80155D0C, "DRLG_CreateThemeRoom__Fi", SN_NOWARN)
set_name(0x80156D14, "DRLG_PlaceThemeRooms__FiiiiUc", SN_NOWARN)
set_name(0x80156FBC, "DRLG_HoldThemeRooms__Fv", SN_NOWARN)
set_name(0x80157170, "SkipThemeRoom__Fii", SN_NOWARN)
set_name(0x8015723C, "InitLevels__Fv", SN_NOWARN)
set_name(0x80157340, "TFit_Shrine__Fi", SN_NOWARN)
set_name(0x801575B0, "TFit_Obj5__Fi", SN_NOWARN)
set_name(0x80157784, "TFit_SkelRoom__Fi", SN_NOWARN)
set_name(0x80157834, "TFit_GoatShrine__Fi", SN_NOWARN)
set_name(0x801578CC, "CheckThemeObj3__Fiiii", SN_NOWARN)
set_name(0x80157A1C, "TFit_Obj3__Fi", SN_NOWARN)
set_name(0x80157ADC, "CheckThemeReqs__Fi", SN_NOWARN)
set_name(0x80157BA8, "SpecialThemeFit__Fii", SN_NOWARN)
set_name(0x80157D84, "CheckThemeRoom__Fi", SN_NOWARN)
set_name(0x80158030, "InitThemes__Fv", SN_NOWARN)
set_name(0x8015837C, "HoldThemeRooms__Fv", SN_NOWARN)
set_name(0x80158464, "PlaceThemeMonsts__Fii", SN_NOWARN)
set_name(0x80158608, "Theme_Barrel__Fi", SN_NOWARN)
set_name(0x80158780, "Theme_Shrine__Fi", SN_NOWARN)
set_name(0x80158868, "Theme_MonstPit__Fi", SN_NOWARN)
set_name(0x8015898C, "Theme_SkelRoom__Fi", SN_NOWARN)
set_name(0x80158C90, "Theme_Treasure__Fi", SN_NOWARN)
set_name(0x80158EF4, "Theme_Library__Fi", SN_NOWARN)
set_name(0x80159164, "Theme_Torture__Fi", SN_NOWARN)
set_name(0x801592D4, "Theme_BloodFountain__Fi", SN_NOWARN)
set_name(0x80159348, "Theme_Decap__Fi", SN_NOWARN)
set_name(0x801594B8, "Theme_PurifyingFountain__Fi", SN_NOWARN)
set_name(0x8015952C, "Theme_ArmorStand__Fi", SN_NOWARN)
set_name(0x801596C4, "Theme_GoatShrine__Fi", SN_NOWARN)
set_name(0x80159814, "Theme_Cauldron__Fi", SN_NOWARN)
set_name(0x80159888, "Theme_MurkyFountain__Fi", SN_NOWARN)
set_name(0x801598FC, "Theme_TearFountain__Fi", SN_NOWARN)
set_name(0x80159970, "Theme_BrnCross__Fi", SN_NOWARN)
set_name(0x80159AE8, "Theme_WeaponRack__Fi", SN_NOWARN)
set_name(0x80159C80, "UpdateL4Trans__Fv", SN_NOWARN)
set_name(0x80159CE0, "CreateThemeRooms__Fv", SN_NOWARN)
set_name(0x80159EC4, "InitPortals__Fv", SN_NOWARN)
set_name(0x80159F24, "InitQuests__Fv", SN_NOWARN)
set_name(0x8015A328, "DrawButcher__Fv", SN_NOWARN)
set_name(0x8015A36C, "DrawSkelKing__Fiii", SN_NOWARN)
set_name(0x8015A3A8, "DrawWarLord__Fii", SN_NOWARN)
set_name(0x8015A4A4, "DrawSChamber__Fiii", SN_NOWARN)
set_name(0x8015A5E0, "DrawLTBanner__Fii", SN_NOWARN)
set_name(0x8015A6BC, "DrawBlind__Fii", SN_NOWARN)
set_name(0x8015A798, "DrawBlood__Fii", SN_NOWARN)
set_name(0x8015A878, "DRLG_CheckQuests__Fii", SN_NOWARN)
set_name(0x8015A9B4, "InitInv__Fv", SN_NOWARN)
set_name(0x8015AA08, "InitAutomap__Fv", SN_NOWARN)
set_name(0x8015ABDC, "InitAutomapOnce__Fv", SN_NOWARN)
set_name(0x8015ABEC, "MonstPlace__Fii", SN_NOWARN)
set_name(0x8015ACA8, "InitMonsterGFX__Fi", SN_NOWARN)
set_name(0x8015AD80, "PlaceMonster__Fiiii", SN_NOWARN)
set_name(0x8015AE20, "AddMonsterType__Fii", SN_NOWARN)
set_name(0x8015AF1C, "GetMonsterTypes__FUl", SN_NOWARN)
set_name(0x8015AFCC, "ClrAllMonsters__Fv", SN_NOWARN)
set_name(0x8015B10C, "InitLevelMonsters__Fv", SN_NOWARN)
set_name(0x8015B190, "GetLevelMTypes__Fv", SN_NOWARN)
set_name(0x8015B61C, "PlaceQuestMonsters__Fv", SN_NOWARN)
set_name(0x8015B9E0, "LoadDiabMonsts__Fv", SN_NOWARN)
set_name(0x8015BAF0, "PlaceGroup__FiiUci", SN_NOWARN)
set_name(0x8015C090, "SetMapMonsters__FPUcii", SN_NOWARN)
set_name(0x8015C2B4, "InitMonsters__Fv", SN_NOWARN)
set_name(0x8015C664, "PlaceUniqueMonst__Fiii", SN_NOWARN)
set_name(0x8015CF30, "PlaceUniques__Fv", SN_NOWARN)
set_name(0x8015D0C0, "PreSpawnSkeleton__Fv", SN_NOWARN)
set_name(0x8015D200, "encode_enemy__Fi", SN_NOWARN)
set_name(0x8015D258, "decode_enemy__Fii", SN_NOWARN)
set_name(0x8015D370, "IsGoat__Fi", SN_NOWARN)
set_name(0x8015D39C, "InitMissiles__Fv", SN_NOWARN)
set_name(0x8015D574, "InitNoTriggers__Fv", SN_NOWARN)
set_name(0x8015D598, "InitTownTriggers__Fv", SN_NOWARN)
set_name(0x8015D8F8, "InitL1Triggers__Fv", SN_NOWARN)
set_name(0x8015DA0C, "InitL2Triggers__Fv", SN_NOWARN)
set_name(0x8015DB9C, "InitL3Triggers__Fv", SN_NOWARN)
set_name(0x8015DCF8, "InitL4Triggers__Fv", SN_NOWARN)
set_name(0x8015DF0C, "InitSKingTriggers__Fv", SN_NOWARN)
set_name(0x8015DF58, "InitSChambTriggers__Fv", SN_NOWARN)
set_name(0x8015DFA4, "InitPWaterTriggers__Fv", SN_NOWARN)
set_name(0x8015DFF0, "InitStores__Fv", SN_NOWARN)
set_name(0x8015E070, "SetupTownStores__Fv", SN_NOWARN)
set_name(0x8015E220, "DeltaLoadLevel__Fv", SN_NOWARN)
set_name(0x8015EAF8, "AddL1Door__Fiiii", SN_NOWARN)
set_name(0x8015EC30, "AddSCambBook__Fi", SN_NOWARN)
set_name(0x8015ECD0, "AddChest__Fii", SN_NOWARN)
set_name(0x8015EEB0, "AddL2Door__Fiiii", SN_NOWARN)
set_name(0x8015EFFC, "AddL3Door__Fiiii", SN_NOWARN)
set_name(0x8015F090, "AddSarc__Fi", SN_NOWARN)
set_name(0x8015F16C, "AddFlameTrap__Fi", SN_NOWARN)
set_name(0x8015F1C8, "AddTrap__Fii", SN_NOWARN)
set_name(0x8015F2C0, "AddArmorStand__Fi", SN_NOWARN)
set_name(0x8015F348, "AddObjLight__Fii", SN_NOWARN)
set_name(0x8015F3F0, "AddBarrel__Fii", SN_NOWARN)
set_name(0x8015F4A0, "AddShrine__Fi", SN_NOWARN)
set_name(0x8015F5F0, "AddBookcase__Fi", SN_NOWARN)
set_name(0x8015F648, "AddBookstand__Fi", SN_NOWARN)
set_name(0x8015F690, "AddBloodFtn__Fi", SN_NOWARN)
set_name(0x8015F6D8, "AddPurifyingFountain__Fi", SN_NOWARN)
set_name(0x8015F7B4, "AddGoatShrine__Fi", SN_NOWARN)
set_name(0x8015F7FC, "AddCauldron__Fi", SN_NOWARN)
set_name(0x8015F844, "AddMurkyFountain__Fi", SN_NOWARN)
set_name(0x8015F920, "AddTearFountain__Fi", SN_NOWARN)
set_name(0x8015F968, "AddDecap__Fi", SN_NOWARN)
set_name(0x8015F9E0, "AddVilebook__Fi", SN_NOWARN)
set_name(0x8015FA30, "AddMagicCircle__Fi", SN_NOWARN)
set_name(0x8015FAB8, "AddBrnCross__Fi", SN_NOWARN)
set_name(0x8015FB00, "AddPedistal__Fi", SN_NOWARN)
set_name(0x8015FB74, "AddStoryBook__Fi", SN_NOWARN)
set_name(0x8015FD40, "AddWeaponRack__Fi", SN_NOWARN)
set_name(0x8015FDC8, "AddTorturedBody__Fi", SN_NOWARN)
set_name(0x8015FE44, "AddFlameLvr__Fi", SN_NOWARN)
set_name(0x8015FE84, "GetRndObjLoc__FiRiT1", SN_NOWARN)
set_name(0x8015FF90, "AddMushPatch__Fv", SN_NOWARN)
set_name(0x801600B4, "AddSlainHero__Fv", SN_NOWARN)
set_name(0x801600F4, "RndLocOk__Fii", SN_NOWARN)
set_name(0x801601D8, "TrapLocOk__Fii", SN_NOWARN)
set_name(0x80160240, "RoomLocOk__Fii", SN_NOWARN)
set_name(0x801602D8, "InitRndLocObj__Fiii", SN_NOWARN)
set_name(0x80160484, "InitRndLocBigObj__Fiii", SN_NOWARN)
set_name(0x8016067C, "InitRndLocObj5x5__Fiii", SN_NOWARN)
set_name(0x801607A4, "SetMapObjects__FPUcii", SN_NOWARN)
set_name(0x80160A44, "ClrAllObjects__Fv", SN_NOWARN)
set_name(0x80160B34, "AddTortures__Fv", SN_NOWARN)
set_name(0x80160CC0, "AddCandles__Fv", SN_NOWARN)
set_name(0x80160D48, "AddTrapLine__Fiiii", SN_NOWARN)
set_name(0x801610E4, "AddLeverObj__Fiiiiiiii", SN_NOWARN)
set_name(0x801610EC, "AddBookLever__Fiiiiiiiii", SN_NOWARN)
set_name(0x80161300, "InitRndBarrels__Fv", SN_NOWARN)
set_name(0x8016149C, "AddL1Objs__Fiiii", SN_NOWARN)
set_name(0x801615D4, "AddL2Objs__Fiiii", SN_NOWARN)
set_name(0x801616E8, "AddL3Objs__Fiiii", SN_NOWARN)
set_name(0x801617E8, "WallTrapLocOk__Fii", SN_NOWARN)
set_name(0x80161850, "TorchLocOK__Fii", SN_NOWARN)
set_name(0x80161890, "AddL2Torches__Fv", SN_NOWARN)
set_name(0x80161A44, "AddObjTraps__Fv", SN_NOWARN)
set_name(0x80161DBC, "AddChestTraps__Fv", SN_NOWARN)
set_name(0x80161F0C, "LoadMapObjects__FPUciiiiiii", SN_NOWARN)
set_name(0x80162078, "AddDiabObjs__Fv", SN_NOWARN)
set_name(0x801621CC, "AddStoryBooks__Fv", SN_NOWARN)
set_name(0x8016231C, "AddHookedBodies__Fi", SN_NOWARN)
set_name(0x80162514, "AddL4Goodies__Fv", SN_NOWARN)
set_name(0x801625C4, "AddLazStand__Fv", SN_NOWARN)
set_name(0x80162764, "InitObjects__Fv", SN_NOWARN)
set_name(0x80162DC8, "PreObjObjAddSwitch__Fiiii", SN_NOWARN)
set_name(0x801630D0, "SmithItemOk__Fi", SN_NOWARN)
set_name(0x80163134, "RndSmithItem__Fi", SN_NOWARN)
set_name(0x80163240, "WitchItemOk__Fi", SN_NOWARN)
set_name(0x80163380, "RndWitchItem__Fi", SN_NOWARN)
set_name(0x80163480, "BubbleSwapItem__FP10ItemStructT0", SN_NOWARN)
set_name(0x80163570, "SortWitch__Fv", SN_NOWARN)
set_name(0x80163690, "RndBoyItem__Fi", SN_NOWARN)
set_name(0x801637B4, "HealerItemOk__Fi", SN_NOWARN)
set_name(0x80163968, "RndHealerItem__Fi", SN_NOWARN)
set_name(0x80163A68, "RecreatePremiumItem__Fiiii", SN_NOWARN)
set_name(0x80163B30, "RecreateWitchItem__Fiiii", SN_NOWARN)
set_name(0x80163C88, "RecreateSmithItem__Fiiii", SN_NOWARN)
set_name(0x80163D24, "RecreateHealerItem__Fiiii", SN_NOWARN)
set_name(0x80163DE4, "RecreateBoyItem__Fiiii", SN_NOWARN)
set_name(0x80163EA8, "RecreateTownItem__FiiUsii", SN_NOWARN)
set_name(0x80163F34, "SpawnSmith__Fi", SN_NOWARN)
set_name(0x801640D4, "SpawnWitch__Fi", SN_NOWARN)
set_name(0x80164450, "SpawnHealer__Fi", SN_NOWARN)
set_name(0x8016477C, "SpawnBoy__Fi", SN_NOWARN)
set_name(0x801648D4, "SortSmith__Fv", SN_NOWARN)
set_name(0x801649E8, "SortHealer__Fv", SN_NOWARN)
set_name(0x80164B08, "RecreateItem__FiiUsii", SN_NOWARN)
set_name(0x801392A8, "themeLoc", SN_NOWARN)
set_name(0x801399F0, "OldBlock", SN_NOWARN)
set_name(0x80139A00, "L5dungeon", SN_NOWARN)
set_name(0x80139690, "SPATS", SN_NOWARN)
set_name(0x80139794, "BSTYPES", SN_NOWARN)
set_name(0x80139864, "L5BTYPES", SN_NOWARN)
set_name(0x80139934, "STAIRSUP", SN_NOWARN)
set_name(0x80139958, "L5STAIRSUP", SN_NOWARN)
set_name(0x8013997C, "STAIRSDOWN", SN_NOWARN)
set_name(0x80139998, "LAMPS", SN_NOWARN)
set_name(0x801399A4, "PWATERIN", SN_NOWARN)
set_name(0x80139298, "L5ConvTbl", SN_NOWARN)
set_name(0x80141C5C, "RoomList", SN_NOWARN)
set_name(0x801422B0, "predungeon", SN_NOWARN)
set_name(0x801403B8, "Dir_Xadd", SN_NOWARN)
set_name(0x801403CC, "Dir_Yadd", SN_NOWARN)
set_name(0x801403E0, "SPATSL2", SN_NOWARN)
set_name(0x801403F0, "BTYPESL2", SN_NOWARN)
set_name(0x80140494, "BSTYPESL2", SN_NOWARN)
set_name(0x80140538, "VARCH1", SN_NOWARN)
set_name(0x8014054C, "VARCH2", SN_NOWARN)
set_name(0x80140560, "VARCH3", SN_NOWARN)
set_name(0x80140574, "VARCH4", SN_NOWARN)
set_name(0x80140588, "VARCH5", SN_NOWARN)
set_name(0x8014059C, "VARCH6", SN_NOWARN)
set_name(0x801405B0, "VARCH7", SN_NOWARN)
set_name(0x801405C4, "VARCH8", SN_NOWARN)
set_name(0x801405D8, "VARCH9", SN_NOWARN)
set_name(0x801405EC, "VARCH10", SN_NOWARN)
set_name(0x80140600, "VARCH11", SN_NOWARN)
set_name(0x80140614, "VARCH12", SN_NOWARN)
set_name(0x80140628, "VARCH13", SN_NOWARN)
set_name(0x8014063C, "VARCH14", SN_NOWARN)
set_name(0x80140650, "VARCH15", SN_NOWARN)
set_name(0x80140664, "VARCH16", SN_NOWARN)
set_name(0x80140678, "VARCH17", SN_NOWARN)
set_name(0x80140688, "VARCH18", SN_NOWARN)
set_name(0x80140698, "VARCH19", SN_NOWARN)
set_name(0x801406A8, "VARCH20", SN_NOWARN)
set_name(0x801406B8, "VARCH21", SN_NOWARN)
set_name(0x801406C8, "VARCH22", SN_NOWARN)
set_name(0x801406D8, "VARCH23", SN_NOWARN)
set_name(0x801406E8, "VARCH24", SN_NOWARN)
set_name(0x801406F8, "VARCH25", SN_NOWARN)
set_name(0x8014070C, "VARCH26", SN_NOWARN)
set_name(0x80140720, "VARCH27", SN_NOWARN)
set_name(0x80140734, "VARCH28", SN_NOWARN)
set_name(0x80140748, "VARCH29", SN_NOWARN)
set_name(0x8014075C, "VARCH30", SN_NOWARN)
set_name(0x80140770, "VARCH31", SN_NOWARN)
set_name(0x80140784, "VARCH32", SN_NOWARN)
set_name(0x80140798, "VARCH33", SN_NOWARN)
set_name(0x801407AC, "VARCH34", SN_NOWARN)
set_name(0x801407C0, "VARCH35", SN_NOWARN)
set_name(0x801407D4, "VARCH36", SN_NOWARN)
set_name(0x801407E8, "VARCH37", SN_NOWARN)
set_name(0x801407FC, "VARCH38", SN_NOWARN)
set_name(0x80140810, "VARCH39", SN_NOWARN)
set_name(0x80140824, "VARCH40", SN_NOWARN)
set_name(0x80140838, "HARCH1", SN_NOWARN)
set_name(0x80140848, "HARCH2", SN_NOWARN)
set_name(0x80140858, "HARCH3", SN_NOWARN)
set_name(0x80140868, "HARCH4", SN_NOWARN)
set_name(0x80140878, "HARCH5", SN_NOWARN)
set_name(0x80140888, "HARCH6", SN_NOWARN)
set_name(0x80140898, "HARCH7", SN_NOWARN)
set_name(0x801408A8, "HARCH8", SN_NOWARN)
set_name(0x801408B8, "HARCH9", SN_NOWARN)
set_name(0x801408C8, "HARCH10", SN_NOWARN)
set_name(0x801408D8, "HARCH11", SN_NOWARN)
set_name(0x801408E8, "HARCH12", SN_NOWARN)
set_name(0x801408F8, "HARCH13", SN_NOWARN)
set_name(0x80140908, "HARCH14", SN_NOWARN)
set_name(0x80140918, "HARCH15", SN_NOWARN)
set_name(0x80140928, "HARCH16", SN_NOWARN)
set_name(0x80140938, "HARCH17", SN_NOWARN)
set_name(0x80140948, "HARCH18", SN_NOWARN)
set_name(0x80140958, "HARCH19", SN_NOWARN)
set_name(0x80140968, "HARCH20", SN_NOWARN)
set_name(0x80140978, "HARCH21", SN_NOWARN)
set_name(0x80140988, "HARCH22", SN_NOWARN)
set_name(0x80140998, "HARCH23", SN_NOWARN)
set_name(0x801409A8, "HARCH24", SN_NOWARN)
set_name(0x801409B8, "HARCH25", SN_NOWARN)
set_name(0x801409C8, "HARCH26", SN_NOWARN)
set_name(0x801409D8, "HARCH27", SN_NOWARN)
set_name(0x801409E8, "HARCH28", SN_NOWARN)
set_name(0x801409F8, "HARCH29", SN_NOWARN)
set_name(0x80140A08, "HARCH30", SN_NOWARN)
set_name(0x80140A18, "HARCH31", SN_NOWARN)
set_name(0x80140A28, "HARCH32", SN_NOWARN)
set_name(0x80140A38, "HARCH33", SN_NOWARN)
set_name(0x80140A48, "HARCH34", SN_NOWARN)
set_name(0x80140A58, "HARCH35", SN_NOWARN)
set_name(0x80140A68, "HARCH36", SN_NOWARN)
set_name(0x80140A78, "HARCH37", SN_NOWARN)
set_name(0x80140A88, "HARCH38", SN_NOWARN)
set_name(0x80140A98, "HARCH39", SN_NOWARN)
set_name(0x80140AA8, "HARCH40", SN_NOWARN)
set_name(0x80140AB8, "USTAIRS", SN_NOWARN)
set_name(0x80140ADC, "DSTAIRS", SN_NOWARN)
set_name(0x80140B00, "WARPSTAIRS", SN_NOWARN)
set_name(0x80140B24, "CRUSHCOL", SN_NOWARN)
set_name(0x80140B38, "BIG1", SN_NOWARN)
set_name(0x80140B44, "BIG2", SN_NOWARN)
set_name(0x80140B50, "BIG5", SN_NOWARN)
set_name(0x80140B5C, "BIG8", SN_NOWARN)
set_name(0x80140B68, "BIG9", SN_NOWARN)
set_name(0x80140B74, "BIG10", SN_NOWARN)
set_name(0x80140B80, "PANCREAS1", SN_NOWARN)
set_name(0x80140BA0, "PANCREAS2", SN_NOWARN)
set_name(0x80140BC0, "CTRDOOR1", SN_NOWARN)
set_name(0x80140BD4, "CTRDOOR2", SN_NOWARN)
set_name(0x80140BE8, "CTRDOOR3", SN_NOWARN)
set_name(0x80140BFC, "CTRDOOR4", SN_NOWARN)
set_name(0x80140C10, "CTRDOOR5", SN_NOWARN)
set_name(0x80140C24, "CTRDOOR6", SN_NOWARN)
set_name(0x80140C38, "CTRDOOR7", SN_NOWARN)
set_name(0x80140C4C, "CTRDOOR8", SN_NOWARN)
set_name(0x80140C60, "Patterns", SN_NOWARN)
set_name(0x80147CC8, "lockout", SN_NOWARN)
set_name(0x80147A28, "L3ConvTbl", SN_NOWARN)
set_name(0x80147A38, "L3UP", SN_NOWARN)
set_name(0x80147A4C, "L3DOWN", SN_NOWARN)
set_name(0x80147A60, "L3HOLDWARP", SN_NOWARN)
set_name(0x80147A74, "L3TITE1", SN_NOWARN)
set_name(0x80147A98, "L3TITE2", SN_NOWARN)
set_name(0x80147ABC, "L3TITE3", SN_NOWARN)
set_name(0x80147AE0, "L3TITE6", SN_NOWARN)
set_name(0x80147B0C, "L3TITE7", SN_NOWARN)
set_name(0x80147B38, "L3TITE8", SN_NOWARN)
set_name(0x80147B4C, "L3TITE9", SN_NOWARN)
set_name(0x80147B60, "L3TITE10", SN_NOWARN)
set_name(0x80147B74, "L3TITE11", SN_NOWARN)
set_name(0x80147B88, "L3ISLE1", SN_NOWARN)
set_name(0x80147B98, "L3ISLE2", SN_NOWARN)
set_name(0x80147BA8, "L3ISLE3", SN_NOWARN)
set_name(0x80147BB8, "L3ISLE4", SN_NOWARN)
set_name(0x80147BC8, "L3ISLE5", SN_NOWARN)
set_name(0x80147BD4, "L3ANVIL", SN_NOWARN)
set_name(0x8014CAE4, "dung", SN_NOWARN)
set_name(0x8014CC74, "hallok", SN_NOWARN)
set_name(0x8014CC88, "L4dungeon", SN_NOWARN)
set_name(0x8014E588, "L4ConvTbl", SN_NOWARN)
set_name(0x8014E598, "L4USTAIRS", SN_NOWARN)
set_name(0x8014E5C4, "L4TWARP", SN_NOWARN)
set_name(0x8014E5F0, "L4DSTAIRS", SN_NOWARN)
set_name(0x8014E624, "L4PENTA", SN_NOWARN)
set_name(0x8014E658, "L4PENTA2", SN_NOWARN)
set_name(0x8014E68C, "L4BTYPES", SN_NOWARN)
|
#!/usr/bin/env python3
#############################################################################
# #
# Program purpose: Test whether a number is within 100 of 1000 or #
# 2000. #
# Program Author : Happi Yvan <[email protected]> #
# Creation Date : July 14, 2019 #
# #
#############################################################################
# URL: https://www.w3resource.com/python-exercises/python-basic-exercises.phps
def check_num(some_num):
return (abs(1000 - some_num) <= 100) or (abs(2000 - some_num) <= 100)
if __name__ == "__main__":
user_int = int(input("Enter a number near a {}: ".format(1000)))
if check_num(user_int):
print("TRUE")
else:
print("False")
|
STATS = [
{
"num_node_expansions": 5758,
"plan_cost": 130,
"plan_length": 130,
"search_time": 10.8434,
"total_time": 11.515
},
{
"num_node_expansions": 9619,
"plan_cost": 127,
"plan_length": 127,
"search_time": 21.8034,
"total_time": 22.4716
},
{
"num_node_expansions": 5995,
"plan_cost": 107,
"plan_length": 107,
"search_time": 15.4883,
"total_time": 16.7822
},
{
"num_node_expansions": 4250,
"plan_cost": 138,
"plan_length": 138,
"search_time": 9.91472,
"total_time": 11.0187
},
{
"num_node_expansions": 7025,
"plan_cost": 154,
"plan_length": 154,
"search_time": 14.2754,
"total_time": 15.2304
},
{
"num_node_expansions": 9499,
"plan_cost": 136,
"plan_length": 136,
"search_time": 5.40852,
"total_time": 5.66166
},
{
"num_node_expansions": 4413,
"plan_cost": 124,
"plan_length": 124,
"search_time": 2.6829,
"total_time": 2.93994
},
{
"num_node_expansions": 7223,
"plan_cost": 104,
"plan_length": 104,
"search_time": 6.34531,
"total_time": 6.75622
},
{
"num_node_expansions": 5351,
"plan_cost": 119,
"plan_length": 119,
"search_time": 5.21776,
"total_time": 5.6221
},
{
"num_node_expansions": 5783,
"plan_cost": 139,
"plan_length": 139,
"search_time": 10.8373,
"total_time": 11.5253
},
{
"num_node_expansions": 6921,
"plan_cost": 134,
"plan_length": 134,
"search_time": 12.6077,
"total_time": 13.2465
},
{
"num_node_expansions": 1124,
"plan_cost": 103,
"plan_length": 103,
"search_time": 1.4895,
"total_time": 1.91364
},
{
"num_node_expansions": 5336,
"plan_cost": 105,
"plan_length": 105,
"search_time": 5.9019,
"total_time": 6.30916
},
{
"num_node_expansions": 6466,
"plan_cost": 123,
"plan_length": 123,
"search_time": 18.8333,
"total_time": 20.0491
},
{
"num_node_expansions": 5308,
"plan_cost": 131,
"plan_length": 131,
"search_time": 12.4524,
"total_time": 13.7597
},
{
"num_node_expansions": 5772,
"plan_cost": 128,
"plan_length": 128,
"search_time": 5.61291,
"total_time": 5.99336
},
{
"num_node_expansions": 2658,
"plan_cost": 119,
"plan_length": 119,
"search_time": 2.69796,
"total_time": 3.051
},
{
"num_node_expansions": 7691,
"plan_cost": 143,
"plan_length": 143,
"search_time": 16.4768,
"total_time": 17.5258
},
{
"num_node_expansions": 5450,
"plan_cost": 139,
"plan_length": 139,
"search_time": 13.5545,
"total_time": 14.607
},
{
"num_node_expansions": 3208,
"plan_cost": 117,
"plan_length": 117,
"search_time": 5.16281,
"total_time": 5.69218
},
{
"num_node_expansions": 6628,
"plan_cost": 118,
"plan_length": 118,
"search_time": 9.69561,
"total_time": 10.2467
},
{
"num_node_expansions": 3506,
"plan_cost": 121,
"plan_length": 121,
"search_time": 16.0794,
"total_time": 17.9941
},
{
"num_node_expansions": 4849,
"plan_cost": 115,
"plan_length": 115,
"search_time": 13.5551,
"total_time": 14.6982
},
{
"num_node_expansions": 8918,
"plan_cost": 142,
"plan_length": 142,
"search_time": 17.9301,
"total_time": 18.3847
},
{
"num_node_expansions": 5427,
"plan_cost": 115,
"plan_length": 115,
"search_time": 21.4625,
"total_time": 23.484
},
{
"num_node_expansions": 5029,
"plan_cost": 165,
"plan_length": 165,
"search_time": 22.8943,
"total_time": 24.3382
},
{
"num_node_expansions": 7674,
"plan_cost": 121,
"plan_length": 121,
"search_time": 17.326,
"total_time": 18.5734
},
{
"num_node_expansions": 5814,
"plan_cost": 133,
"plan_length": 133,
"search_time": 15.0541,
"total_time": 16.3254
},
{
"num_node_expansions": 9359,
"plan_cost": 103,
"plan_length": 103,
"search_time": 14.0409,
"total_time": 14.8021
},
{
"num_node_expansions": 11400,
"plan_cost": 119,
"plan_length": 119,
"search_time": 18.3298,
"total_time": 19.153
}
]
num_timeouts = 142
num_timeouts = 0
num_problems = 172
|
'''
This program will do the following:
1. Ask for input of the amount of organisms
2. Ask for input of the daily population increase in percent
3. Ask for input of the maximum days the organism multiplies
4. Calculate the total population per day
5. Print the results for each day
'''
# ===Begin Loop
while True:
ORGANISMS = int(input("How many organisms do you want to start with?: "))
if ORGANISMS == 0:
print("You must have atleast 1 organism")
quit()
else:
# ===Input
INCREASE = float(input("At what percent (10% = 0.10) should they increase at?: "))
DAYS = int(input("How many days should the be left to multiply?: "))
population = ORGANISMS
print()
print('Days\tPopulation')
print('------------------')
break
# ===Process
for currentDay in range(1, DAYS + 1):
print(currentDay, "\t", format(population, ',.3f'))
population = population + (INCREASE * population)
|
def bool_strings():
bools = []
for b in ['T', 'true', 'True', 'TRUE', 'F', 'false', 'False', 'FALSE']:
bools.append((b.lower().startswith('t'), b))
return bools
def test_bool_scalars(tmp_path, helpers):
helpers.do_test_scalar(tmp_path, bool_strings())
def test_bool_one_d_arrays(tmp_path, helpers):
helpers.do_test_one_d_array(tmp_path, bool_strings())
def test_bool_two_d_arrays(tmp_path, helpers):
helpers.do_test_two_d_array(tmp_path, bool_strings(), use_fortran=False)
|
class Pessoa:
nome = 'Nome Padrão'
p1 = Pessoa()
p2 = Pessoa()
p1.nome = 'Valdir'
print(p1.nome) # Valdir
print(p2.nome) # Nome Padrão
print(Pessoa.nome) # Nome Padrão
print('\n===============\n')
Pessoa.nome = 'SEM NOME'
print(p1.nome) # Valdir (inseri na própria instância, logo, só muda quando eu mudar nela)
print(p2.nome) # SEM NOME
print(Pessoa.nome) # SEM NOME
|
# Modifique a classe Televisão de forma que, se pedirmos para mudar o canal para baixo, além do mínimo, ela vá para o canal máximo
# Se mudarmos para cima, além do canal máximo, que volte ao canal mínimo
# Exemplo:
# >>> tv = Televisão(2, 10)
# >>> tv.muda_canal_para_baixo()
# >>> tv.canal
# 10
# >>> tv.muda_canal_para_cima()
# >>> tv.canal
# 2
class Television:
def __init__(self, min, max):
self.switched_on = False
self.channel = min
self.cmin = min
self.cmax = max
def decrease_channel(self):
if self.channel - 1 >= self.cmin:
self.channel -= 1
else:
self.channel = self.cmax
def increase_channel(self):
if self.channel + 1 <= self.cmax:
self.channel += 1
else:
self.channel = self.cmin
tv = Television(5, 12)
tv.decrease_channel()
print(tv.channel)
tv.increase_channel()
print(tv.channel)
|
"""Additional Commandline option for pytest."""
MPI_SESSION_ARGUMENT = "--in_mpi_session"
"""
Argument added to the command line arguments useable with pytest.
/cf :any:`pytest_addoption`
"""
_IN_MPI_SESSION = False
"""Indicates whether the current test is run with the mpi session argument"""
def in_mpi_session():
"""
Return if the current test is run with the mpi session argument.
Returns
-------
bool
True if current test is run with the mpi session argument,
False otherwise.
"""
return _IN_MPI_SESSION
def pytest_addoption(parser):
"""
Add option `--in_mpi_session` to commandline options of pytest.
The default value is set to `False` so that it is
not activated by accident.
Arguments
---------
parser : ArgumentParser
The parser to which to add the option `in_mpi_session`
"""
parser.addoption(
MPI_SESSION_ARGUMENT,
action="store_true",
help="variable used by mpitest, to indicate that the current test is "
"run via mpirun etc. Should not be called directly.",
)
def pytest_configure(config):
"""
Set `IN_MPI_SESSION` module variable based on command line options.
Arguments
---------
config : Config fixture
The configuration from which to read the command line argument
"""
global _IN_MPI_SESSION
_IN_MPI_SESSION = config.getoption(MPI_SESSION_ARGUMENT)
|
def trapping_rain(buildings):
rain_block = 0
for i in range(1, len(buildings) - 1):
max_left = max(buildings[:i])
max_right = max(buildings[i + 1:])
height = max_right
if max_left < max_right:
height = max_left
if height <= buildings[i]:
continue
rain_block += height - buildings[i]
return rain_block
# 테스트
print(trapping_rain([3, 0, 0, 2, 0, 4]))
print(trapping_rain([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]))
|
class Solution:
def containsCycle(self, grid: List[List[str]]) -> bool:
rows, cols, visited, directions = len(grid), len(grid[0]), set(), [(0, 1), (1, 0), (0, -1), (-1, 0)]
def dfs(row, col, parentX, parentY, length):
visited.add((row, col))
for dirX, dirY in directions:
newRow, newCol = row + dirX, col + dirY
if newRow < 0 or newCol < 0 or newRow >= rows or newCol >= cols or (parentX == newRow and parentY == newCol):
continue
if (newRow, newCol) in visited and length >= 4 and grid[row][col] == grid[newRow][newCol]:
return True
elif grid[row][col] == grid[newRow][newCol]:
if dfs(newRow, newCol, row, col, length + 1):
return True
return False
for row in range(rows):
for col in range(cols):
if (row, col) in visited:
continue
if dfs(row, col, None, None, 1):
return True
return False |
#
# @lc app=leetcode.cn id=678 lang=python3
#
# [678] 有效的括号字符串
#
# https://leetcode-cn.com/problems/valid-parenthesis-string/description/
#
# algorithms
# Medium (35.18%)
# Total Accepted: 34.3K
# Total Submissions: 91.8K
# Testcase Example: '"()"'
#
# 给定一个只包含三种字符的字符串:( ,) 和 *,写一个函数来检验这个字符串是否为有效字符串。有效字符串具有如下规则:
#
#
# 任何左括号 ( 必须有相应的右括号 )。
# 任何右括号 ) 必须有相应的左括号 ( 。
# 左括号 ( 必须在对应的右括号之前 )。
# * 可以被视为单个右括号 ) ,或单个左括号 ( ,或一个空字符串。
# 一个空字符串也被视为有效字符串。
#
#
# 示例 1:
#
#
# 输入: "()"
# 输出: True
#
#
# 示例 2:
#
#
# 输入: "(*)"
# 输出: True
#
#
# 示例 3:
#
#
# 输入: "(*))"
# 输出: True
#
#
# 注意:
#
#
# 字符串大小将在 [1,100] 范围内。
class Solution:
def checkValidString(self, s: str) -> bool:
sx = [] # * 位置
sc = [] # ( 位置
for i, c in enumerate(s):
if c == "(":
sc.append(i)
elif c == "*":
sx.append(i)
else:
if sc:
sc.pop()
elif sx:
sx.pop()
else:
return False
while sc and sx:
if sc.pop() > sx.pop():
return False
if sc and not sx:
return False
return True
|
print(
min(
filter(
lambda x: x % 2 != 0,
map(
int,
input().split()
)
)
)
)
|
X = 1
def nester():
X = 2
print(X)
class C:
X = 3
print(X)
def method1(self):
print(X)
print(self.X)
def method2(self):
X = 4
print(X)
self.X = 5
print(self.X)
I = C()
I.method1()
I.method2()
print(X)
nester()
print('-'*40)
|
animals = { 'a': ['aardvark'], 'b': ['baboon'], 'c': ['coati']}
animals['d'] = ['donkey']
animals['d'].append('dog')
animals['d'].append('dingo')
"""
def howMany(aDict):
i = 0
result = []
values = aDict.values()
print (values)
for w in values:
result.append(w)
for word in result:
i += len(word)
return i
print (howMany (animals))
"""
def largest(aDict):
larg_item = ['',0]
if len(aDict) ==0:
return None
for (k,v) in aDict.items():
if len(v)>larg_item[1]:
larg_item[0]=k
larg_item[1]=len(v)
return larg_item[0]
print (largest(animals)) |
#from django import http
# adapted from http://djangosnippets.org/snippets/2472/
class CloudMiddleware(object):
def process_request(self, request):
if 'HTTP_X_FORWARDED_PROTO' in request.META:
if request.META['HTTP_X_FORWARDED_PROTO'] == 'https':
request.is_secure = lambda: True
return None
|
tot = tot1000 = menor = cont = 0
barato = ' '
while True:
produto = str(input('Nome do produto: '))
preco = float(input('Preço: R$ '))
cont += 1
tot += preco
if preco > 1000:
tot1000 += 1
if cont == 1 or preco < menor:
menor = preco
barato = produto
op = ' '
while op not in 'SN':
op = str(input('Quer continuar? [S/N] ')).strip().upper()[0]
if op == 'N':
break
print(f'O total da compra foi: {tot}.')
print(f'Total de produtos custando mais de R$1000 reais: {tot1000}.')
print(f'O produto mais barato foi o {barato} que custa R${menor}.') |
'''
A simple script for printing numbers
'''
def func1():
'''
func1 is simple methdo which shows the number which are entered inside.
'''
first_num = 1
second_num = 2
print(first_num)
print(second_num)
func1()
# When we run this program using pylint then we can get our code evaluted.
# It will be used when we'll be working with big projects to generate reports
# For execution: pylint filename.py
|
class Solution:
def dfs(self, image: List[List[int]], sr: int, sc: int, newColor: int, DIR: List[List[int]], startColor: int) -> List[List[int]]:
image[sr][sc] = newColor
visited = set()
visited.add((sr,sc))
for direction in DIR:
newRow, newCol = sr + direction[0], sc + direction[1]
if not self.checkSize(newRow, newCol, len(image), len(image[0])) or (newRow, newCol) in visited or image[newRow][newCol] != startColor:
continue
self.dfs(image, newRow, newCol, newColor, DIR, startColor)
return image
def checkSize(self, row: int, col: int, rowSize: int, colSize: int) -> bool:
return True if 0 <= row < rowSize and 0 <= col < colSize else False
def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]:
if image[sr][sc] == newColor:
return image
startColor = image[sr][sc]
image[sr][sc] = newColor
DIR = [[0,1], [1,0], [0,-1], [-1,0]]
image = self.dfs(image, sr, sc, newColor, DIR, startColor)
return image
|
"""
Construya un programa en Python que, dados como datos la categoría y el sueldo bruto
del trabajador, calcule el aumento correspondiente teniendo en cuenta la siguiente tabla:
Como salida, mostrar la categoría del trabajador y su nuevo sueldo bruto.
"""
SueldoBruto=int(input("Ingrese Sueldo Bruto: "))
if(SueldoBruto<=900000 ):
NuevoSueldo= (SueldoBruto*0.6)+SueldoBruto
print("Su Nuevo Sueldo es: $ {:.0f}".format(NuevoSueldo))
print("Su Categoria es la 5")
elif(SueldoBruto>900000 and SueldoBruto<=2000000):
NuevoSueldo= (SueldoBruto*0.4)+SueldoBruto
print("Su Nuevo Sueldo es: $ {:.0f}".format(NuevoSueldo))
print("Su Categoria es la 4")
elif(SueldoBruto>2000000 and SueldoBruto<=3600000):
NuevoSueldo= (SueldoBruto*0.2)+SueldoBruto
print("Su Nuevo Sueldo es: $ {:.0f}".format(NuevoSueldo))
print("Su Categoria es la 3")
elif(SueldoBruto>3600000 and SueldoBruto<=4300000):
NuevoSueldo= (SueldoBruto*0.15)+SueldoBruto
print("Su Nuevo Sueldo es: $ {:.0f}".format(NuevoSueldo))
print("Su Categoria es la 2")
elif(SueldoBruto>4300000 and SueldoBruto<=5000000):
NuevoSueldo= (SueldoBruto*0.10)+SueldoBruto
print("Su Nuevo Sueldo es: $ {:.0f}".format(NuevoSueldo))
print("Su Categoria es la 1")
else:
print("No se puede calcular")
|
# Author : Babu Baskaran
# Date : 05/04/2019 Time : 17:00 pm
# Solution for problem number 1
# taking user input
user1=int (input("Please Enter a Positive Integer : "))
# assigning user input into a variable
start = user1
# set i start value into 1
i = 1
# set value of variable ans to zero
ans = 0
# check the i value is equal or less than variable start
while i<= start:
# increase the value of variable ans by 1
ans = ans+i
# increase the value of i by 1
i = i + 1
# print the output sum of integer to the user
print(ans) |
"""
https://leetcode.com/problems/implement-strstr/
Return the first occurence of needle in haystack, or -1 if not found. Return 0 when needle is an empty string.
haystack and needle are both strings
"""
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
if len(needle) == 0:
return 0
else:
return haystack.find(needle)
# Another way, if using .find() was not allowed:
def strStr2(self, haystack, needle):
if len(needle) == 0:
return 0
substring_length = len(needle)
for i in range(len(haystack) - substring_length):
print(haystack[i:i+substring_length])
if haystack[i:i+substring_length] == needle:
return i
return -1
s = Solution()
print(s.strStr2('hello', 'll'))
|
units = {
"DecimalDegrees": "degrees",
"WGS_1984": "WGS84",
"Meters": "meters",
"": "",
"Unknown": "Unknown",
}
|
class CommandResponse(object):
def __init__(self):
self.messages = []
self.named = {}
self.errors = []
def __getitem__(self, name):
return self.get_named_data(name)
@property
def active_user(self):
return self.get_named_data('active_user')
@property
def log_key(self):
return self.get_named_data('log_key')
def add(self, messages):
if not isinstance(messages, (list, tuple)):
messages = [messages]
for message in messages:
self.messages.append(message)
if message.name:
self.named[message.name] = message
if message.is_error():
self.errors.append(message)
@property
def aborted(self):
return len(self.errors) > 0
@property
def error(self):
return self.aborted
def error_message(self):
messages = []
for message in self.errors:
messages.append(message.format())
return "\n\n".join(messages)
def get_named_data(self, name):
message = self.named.get(name, None)
if message:
try:
return message.data
except AttributeError:
return message.message
return None
|
print('-=-' * 9)
print(' \033[35m--- BANCO GUANABARA ---\033[m ')
print('-=-' * 9)
valor = int(input('Qual valor você quer sacar? (Cédulas disponíveis: 100, 50, 20 e 10): '))
for nota in [100, 50, 20, 10]:
qtde = valor // nota
valor = valor % nota
if qtde > 0:
print('Cédulas de R$ {},00: \033[33m{}\033[m'.format(nota, qtde))
'''qtde100 = qtde50 = qtde20 = qtde10 = 0
valor = 1
print('-=-' * 9)
print(' \033[35m--- BANCO GUANABARA ---\033[m ')
print('-=-' * 9)
while valor % 10 != 0:
valor = int(input('Qual valor você quer sacar? (Cédulas disponíveis: 100, 50, 20 e 10): '))
while valor >= 100:
qtde100 += 1
valor -= 100
while valor >= 50:
qtde50 += 1
valor -= 50
while valor >= 20:
qtde20 += 1
valor -= 20
while valor >= 10:
qtde10 += 1
valor -= 10
if qtde100 > 0:
print('Cédulas de R$100,00: \033[31m{}\033[m'.format(int(qtde100)))
if qtde50 > 0:
print('Cédulas de R$50,00: \033[32m{}\033[m'.format(int(qtde50)))
if qtde20 > 0:
print('Cédulas de R$20,00: \033[33m{}\033[m'.format(int(qtde20)))
if qtde10 > 0:
print('Cédulas de R$10,00: \033[34m{}\033[m'.format(int(qtde10)))
print('\033[35mVolte sempre ao Banco Guanabara! Tenha um bom dia!')'''
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def findTilt(self, root: TreeNode) -> int:
sum_tree, tilt_tree = self.sum_and_tilt(root)
return tilt_tree
def sum_and_tilt(self, root):
if not root:
return 0, 0
sum_left, tilt_left = self.sum_and_tilt(root.left)
sum_right, tilt_right = self.sum_and_tilt(root.right)
return sum_left + sum_right + root.val, abs(sum_left - sum_right) + tilt_left + tilt_right |
'''
Comparison data as seen here,
http://www.nand2tetris.org/
'''
'''------------------------- Arithmetic gates -------------------------'''
k_halfAdder = [
# [ a, b, ( sum, carry ) ]
[ 0, 0, ( 0, 0 ) ],
[ 0, 1, ( 1, 0 ) ],
[ 1, 0, ( 1, 0 ) ],
[ 1, 1, ( 0, 1 ) ],
]
k_fullAdder = [
# [ a, b, c, ( sum, carry ) ]
[ 0, 0, 0, ( 0, 0 ) ],
[ 0, 0, 1, ( 1, 0 ) ],
[ 0, 1, 0, ( 1, 0 ) ],
[ 0, 1, 1, ( 0, 1 ) ],
[ 1, 0, 0, ( 1, 0 ) ],
[ 1, 0, 1, ( 0, 1 ) ],
[ 1, 1, 0, ( 0, 1 ) ],
[ 1, 1, 1, ( 1, 1 ) ],
]
k_add16 = [
# [ a, b, out ]
[ '0000000000000000', '0000000000000000', '0000000000000000' ],
[ '0000000000000000', '1111111111111111', '1111111111111111' ],
[ '1111111111111111', '1111111111111111', '1111111111111110' ],
[ '1010101010101010', '0101010101010101', '1111111111111111' ],
[ '0011110011000011', '0000111111110000', '0100110010110011' ],
[ '0001001000110100', '1001100001110110', '1010101010101010' ],
]
k_subtract16 = [
# [ a, b, out ]
[ '0000000000000111', '0000000000001001', '1111111111111110' ],
[ '0000000000011000', '0000000000110111', '1111111111100001' ],
[ '0000000000001111', '0000000000000111', '0000000000001000' ],
[ '0000000000111000', '0000000000000001', '0000000000110111' ],
[ '1000000000000000', '0000000000000010', '0111111111111110' ],
]
k_increment16 = [
# [ in, out ]
[ '0000000000000000', '0000000000000001' ],
[ '1111111111111111', '0000000000000000' ],
[ '0000000000000101', '0000000000000110' ],
[ '1111111111111011', '1111111111111100' ],
]
k_shiftLeft16 = [
[ '0110011111001010', '0000000000001010', '0010100000000000' ],
[ '0001010000101011', '0000000000000011', '1010000101011000' ],
[ '0011010100011101', '0000000000000100', '0101000111010000' ],
[ '1100111001000011', '0000000000000001', '1001110010000110' ],
[ '1111101111111000', '0000000000000110', '1111111000000000' ],
]
k_shiftRight16 = [
[ '0011100000111110', '0000000000000100', '0000001110000011' ],
[ '0011010001101111', '0000000000000011', '0000011010001101' ],
[ '1000010011010110', '0000000000001100', '0000000000001000' ],
[ '1110100101100001', '0000000000001000', '0000000011101001' ],
[ '0010101000011110', '0000000000000001', '0001010100001111' ],
]
k_ALU16 = [
# [ x, y, fsel, zx|nx|zy|ny|no, out, zr, ng ]
[ '0000000000000000', '1111111111111111', '0000', '10100', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '11111', '0000000000000001', 0, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '11100', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0001', '00110', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0001', '11000', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0001', '00111', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0001', '11001', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '00111', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '11001', '0000000000000001', 0, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '01111', '0000000000000001', 0, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '11011', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '00110', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0000', '11000', '1111111111111110', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0000', '00000', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0000', '01001', '0000000000000001', 0, 0 ],
[ '0000000000000000', '1111111111111111', '0000', '00011', '1111111111111111', 0, 1 ],
[ '0000000000000000', '1111111111111111', '0001', '00000', '0000000000000000', 1, 0 ],
[ '0000000000000000', '1111111111111111', '0001', '01011', '1111111111111111', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0000', '10100', '0000000000000000', 1, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '11111', '0000000000000001', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '11100', '1111111111111111', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0001', '00110', '0000000000010001', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0001', '11000', '0000000000000011', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0001', '00111', '1111111111101110', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0001', '11001', '1111111111111100', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0000', '00111', '1111111111101111', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0000', '11001', '1111111111111101', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0000', '01111', '0000000000010010', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '11011', '0000000000000100', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '00110', '0000000000010000', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '11000', '0000000000000010', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '00000', '0000000000010100', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '01001', '0000000000001110', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0000', '00011', '1111111111110010', 0, 1 ],
[ '0000000000010001', '0000000000000011', '0001', '00000', '0000000000000001', 0, 0 ],
[ '0000000000010001', '0000000000000011', '0001', '01011', '0000000000010011', 0, 0 ],
[ '0001000010100010', '1110110111010001', '0010', '00000', '1111110101110011', 0, 1 ],
[ '0000001001110011', '0000001010010101', '0010', '00000', '0000000011100110', 0, 0 ],
[ '1001001101110110', '0110100010001100', '0010', '00000', '1111101111111010', 0, 1 ],
[ '1111100011101101', '0000001010111011', '0010', '00000', '1111101001010110', 0, 1 ],
[ '0010111100101110', '1010111011111101', '0010', '00000', '1000000111010011', 0, 1 ],
[ '0011100000111110', '0000000000000100', '0011', '00000', '0000001110000011', 0, 0 ],
[ '0011010001101111', '0000000000000011', '0011', '00000', '0000011010001101', 0, 0 ],
[ '1000010011010110', '0000000000001100', '0011', '00000', '0000000000001000', 0, 0 ],
[ '1110100101100001', '0000000000001000', '0011', '00000', '0000000011101001', 0, 0 ],
[ '0010101000011110', '0000000000000001', '0011', '00000', '0001010100001111', 0, 0 ],
[ '0110011111001010', '0000000000001010', '0100', '00000', '0010100000000000', 0, 0 ],
[ '0001010000101011', '0000000000000011', '0100', '00000', '1010000101011000', 0, 1 ],
[ '0011010100011101', '0000000000000100', '0100', '00000', '0101000111010000', 0, 0 ],
[ '1100111001000011', '0000000000000001', '0100', '00000', '1001110010000110', 0, 1 ],
[ '1111101111111000', '0000000000000110', '0100', '00000', '1111111000000000', 0, 1 ],
]
|
class QuizBrain:
def __init__(self,question_list):
self.question_number = 0
self.score = 0
self.question_list = question_list
def next_question(self):
self.guess = input(f"Q{self.question_number + 1}: {self.question_list[self.question_number].question} True or False: ")
self.check_answer(self.guess, self.question_list[self.question_number].answer)
self.question_number += 1
def still_has_questions(self):
return self.question_number < len(self.question_list)
def check_answer(self, guess, answer):
if guess.lower() == answer.lower():
self.score += 1
print(f"Your score is {self.score}/{self.question_number+1}")
print("\n")
# def play_game():
# print("Let's play the game!")
# correct = 0
# for i in range(len(Self.question_list)):
# guess = input(f"{self.question_list[i].question} True or False: ")
# if guess == question_bank[i].answer:
# correct += 1
# print(f"You have guessed {correct} correct out of {i+1} questions. {100*correct/(i+1)}%\n") |
mooniswap_abi = [
{
"inputs": [
{"internalType": "contract IERC20", "name": "_token0", "type": "address"},
{"internalType": "contract IERC20", "name": "_token1", "type": "address"},
{"internalType": "string", "name": "name", "type": "string"},
{"internalType": "string", "name": "symbol", "type": "string"},
{
"internalType": "contract IMooniswapFactoryGovernance",
"name": "_mooniswapFactoryGovernance",
"type": "address",
},
],
"stateMutability": "nonpayable",
"type": "constructor",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "owner",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "spender",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "value",
"type": "uint256",
},
],
"name": "Approval",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "user",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "decayPeriod",
"type": "uint256",
},
{
"indexed": False,
"internalType": "bool",
"name": "isDefault",
"type": "bool",
},
{
"indexed": False,
"internalType": "uint256",
"name": "amount",
"type": "uint256",
},
],
"name": "DecayPeriodVoteUpdate",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "sender",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "receiver",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "share",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "token0Amount",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "token1Amount",
"type": "uint256",
},
],
"name": "Deposited",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": False,
"internalType": "string",
"name": "reason",
"type": "string",
}
],
"name": "Error",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "user",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "fee",
"type": "uint256",
},
{
"indexed": False,
"internalType": "bool",
"name": "isDefault",
"type": "bool",
},
{
"indexed": False,
"internalType": "uint256",
"name": "amount",
"type": "uint256",
},
],
"name": "FeeVoteUpdate",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "previousOwner",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "newOwner",
"type": "address",
},
],
"name": "OwnershipTransferred",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "user",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "slippageFee",
"type": "uint256",
},
{
"indexed": False,
"internalType": "bool",
"name": "isDefault",
"type": "bool",
},
{
"indexed": False,
"internalType": "uint256",
"name": "amount",
"type": "uint256",
},
],
"name": "SlippageFeeVoteUpdate",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "sender",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "receiver",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "srcToken",
"type": "address",
},
{
"indexed": False,
"internalType": "address",
"name": "dstToken",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "amount",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "result",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "srcAdditionBalance",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "dstRemovalBalance",
"type": "uint256",
},
{
"indexed": False,
"internalType": "address",
"name": "referral",
"type": "address",
},
],
"name": "Swapped",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": False,
"internalType": "uint256",
"name": "srcBalance",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "dstBalance",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "fee",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "slippageFee",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "referralShare",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "governanceShare",
"type": "uint256",
},
],
"name": "Sync",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "from",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "to",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "value",
"type": "uint256",
},
],
"name": "Transfer",
"type": "event",
},
{
"anonymous": False,
"inputs": [
{
"indexed": True,
"internalType": "address",
"name": "sender",
"type": "address",
},
{
"indexed": True,
"internalType": "address",
"name": "receiver",
"type": "address",
},
{
"indexed": False,
"internalType": "uint256",
"name": "share",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "token0Amount",
"type": "uint256",
},
{
"indexed": False,
"internalType": "uint256",
"name": "token1Amount",
"type": "uint256",
},
],
"name": "Withdrawn",
"type": "event",
},
{
"inputs": [
{"internalType": "address", "name": "owner", "type": "address"},
{"internalType": "address", "name": "spender", "type": "address"},
],
"name": "allowance",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "address", "name": "spender", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
],
"name": "approve",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "address", "name": "account", "type": "address"}],
"name": "balanceOf",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "decayPeriod",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "uint256", "name": "vote", "type": "uint256"}],
"name": "decayPeriodVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "address", "name": "user", "type": "address"}],
"name": "decayPeriodVotes",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "decimals",
"outputs": [{"internalType": "uint8", "name": "", "type": "uint8"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "address", "name": "spender", "type": "address"},
{"internalType": "uint256", "name": "subtractedValue", "type": "uint256"},
],
"name": "decreaseAllowance",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [
{"internalType": "uint256[2]", "name": "maxAmounts", "type": "uint256[2]"},
{"internalType": "uint256[2]", "name": "minAmounts", "type": "uint256[2]"},
],
"name": "deposit",
"outputs": [
{"internalType": "uint256", "name": "fairSupply", "type": "uint256"},
{
"internalType": "uint256[2]",
"name": "receivedAmounts",
"type": "uint256[2]",
},
],
"stateMutability": "payable",
"type": "function",
},
{
"inputs": [
{"internalType": "uint256[2]", "name": "maxAmounts", "type": "uint256[2]"},
{"internalType": "uint256[2]", "name": "minAmounts", "type": "uint256[2]"},
{"internalType": "address", "name": "target", "type": "address"},
],
"name": "depositFor",
"outputs": [
{"internalType": "uint256", "name": "fairSupply", "type": "uint256"},
{
"internalType": "uint256[2]",
"name": "receivedAmounts",
"type": "uint256[2]",
},
],
"stateMutability": "payable",
"type": "function",
},
{
"inputs": [],
"name": "discardDecayPeriodVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [],
"name": "discardFeeVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [],
"name": "discardSlippageFeeVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [],
"name": "fee",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "uint256", "name": "vote", "type": "uint256"}],
"name": "feeVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "address", "name": "user", "type": "address"}],
"name": "feeVotes",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "token", "type": "address"}
],
"name": "getBalanceForAddition",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "token", "type": "address"}
],
"name": "getBalanceForRemoval",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "src", "type": "address"},
{"internalType": "contract IERC20", "name": "dst", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
],
"name": "getReturn",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "getTokens",
"outputs": [
{"internalType": "contract IERC20[]", "name": "tokens", "type": "address[]"}
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "address", "name": "spender", "type": "address"},
{"internalType": "uint256", "name": "addedValue", "type": "uint256"},
],
"name": "increaseAllowance",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [],
"name": "mooniswapFactoryGovernance",
"outputs": [
{
"internalType": "contract IMooniswapFactoryGovernance",
"name": "",
"type": "address",
}
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "name",
"outputs": [{"internalType": "string", "name": "", "type": "string"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "owner",
"outputs": [{"internalType": "address", "name": "", "type": "address"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "token", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
],
"name": "rescueFunds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [
{
"internalType": "contract IMooniswapFactoryGovernance",
"name": "newMooniswapFactoryGovernance",
"type": "address",
}
],
"name": "setMooniswapFactoryGovernance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [],
"name": "slippageFee",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "uint256", "name": "vote", "type": "uint256"}],
"name": "slippageFeeVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "address", "name": "user", "type": "address"}],
"name": "slippageFeeVotes",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "src", "type": "address"},
{"internalType": "contract IERC20", "name": "dst", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
{"internalType": "uint256", "name": "minReturn", "type": "uint256"},
{"internalType": "address", "name": "referral", "type": "address"},
],
"name": "swap",
"outputs": [{"internalType": "uint256", "name": "result", "type": "uint256"}],
"stateMutability": "payable",
"type": "function",
},
{
"inputs": [
{"internalType": "contract IERC20", "name": "src", "type": "address"},
{"internalType": "contract IERC20", "name": "dst", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
{"internalType": "uint256", "name": "minReturn", "type": "uint256"},
{"internalType": "address", "name": "referral", "type": "address"},
{"internalType": "address payable", "name": "receiver", "type": "address"},
],
"name": "swapFor",
"outputs": [{"internalType": "uint256", "name": "result", "type": "uint256"}],
"stateMutability": "payable",
"type": "function",
},
{
"inputs": [],
"name": "symbol",
"outputs": [{"internalType": "string", "name": "", "type": "string"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "token0",
"outputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "token1",
"outputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "uint256", "name": "i", "type": "uint256"}],
"name": "tokens",
"outputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "address", "name": "recipient", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
],
"name": "transfer",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [
{"internalType": "address", "name": "sender", "type": "address"},
{"internalType": "address", "name": "recipient", "type": "address"},
{"internalType": "uint256", "name": "amount", "type": "uint256"},
],
"name": "transferFrom",
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "address", "name": "newOwner", "type": "address"}],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"name": "virtualBalancesForAddition",
"outputs": [
{"internalType": "uint216", "name": "balance", "type": "uint216"},
{"internalType": "uint40", "name": "time", "type": "uint40"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"name": "virtualBalancesForRemoval",
"outputs": [
{"internalType": "uint216", "name": "balance", "type": "uint216"},
{"internalType": "uint40", "name": "time", "type": "uint40"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "virtualDecayPeriod",
"outputs": [
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint48", "name": "", "type": "uint48"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "virtualFee",
"outputs": [
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint48", "name": "", "type": "uint48"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [],
"name": "virtualSlippageFee",
"outputs": [
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint104", "name": "", "type": "uint104"},
{"internalType": "uint48", "name": "", "type": "uint48"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}],
"name": "volumes",
"outputs": [
{"internalType": "uint128", "name": "confirmed", "type": "uint128"},
{"internalType": "uint128", "name": "result", "type": "uint128"},
],
"stateMutability": "view",
"type": "function",
},
{
"inputs": [
{"internalType": "uint256", "name": "amount", "type": "uint256"},
{"internalType": "uint256[]", "name": "minReturns", "type": "uint256[]"},
],
"name": "withdraw",
"outputs": [
{
"internalType": "uint256[2]",
"name": "withdrawnAmounts",
"type": "uint256[2]",
}
],
"stateMutability": "nonpayable",
"type": "function",
},
{
"inputs": [
{"internalType": "uint256", "name": "amount", "type": "uint256"},
{"internalType": "uint256[]", "name": "minReturns", "type": "uint256[]"},
{"internalType": "address payable", "name": "target", "type": "address"},
],
"name": "withdrawFor",
"outputs": [
{
"internalType": "uint256[2]",
"name": "withdrawnAmounts",
"type": "uint256[2]",
}
],
"stateMutability": "nonpayable",
"type": "function",
},
]
|
msg = None
if msg:
print(msg)
|
# Each time we introduce new functionality into the game, we’ll typically
# create some new settings as well. Instead of adding settings throughout
# the code, let’s write a module called settings that contains a class called
# Settings to store all these values in one place
class Settings:
def __init__(self):
self.screen_width = 1200
self.screen_height = 800
# Pygame creates a black screen by default, but that’s boring. Let’s set a different background color
# Colors in Pygame are specified as RGB colors: a mix of red, green, and blue
self.bg_color = (230, 230, 230)
self.ship_speed = 1.5
self.ship_limit = 3
# Bullet settings
self.bullet_speed = 5
self.bullet_width = 3
self.bullet_height = 15
self.bullet_color = (60, 60, 60)
self.bullets_allowed = 3
# Bullet Special settings
self.bullet_special_speed = 10
self.bullet_special_speed = 2
self.bullet_special_width = 6
self.bullet_special_height = 25
self.bullet_special_color = (255, 0, 0)
self.bullets_special_allowed = 1
# Alien settings
self.alien_speed = 1
self.fleet_drop_speed = 10
# 1 = right and -1 = left
self.fleet_direction = 1
self.speedup_scale = 1.1
self.initialize_dynamic_settings()
def initialize_dynamic_settings(self):
"""Initialize settings that change throughout the game."""
self.ship_speed = 1.5
self.bullet_speed = 5
self.alien_speed = 1.0
# fleet_direction of 1 represents right; -1 represents left.
self.fleet_direction = 1
self.alien_points = 50
def increase_speed(self):
"""Increase speed settings."""
self.ship_speed *= self.speedup_scale
self.bullet_speed *= self.speedup_scale
self.alien_speed *= self.speedup_scale
|
print("")
media = 0
m_menor = 0
h_maior = 0
for i in range(4):
print("------- {}ª Pessoa -------".format(i+1))
nome = input("Nome: ")
idade = int(input("Idade: "))
sexo = input("Sexo [M/F]: ")
media += idade
if (sexo == 'F' and idade < 20): m_menor += 1
if (sexo == 'M'):
if (i == 0):
h_maior = idade
elif (idade > h_maior):
h_maior = idade
h_nome = nome
media /= 4
print("\nA média de idade do grupo é de {} anos".format(media))
print("O homem mais velho tem {} anos e se chama {}".format(h_maior, h_nome))
print("Ao todo são {} mulheres com menos de 20 anos".format(m_menor), end='\n\n') |
class NoTasksError(Exception):
"""Exception raised when there are no tasks passed"""
pass
class TaskResultKeyAlreadyExists(Exception):
"""Exception raised when two tasks produce same key-ed result"""
pass
class TaskResultObjectMissing(Exception):
"""Exception raised when one or more expected input results could not be retrieved from predecessor tasks"""
pass
class TaskNameError(Exception):
"""Exception raised when an other object with the name of a task exists.
Task names have to be unique for pickling.
"""
pass
class GridSearchExpansionError(Exception):
"""Exception raised when Grid Search expansion fails."""
pass
class CyclicGraphError(Exception):
"""Exception raised when task spec graph contains circular dependencies."""
pass
|
def counter(c_var):
while True:
try:
c_var = c_var + 1
except KeyboardInterrupt:
print('Counter now at: ' + str(c_var))
def counter_p(c_var):
while True:
c_var = c_var + 1
print(c_var) |
# Type definiton for (type, data) tuples representing a value
# See http://androidxref.com/9.0.0_r3/xref/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h#262
# The 'data' is either 0 or 1, specifying this resource is either
# undefined or empty, respectively.
TYPE_NULL = 0x00
# The 'data' holds a ResTable_ref, a reference to another resource
# table entry.
TYPE_REFERENCE = 0x01
# The 'data' holds an attribute resource identifier.
TYPE_ATTRIBUTE = 0x02
# The 'data' holds an index into the containing resource table's
# global value string pool.
TYPE_STRING = 0x03
# The 'data' holds a single-precision floating point number.
TYPE_FLOAT = 0x04
# The 'data' holds a complex number encoding a dimension value
# such as "100in".
TYPE_DIMENSION = 0x05
# The 'data' holds a complex number encoding a fraction of a
# container.
TYPE_FRACTION = 0x06
# The 'data' holds a dynamic ResTable_ref, which needs to be
# resolved before it can be used like a TYPE_REFERENCE.
TYPE_DYNAMIC_REFERENCE = 0x07
# The 'data' holds an attribute resource identifier, which needs to be resolved
# before it can be used like a TYPE_ATTRIBUTE.
TYPE_DYNAMIC_ATTRIBUTE = 0x08
# Beginning of integer flavors...
TYPE_FIRST_INT = 0x10
# The 'data' is a raw integer value of the form n..n.
TYPE_INT_DEC = 0x10
# The 'data' is a raw integer value of the form 0xn..n.
TYPE_INT_HEX = 0x11
# The 'data' is either 0 or 1, for input "false" or "true" respectively.
TYPE_INT_BOOLEAN = 0x12
# Beginning of color integer flavors...
TYPE_FIRST_COLOR_INT = 0x1c
# The 'data' is a raw integer value of the form #aarrggbb.
TYPE_INT_COLOR_ARGB8 = 0x1c
# The 'data' is a raw integer value of the form #rrggbb.
TYPE_INT_COLOR_RGB8 = 0x1d
# The 'data' is a raw integer value of the form #argb.
TYPE_INT_COLOR_ARGB4 = 0x1e
# The 'data' is a raw integer value of the form #rgb.
TYPE_INT_COLOR_RGB4 = 0x1f
# ...end of integer flavors.
TYPE_LAST_COLOR_INT = 0x1f
# ...end of integer flavors.
TYPE_LAST_INT = 0x1f
|
#Requisitado: NOME e IDADE do homem mais velho, quantas mulheres como menos de 20 anos
media = 0
idadeH = 0
nomeH = ''
msub20 = 0
n = int(input('Quantas pessoas vc deseja analisar? '))
for c in range(1, n+1):
print(f'----- {c}ª pessoa -----')
nome = str(input('Nome: '))
idade = int(input('Idade: '))
media += idade
sexo = str(input('Sexo [H/M]: '))
if sexo in 'Hh':
if idade > idadeH:
nomeH = nome
idadeH = idade
if sexo in 'Mm' and idade < 20:
msub20 += 1
print(f'A media de idade do grupo foi de {media/n:2} anos')
print(f'O homem mais velho tem {idadeH} anos e se chama {nomeH}')
print(f'Ao todo sao {msub20} mulheres com menos de 20 anos') |
words=['Aaron',
'Ab',
'Abba',
'Abbe',
'Abbey',
'Abbie',
'Abbot',
'Abbott',
'Abby',
'Abdel',
'Abdul',
'Abe',
'Abel',
'Abelard',
'Abeu',
'Abey',
'Abie',
'Abner',
'Abraham',
'Abrahan',
'Abram',
'Abramo',
'Abran',
'Ad',
'Adair',
'Adam',
'Adamo',
'Adams',
'Adan',
'Addie',
'Addison',
'Addy',
'Ade',
'Adelbert',
'Adham',
'Adlai',
'Adler',
'Ado',
'Adolf',
'Adolph',
'Adolphe',
'Adolpho',
'Adolphus',
'Adrian',
'Adriano',
'Adrien',
'Agosto',
'Aguie',
'Aguistin',
'Aguste',
'Agustin',
'Aharon',
'Ahmad',
'Ahmed',
'Ailbert',
'Akim',
'Aksel',
'Al',
'Alain',
'Alair',
'Alan',
'Aland',
'Alano',
'Alanson',
'Alard',
'Alaric',
'Alasdair',
'Alastair',
'Alasteir',
'Alaster',
'Alberik',
'Albert',
'Alberto',
'Albie',
'Albrecht',
'Alden',
'Aldin',
'Aldis',
'Aldo',
'Aldon',
'Aldous',
'Aldric',
'Aldrich',
'Aldridge',
'Aldus',
'Aldwin',
'Alec',
'Alejandro',
'Alejoa',
'Aleksandr',
'Alessandro',
'Alex',
'Alexander',
'Alexandr',
'Alexandre',
'Alexandro',
'Alexandros',
'Alexei',
'Alexio',
'Alexis',
'Alf',
'Alfie',
'Alfons',
'Alfonse',
'Alfonso',
'Alford',
'Alfred',
'Alfredo',
'Alfy',
'Algernon',
'Ali',
'Alic',
'Alick',
'Alisander',
'Alistair',
'Alister',
'Alix',
'Allan',
'Allard',
'Allayne',
'Allen',
'Alley',
'Alleyn',
'Allie',
'Allin',
'Allister',
'Allistir',
'Allyn',
'Aloin',
'Alon',
'Alonso',
'Alonzo',
'Aloysius',
'Alphard',
'Alphonse',
'Alphonso',
'Alric',
'Aluin',
'Aluino',
'Alva',
'Alvan',
'Alvie',
'Alvin',
'Alvis',
'Alvy',
'Alwin',
'Alwyn',
'Alyosha',
'Amble',
'Ambros',
'Ambrose',
'Ambrosi',
'Ambrosio',
'Ambrosius',
'Amby',
'Amerigo',
'Amery',
'Amory',
'Amos',
'Anatol',
'Anatole',
'Anatollo',
'Ancell',
'Anders',
'Anderson',
'Andie',
'Andonis',
'Andras',
'Andre',
'Andrea',
'Andreas',
'Andrej',
'Andres',
'Andrew',
'Andrey',
'Andris',
'Andros',
'Andrus',
'Andy',
'Ange',
'Angel',
'Angeli',
'Angelico',
'Angelo',
'Angie',
'Angus',
'Ansel',
'Ansell',
'Anselm',
'Anson',
'Anthony',
'Antin',
'Antoine',
'Anton',
'Antone',
'Antoni',
'Antonin',
'Antonino',
'Antonio',
'Antonius',
'Antons',
'Antony',
'Any',
'Ara',
'Araldo',
'Arch',
'Archaimbaud',
'Archambault',
'Archer',
'Archibald',
'Archibaldo',
'Archibold',
'Archie',
'Archy',
'Arel',
'Ari',
'Arie',
'Ariel',
'Arin',
'Ario',
'Aristotle',
'Arlan',
'Arlen',
'Arley',
'Arlin',
'Arman',
'Armand',
'Armando',
'Armin',
'Armstrong',
'Arnaldo',
'Arne',
'Arney',
'Arni',
'Arnie',
'Arnold',
'Arnoldo',
'Arnuad',
'Arny',
'Aron',
'Arri',
'Arron',
'Art',
'Artair',
'Arte',
'Artemas',
'Artemis',
'Artemus',
'Arther',
'Arthur',
'Artie',
'Artur',
'Arturo',
'Artus',
'Arty',
'Arv',
'Arvie',
'Arvin',
'Arvy',
'Asa',
'Ase',
'Ash',
'Ashbey',
'Ashby',
'Asher',
'Ashley',
'Ashlin',
'Ashton',
'Aube',
'Auberon',
'Aubert',
'Aubrey',
'Augie',
'August',
'Augustin',
'Augustine',
'Augusto',
'Augustus',
'Augy',
'Aurthur',
'Austen',
'Austin',
'Ave',
'Averell',
'Averil',
'Averill',
'Avery',
'Avictor',
'Avigdor',
'Avram',
'Avrom',
'Ax',
'Axe',
'Axel',
'Aylmar',
'Aylmer',
'Aymer',
'Bail',
'Bailey',
'Bailie',
'Baillie',
'Baily',
'Baird',
'Bald',
'Balduin',
'Baldwin',
'Bale',
'Ban',
'Bancroft',
'Bank',
'Banky',
'Bar',
'Barbabas',
'Barclay',
'Bard',
'Barde',
'Barn',
'Barnabas',
'Barnabe',
'Barnaby',
'Barnard',
'Barnebas',
'Barnett',
'Barney',
'Barnie',
'Barny',
'Baron',
'Barr',
'Barret',
'Barrett',
'Barri',
'Barrie',
'Barris',
'Barron',
'Barry',
'Bart',
'Bartel',
'Barth',
'Barthel',
'Bartholemy',
'Bartholomeo',
'Bartholomeus',
'Bartholomew',
'Bartie',
'Bartlet',
'Bartlett',
'Bartolemo',
'Bartolomeo',
'Barton',
'Bartram',
'Barty',
'Bary',
'Baryram',
'Base',
'Basil',
'Basile',
'Basilio',
'Basilius',
'Bastian',
'Bastien',
'Bat',
'Batholomew',
'Baudoin',
'Bax',
'Baxie',
'Baxter',
'Baxy',
'Bay',
'Bayard',
'Beale',
'Bealle',
'Bear',
'Bearnard',
'Beau',
'Beaufort',
'Beauregard',
'Beck',
'Beltran',
'Ben',
'Bendick',
'Bendicty',
'Bendix',
'Benedetto',
'Benedick',
'Benedict',
'Benedicto',
'Benedikt',
'Bengt',
'Beniamino',
'Benito',
'Benjamen',
'Benjamin',
'Benji',
'Benjie',
'Benjy',
'Benn',
'Bennett',
'Bennie',
'Benny',
'Benoit',
'Benson',
'Bent',
'Bentlee',
'Bentley',
'Benton',
'Benyamin',
'Ber',
'Berk',
'Berke',
'Berkeley',
'Berkie',
'Berkley',
'Berkly',
'Berky',
'Bern',
'Bernard',
'Bernardo',
'Bernarr',
'Berne',
'Bernhard',
'Bernie',
'Berny',
'Bert',
'Berti',
'Bertie',
'Berton',
'Bertram',
'Bertrand',
'Bertrando',
'Berty',
'Bev',
'Bevan',
'Bevin',
'Bevon',
'Bil',
'Bill',
'Billie',
'Billy',
'Bing',
'Bink',
'Binky',
'Birch',
'Birk',
'Biron',
'Bjorn',
'Blaine',
'Blair',
'Blake',
'Blane',
'Blayne',
'Bo',
'Bob',
'Bobbie',
'Bobby',
'Bogart',
'Bogey',
'Boigie',
'Bond',
'Bondie',
'Bondon',
'Bondy',
'Bone',
'Boniface',
'Boone',
'Boonie',
'Boony',
'Boot',
'Boote',
'Booth',
'Boothe',
'Bord',
'Borden',
'Bordie',
'Bordy',
'Borg',
'Boris',
'Bourke',
'Bowie',
'Boy',
'Boyce',
'Boycey',
'Boycie',
'Boyd',
'Brad',
'Bradan',
'Brade',
'Braden',
'Bradford',
'Bradley',
'Bradly',
'Bradney',
'Brady',
'Bram',
'Bran',
'Brand',
'Branden',
'Brander',
'Brandon',
'Brandtr',
'Brandy',
'Brandyn',
'Brannon',
'Brant',
'Brantley',
'Bren',
'Brendan',
'Brenden',
'Brendin',
'Brendis',
'Brendon',
'Brennan',
'Brennen',
'Brent',
'Bret',
'Brett',
'Brew',
'Brewer',
'Brewster',
'Brian',
'Briano',
'Briant',
'Brice',
'Brien',
'Brig',
'Brigg',
'Briggs',
'Brigham',
'Brion',
'Brit',
'Britt',
'Brnaba',
'Brnaby',
'Brock',
'Brockie',
'Brocky',
'Brod',
'Broddie',
'Broddy',
'Broderic',
'Broderick',
'Brodie',
'Brody',
'Brok',
'Bron',
'Bronnie',
'Bronny',
'Bronson',
'Brook',
'Brooke',
'Brooks',
'Brose',
'Bruce',
'Brucie',
'Bruis',
'Bruno',
'Bryan',
'Bryant',
'Bryanty',
'Bryce',
'Bryn',
'Bryon',
'Buck',
'Buckie',
'Bucky',
'Bud',
'Budd',
'Buddie',
'Buddy',
'Buiron',
'Burch',
'Burg',
'Burgess',
'Burk',
'Burke',
'Burl',
'Burlie',
'Burnaby',
'Burnard',
'Burr',
'Burt',
'Burtie',
'Burton',
'Burty',
'Butch',
'Byram',
'Byran',
'Byrann',
'Byrle',
'Byrom',
'Byron',
'Cad',
'Caddric',
'Caesar',
'Cal',
'Caldwell',
'Cale',
'Caleb',
'Calhoun',
'Callean',
'Calv',
'Calvin',
'Cam',
'Cameron',
'Camey',
'Cammy',
'Car',
'Carce',
'Care',
'Carey',
'Carl',
'Carleton',
'Carlie',
'Carlin',
'Carling',
'Carlo',
'Carlos',
'Carly',
'Carlyle',
'Carmine',
'Carney',
'Carny',
'Carolus',
'Carr',
'Carrol',
'Carroll',
'Carson',
'Cart',
'Carter',
'Carver',
'Cary',
'Caryl',
'Casar',
'Case',
'Casey',
'Cash',
'Caspar',
'Casper',
'Cass',
'Cassie',
'Cassius',
'Caz',
'Cazzie',
'Cchaddie',
'Cece',
'Cecil',
'Cecilio',
'Cecilius',
'Ced',
'Cedric',
'Cello',
'Cesar',
'Cesare',
'Cesaro',
'Chad',
'Chadd',
'Chaddie',
'Chaddy',
'Chadwick',
'Chaim',
'Chalmers',
'Chan',
'Chance',
'Chancey',
'Chandler',
'Chane',
'Chariot',
'Charles',
'Charley',
'Charlie',
'Charlton',
'Chas',
'Chase',
'Chaunce',
'Chauncey',
'Che',
'Chen',
'Ches',
'Chester',
'Cheston',
'Chet',
'Chev',
'Chevalier',
'Chevy',
'Chic',
'Chick',
'Chickie',
'Chicky',
'Chico',
'Chilton',
'Chip',
'Chris',
'Chrisse',
'Chrissie',
'Chrissy',
'Christian',
'Christiano',
'Christie',
'Christoffer',
'Christoforo',
'Christoper',
'Christoph',
'Christophe',
'Christopher',
'Christophorus',
'Christos',
'Christy',
'Chrisy',
'Chrotoem',
'Chucho',
'Chuck',
'Cirillo',
'Cirilo',
'Ciro',
'Claiborn',
'Claiborne',
'Clair',
'Claire',
'Clarance',
'Clare',
'Clarence',
'Clark',
'Clarke',
'Claudell',
'Claudian',
'Claudianus',
'Claudio',
'Claudius',
'Claus',
'Clay',
'Clayborn',
'Clayborne',
'Claybourne',
'Clayson',
'Clayton',
'Cleavland',
'Clem',
'Clemens',
'Clement',
'Clemente',
'Clementius',
'Clemmie',
'Clemmy',
'Cleon',
'Clerc',
'Cletis',
'Cletus',
'Cleve',
'Cleveland',
'Clevey',
'Clevie',
'Cliff',
'Clifford',
'Clim',
'Clint',
'Clive',
'Cly',
'Clyde',
'Clyve',
'Clywd',
'Cob',
'Cobb',
'Cobbie',
'Cobby',
'Codi',
'Codie',
'Cody',
'Cointon',
'Colan',
'Colas',
'Colby',
'Cole',
'Coleman',
'Colet',
'Colin',
'Collin',
'Colman',
'Colver',
'Con',
'Conan',
'Conant',
'Conn',
'Conney',
'Connie',
'Connor',
'Conny',
'Conrad',
'Conrade',
'Conrado',
'Conroy',
'Consalve',
'Constantin',
'Constantine',
'Constantino',
'Conway',
'Coop',
'Cooper',
'Corbet',
'Corbett',
'Corbie',
'Corbin',
'Corby',
'Cord',
'Cordell',
'Cordie',
'Cordy',
'Corey',
'Cori',
'Cornall',
'Cornelius',
'Cornell',
'Corney',
'Cornie',
'Corny',
'Correy',
'Corrie',
'Cort',
'Cortie',
'Corty',
'Cory',
'Cos',
'Cosimo',
'Cosme',
'Cosmo',
'Costa',
'Court',
'Courtnay',
'Courtney',
'Cozmo',
'Craggie',
'Craggy',
'Craig',
'Crawford',
'Creigh',
'Creight',
'Creighton',
'Crichton',
'Cris',
'Cristian',
'Cristiano',
'Cristobal',
'Crosby',
'Cross',
'Cull',
'Cullan',
'Cullen',
'Culley',
'Cullie',
'Cullin',
'Cully',
'Culver',
'Curcio',
'Curr',
'Curran',
'Currey',
'Currie',
'Curry',
'Curt',
'Curtice',
'Curtis',
'Cy',
'Cyril',
'Cyrill',
'Cyrille',
'Cyrillus',
'Cyrus',
"D'Arcy",
'Dael',
'Dag',
'Dagny',
'Dal',
'Dale',
'Dalis',
'Dall',
'Dallas',
'Dalli',
'Dallis',
'Dallon',
'Dalston',
'Dalt',
'Dalton',
'Dame',
'Damian',
'Damiano',
'Damien',
'Damon',
'Dan',
'Dana',
'Dane',
'Dani',
'Danie',
'Daniel',
'Dannel',
'Dannie',
'Danny',
'Dante',
'Danya',
'Dar',
'Darb',
'Darbee',
'Darby',
'Darcy',
'Dare',
'Daren',
'Darill',
'Darin',
'Dario',
'Darius',
'Darn',
'Darnall',
'Darnell',
'Daron',
'Darrel',
'Darrell',
'Darren',
'Darrick',
'Darrin',
'Darryl',
'Darwin',
'Daryl',
'Daryle',
'Dav',
'Dave',
'Daven',
'Davey',
'David',
'Davidde',
'Davide',
'Davidson',
'Davie',
'Davin',
'Davis',
'Davon',
'Davy',
'De Witt',
'Dean',
'Deane',
'Decca',
'Deck',
'Del',
'Delainey',
'Delaney',
'Delano',
'Delbert',
'Dell',
'Delmar',
'Delmer',
'Delmor',
'Delmore',
'Demetre',
'Demetri',
'Demetris',
'Demetrius',
'Demott',
'Den',
'Dene',
'Denis',
'Dennet',
'Denney',
'Dennie',
'Dennis',
'Dennison',
'Denny',
'Denver',
'Denys',
'Der',
'Derby',
'Derek',
'Derick',
'Derk',
'Dermot',
'Derrek',
'Derrick',
'Derrik',
'Derril',
'Derron',
'Derry',
'Derward',
'Derwin',
'Des',
'Desi',
'Desmond',
'Desmund',
'Dev',
'Devin',
'Devland',
'Devlen',
'Devlin',
'Devy',
'Dew',
'Dewain',
'Dewey',
'Dewie',
'Dewitt',
'Dex',
'Dexter',
'Diarmid',
'Dick',
'Dickie',
'Dicky',
'Diego',
'Dieter',
'Dietrich',
'Dilan',
'Dill',
'Dillie',
'Dillon',
'Dilly',
'Dimitri',
'Dimitry',
'Dino',
'Dion',
'Dionisio',
'Dionysus',
'Dirk',
'Dmitri',
'Dolf',
'Dolph',
'Dom',
'Domenic',
'Domenico',
'Domingo',
'Dominic',
'Dominick',
'Dominik',
'Dominique',
'Don',
'Donal',
'Donall',
'Donalt',
'Donaugh',
'Donavon',
'Donn',
'Donnell',
'Donnie',
'Donny',
'Donovan',
'Dore',
'Dorey',
'Dorian',
'Dorie',
'Dory',
'Doug',
'Dougie',
'Douglas',
'Douglass',
'Dougy',
'Dov',
'Doy',
'Doyle',
'Drake',
'Drew',
'Dru',
'Drud',
'Drugi',
'Duane',
'Dud',
'Dudley',
'Duff',
'Duffie',
'Duffy',
'Dugald',
'Duke',
'Dukey',
'Dukie',
'Duky',
'Dun',
'Dunc',
'Duncan',
'Dunn',
'Dunstan',
'Dur',
'Durand',
'Durant',
'Durante',
'Durward',
'Dwain',
'Dwayne',
'Dwight',
'Dylan',
'Eadmund',
'Eal',
'Eamon',
'Earl',
'Earle',
'Earlie',
'Early',
'Earvin',
'Eb',
'Eben',
'Ebeneser',
'Ebenezer',
'Eberhard',
'Eberto',
'Ed',
'Edan',
'Edd',
'Eddie',
'Eddy',
'Edgar',
'Edgard',
'Edgardo',
'Edik',
'Edlin',
'Edmon',
'Edmund',
'Edouard',
'Edsel',
'Eduard',
'Eduardo',
'Eduino',
'Edvard',
'Edward',
'Edwin',
'Efrem',
'Efren',
'Egan',
'Egbert',
'Egon',
'Egor',
'El',
'Elbert',
'Elden',
'Eldin',
'Eldon',
'Eldredge',
'Eldridge',
'Eli',
'Elia',
'Elias',
'Elihu',
'Elijah',
'Eliot',
'Elisha',
'Ellary',
'Ellerey',
'Ellery',
'Elliot',
'Elliott',
'Ellis',
'Ellswerth',
'Ellsworth',
'Ellwood',
'Elmer',
'Elmo',
'Elmore',
'Elnar',
'Elroy',
'Elston',
'Elsworth',
'Elton',
'Elvin',
'Elvis',
'Elvyn',
'Elwin',
'Elwood',
'Elwyn',
'Ely',
'Em',
'Emanuel',
'Emanuele',
'Emelen',
'Emerson',
'Emery',
'Emile',
'Emilio',
'Emlen',
'Emlyn',
'Emmanuel',
'Emmerich',
'Emmery',
'Emmet',
'Emmett',
'Emmit',
'Emmott',
'Emmy',
'Emory',
'Engelbert',
'Englebert',
'Ennis',
'Enoch',
'Enos',
'Enrico',
'Enrique',
'Ephraim',
'Ephrayim',
'Ephrem',
'Erasmus',
'Erastus',
'Erek',
'Erhard',
'Erhart',
'Eric',
'Erich',
'Erick',
'Erie',
'Erik',
'Erin',
'Erl',
'Ermanno',
'Ermin',
'Ernest',
'Ernesto',
'Ernestus',
'Ernie',
'Ernst',
'Erny',
'Errick',
'Errol',
'Erroll',
'Erskine',
'Erv',
'ErvIn',
'Erwin',
'Esdras',
'Esme',
'Esra',
'Esteban',
'Estevan',
'Etan',
'Ethan',
'Ethe',
'Ethelbert',
'Ethelred',
'Etienne',
'Ettore',
'Euell',
'Eugen',
'Eugene',
'Eugenio',
'Eugenius',
'Eustace',
'Ev',
'Evan',
'Evelin',
'Evelyn',
'Even',
'Everard',
'Evered',
'Everett',
'Evin',
'Evyn',
'Ewan',
'Eward',
'Ewart',
'Ewell',
'Ewen',
'Ezechiel',
'Ezekiel',
'Ezequiel',
'Eziechiele',
'Ezra',
'Ezri',
'Fabe',
'Faber',
'Fabian',
'Fabiano',
'Fabien',
'Fabio',
'Fair',
'Fairfax',
'Fairleigh',
'Fairlie',
'Falito',
'Falkner',
'Far',
'Farlay',
'Farlee',
'Farleigh',
'Farley',
'Farlie',
'Farly',
'Farr',
'Farrel',
'Farrell',
'Farris',
'Faulkner',
'Fax',
'Federico',
'Fee',
'Felic',
'Felice',
'Felicio',
'Felike',
'Feliks',
'Felipe',
'Felix',
'Felizio',
'Feodor',
'Ferd',
'Ferdie',
'Ferdinand',
'Ferdy',
'Fergus',
'Ferguson',
'Fernando',
'Ferrel',
'Ferrell',
'Ferris',
'Fidel',
'Fidelio',
'Fidole',
'Field',
'Fielding',
'Fields',
'Filbert',
'Filberte',
'Filberto',
'Filip',
'Filippo',
'Filmer',
'Filmore',
'Fin',
'Findlay',
'Findley',
'Finlay',
'Finley',
'Finn',
'Fitz',
'Fitzgerald',
'Flem',
'Fleming',
'Flemming',
'Fletch',
'Fletcher',
'Flin',
'Flinn',
'Flint',
'Florian',
'Flory',
'Floyd',
'Flynn',
'Fons',
'Fonsie',
'Fonz',
'Fonzie',
'Forbes',
'Ford',
'Forest',
'Forester',
'Forrest',
'Forrester',
'Forster',
'Foss',
'Foster',
'Fowler',
'Fran',
'Francesco',
'Franchot',
'Francis',
'Francisco',
'Franciskus',
'Francklin',
'Francklyn',
'Francois',
'Frank',
'Frankie',
'Franklin',
'Franklyn',
'Franky',
'Frannie',
'Franny',
'Frans',
'Fransisco',
'Frants',
'Franz',
'Franzen',
'Frasco',
'Fraser',
'Frasier',
'Frasquito',
'Fraze',
'Frazer',
'Frazier',
'Fred',
'Freddie',
'Freddy',
'Fredek',
'Frederic',
'Frederich',
'Frederick',
'Frederico',
'Frederigo',
'Frederik',
'Fredric',
'Fredrick',
'Free',
'Freedman',
'Freeland',
'Freeman',
'Freemon',
'Fremont',
'Friedrich',
'Friedrick',
'Fritz',
'Fulton',
'Gabbie',
'Gabby',
'Gabe',
'Gabi',
'Gabie',
'Gabriel',
'Gabriele',
'Gabriello',
'Gaby',
'Gael',
'Gaelan',
'Gage',
'Gail',
'Gaile',
'Gal',
'Gale',
'Galen',
'Gallagher',
'Gallard',
'Galvan',
'Galven',
'Galvin',
'Gamaliel',
'Gan',
'Gannie',
'Gannon',
'Ganny',
'Gar',
'Garald',
'Gard',
'Gardener',
'Gardie',
'Gardiner',
'Gardner',
'Gardy',
'Gare',
'Garek',
'Gareth',
'Garey',
'Garfield',
'Garik',
'Garner',
'Garold',
'Garrard',
'Garrek',
'Garret',
'Garreth',
'Garrett',
'Garrick',
'Garrik',
'Garrot',
'Garrott',
'Garry',
'Garth',
'Garv',
'Garvey',
'Garvin',
'Garvy',
'Garwin',
'Garwood',
'Gary',
'Gaspar',
'Gaspard',
'Gasparo',
'Gasper',
'Gaston',
'Gaultiero',
'Gauthier',
'Gav',
'Gavan',
'Gaven',
'Gavin',
'Gawain',
'Gawen',
'Gay',
'Gayelord',
'Gayle',
'Gayler',
'Gaylor',
'Gaylord',
'Gearalt',
'Gearard',
'Gene',
'Geno',
'Geoff',
'Geoffrey',
'Geoffry',
'Georas',
'Geordie',
'Georg',
'George',
'Georges',
'Georgi',
'Georgie',
'Georgy',
'Gerald',
'Gerard',
'Gerardo',
'Gerek',
'Gerhard',
'Gerhardt',
'Geri',
'Gerick',
'Gerik',
'Germain',
'Germaine',
'Germayne',
'Gerome',
'Gerrard',
'Gerri',
'Gerrie',
'Gerry',
'Gery',
'Gherardo',
'Giacobo',
'Giacomo',
'Giacopo',
'Gian',
'Gianni',
'Giavani',
'Gib',
'Gibb',
'Gibbie',
'Gibby',
'Gideon',
'Giff',
'Giffard',
'Giffer',
'Giffie',
'Gifford',
'Giffy',
'Gil',
'Gilbert',
'Gilberto',
'Gilburt',
'Giles',
'Gill',
'Gilles',
'Ginger',
'Gino',
'Giordano',
'Giorgi',
'Giorgio',
'Giovanni',
'Giraldo',
'Giraud',
'Giselbert',
'Giulio',
'Giuseppe',
'Giustino',
'Giusto',
'Glen',
'Glenden',
'Glendon',
'Glenn',
'Glyn',
'Glynn',
'Godard',
'Godart',
'Goddard',
'Goddart',
'Godfree',
'Godfrey',
'Godfry',
'Godwin',
'Gonzales',
'Gonzalo',
'Goober',
'Goran',
'Goraud',
'Gordan',
'Gorden',
'Gordie',
'Gordon',
'Gordy',
'Gothart',
'Gottfried',
'Grace',
'Gradeigh',
'Gradey',
'Grady',
'Graehme',
'Graeme',
'Graham',
'Graig',
'Gram',
'Gran',
'Grange',
'Granger',
'Grannie',
'Granny',
'Grant',
'Grantham',
'Granthem',
'Grantley',
'Granville',
'Gray',
'Greg',
'Gregg',
'Greggory',
'Gregoire',
'Gregoor',
'Gregor',
'Gregorio',
'Gregorius',
'Gregory',
'Grenville',
'Griff',
'Griffie',
'Griffin',
'Griffith',
'Griffy',
'Gris',
'Griswold',
'Griz',
'Grove',
'Grover',
'Gualterio',
'Guglielmo',
'Guido',
'Guilbert',
'Guillaume',
'Guillermo',
'Gun',
'Gunar',
'Gunner',
'Guntar',
'Gunter',
'Gunther',
'Gus',
'Guss',
'Gustaf',
'Gustav',
'Gustave',
'Gustavo',
'Gustavus',
'Guthrey',
'Guthrie',
'Guthry',
'Guy',
'Had',
'Hadlee',
'Hadleigh',
'Hadley',
'Hadrian',
'Hagan',
'Hagen',
'Hailey',
'Haily',
'Hakeem',
'Hakim',
'Hal',
'Hale',
'Haleigh',
'Haley',
'Hall',
'Hallsy',
'Halsey',
'Halsy',
'Ham',
'Hamel',
'Hamid',
'Hamil',
'Hamilton',
'Hamish',
'Hamlen',
'Hamlin',
'Hammad',
'Hamnet',
'Hanan',
'Hank',
'Hans',
'Hansiain',
'Hanson',
'Harald',
'Harbert',
'Harcourt',
'Hardy',
'Harlan',
'Harland',
'Harlen',
'Harley',
'Harlin',
'Harman',
'Harmon',
'Harold',
'Haroun',
'Harp',
'Harper',
'Harris',
'Harrison',
'Harry',
'Hart',
'Hartley',
'Hartwell',
'Harv',
'Harvey',
'Harwell',
'Harwilll',
'Hasheem',
'Hashim',
'Haskel',
'Haskell',
'Haslett',
'Hastie',
'Hastings',
'Hasty',
'Haven',
'Hayden',
'Haydon',
'Hayes',
'Hayward',
'Haywood',
'Hayyim',
'Haze',
'Hazel',
'Hazlett',
'Heall',
'Heath',
'Hebert',
'Hector',
'Heindrick',
'Heinrick',
'Heinrik',
'Henderson',
'Hendrick',
'Hendrik',
'Henri',
'Henrik',
'Henry',
'Herb',
'Herbert',
'Herbie',
'Herby',
'Herc',
'Hercule',
'Hercules',
'Herculie',
'Heriberto',
'Herman',
'Hermann',
'Hermie',
'Hermon',
'Hermy',
'Hernando',
'Herold',
'Herrick',
'Hersch',
'Herschel',
'Hersh',
'Hershel',
'Herve',
'Hervey',
'Hew',
'Hewe',
'Hewet',
'Hewett',
'Hewie',
'Hewitt',
'Heywood',
'Hi',
'Hieronymus',
'Hilario',
'Hilarius',
'Hilary',
'Hill',
'Hillard',
'Hillary',
'Hillel',
'Hillery',
'Hilliard',
'Hillie',
'Hillier',
'Hilly',
'Hillyer',
'Hilton',
'Hinze',
'Hiram',
'Hirsch',
'Hobard',
'Hobart',
'Hobey',
'Hobie',
'Hodge',
'Hoebart',
'Hogan',
'Holden',
'Hollis',
'Holly',
'Holmes',
'Holt',
'Homer',
'Homere',
'Homerus',
'Horace',
'Horacio',
'Horatio',
'Horatius',
'Horst',
'Hort',
'Horten',
'Horton',
'Howard',
'Howey',
'Howie',
'Hoyt',
'Hube',
'Hubert',
'Huberto',
'Hubey',
'Hubie',
'Huey',
'Hugh',
'Hughie',
'Hugibert',
'Hugo',
'Hugues',
'Humbert',
'Humberto',
'Humfrey',
'Humfrid',
'Humfried',
'Humphrey',
'Hunfredo',
'Hunt',
'Hunter',
'Huntington',
'Huntlee',
'Huntley',
'Hurlee',
'Hurleigh',
'Hurley',
'Husain',
'Husein',
'Hussein',
'Hy',
'Hyatt',
'Hyman',
'Hymie',
'Iago',
'Iain',
'Ian',
'Ibrahim',
'Ichabod',
'Iggie',
'Iggy',
'Ignace',
'Ignacio',
'Ignacius',
'Ignatius',
'Ignaz',
'Ignazio',
'Igor',
'Ike',
'Ikey',
'Ilaire',
'Ilario',
'Immanuel',
'Ingamar',
'Ingar',
'Ingelbert',
'Ingemar',
'Inger',
'Inglebert',
'Inglis',
'Ingmar',
'Ingra',
'Ingram',
'Ingrim',
'Inigo',
'Inness',
'Innis',
'Iorgo',
'Iorgos',
'Iosep',
'Ira',
'Irv',
'Irvin',
'Irvine',
'Irving',
'Irwin',
'Irwinn',
'Isa',
'Isaac',
'Isaak',
'Isac',
'Isacco',
'Isador',
'Isadore',
'Isaiah',
'Isak',
'Isiahi',
'Isidor',
'Isidore',
'Isidoro',
'Isidro',
'Israel',
'Issiah',
'Itch',
'Ivan',
'Ivar',
'Ive',
'Iver',
'Ives',
'Ivor',
'Izaak',
'Izak',
'Izzy',
'Jabez',
'Jack',
'Jackie',
'Jackson',
'Jacky',
'Jacob',
'Jacobo',
'Jacques',
'Jae',
'Jaime',
'Jaimie',
'Jake',
'Jakie',
'Jakob',
'Jamaal',
'Jamal',
'James',
'Jameson',
'Jamesy',
'Jamey',
'Jamie',
'Jamil',
'Jamill',
'Jamison',
'Jammal',
'Jan',
'Janek',
'Janos',
'Jarad',
'Jard',
'Jareb',
'Jared',
'Jarib',
'Jarid',
'Jarrad',
'Jarred',
'Jarret',
'Jarrett',
'Jarrid',
'Jarrod',
'Jarvis',
'Jase',
'Jasen',
'Jason',
'Jasper',
'Jasun',
'Javier',
'Jay',
'Jaye',
'Jayme',
'Jaymie',
'Jayson',
'Jdavie',
'Jean',
'Jecho',
'Jed',
'Jedd',
'Jeddy',
'Jedediah',
'Jedidiah',
'Jeff',
'Jefferey',
'Jefferson',
'Jeffie',
'Jeffrey',
'Jeffry',
'Jeffy',
'Jehu',
'Jeno',
'Jens',
'Jephthah',
'Jerad',
'Jerald',
'Jeramey',
'Jeramie',
'Jere',
'Jereme',
'Jeremiah',
'Jeremias',
'Jeremie',
'Jeremy',
'Jermain',
'Jermaine',
'Jermayne',
'Jerome',
'Jeromy',
'Jerri',
'Jerrie',
'Jerrold',
'Jerrome',
'Jerry',
'Jervis',
'Jess',
'Jesse',
'Jessee',
'Jessey',
'Jessie',
'Jesus',
'Jeth',
'Jethro',
'Jim',
'Jimmie',
'Jimmy',
'Jo',
'Joachim',
'Joaquin',
'Job',
'Jock',
'Jocko',
'Jodi',
'Jodie',
'Jody',
'Joe',
'Joel',
'Joey',
'Johan',
'Johann',
'Johannes',
'John',
'Johnathan',
'Johnathon',
'Johnnie',
'Johnny',
'Johny',
'Jon',
'Jonah',
'Jonas',
'Jonathan',
'Jonathon',
'Jone',
'Jordan',
'Jordon',
'Jorgan',
'Jorge',
'Jory',
'Jose',
'Joseito',
'Joseph',
'Josh',
'Joshia',
'Joshua',
'Joshuah',
'Josiah',
'Josias',
'Jourdain',
'Jozef',
'Juan',
'Jud',
'Judah',
'Judas',
'Judd',
'Jude',
'Judon',
'Jule',
'Jules',
'Julian',
'Julie',
'Julio',
'Julius',
'Justen',
'Justin',
'Justinian',
'Justino',
'Justis',
'Justus',
'Kahaleel',
'Kahlil',
'Kain',
'Kaine',
'Kaiser',
'Kale',
'Kaleb',
'Kalil',
'Kalle',
'Kalvin',
'Kane',
'Kareem',
'Karel',
'Karim',
'Karl',
'Karlan',
'Karlens',
'Karlik',
'Karlis',
'Karney',
'Karoly',
'Kaspar',
'Kasper',
'Kayne',
'Kean',
'Keane',
'Kearney',
'Keary',
'Keefe',
'Keefer',
'Keelby',
'Keen',
'Keenan',
'Keene',
'Keir',
'Keith',
'Kelbee',
'Kelby',
'Kele',
'Kellby',
'Kellen',
'Kelley',
'Kelly',
'Kelsey',
'Kelvin',
'Kelwin',
'Ken',
'Kendal',
'Kendall',
'Kendell',
'Kendrick',
'Kendricks',
'Kenn',
'Kennan',
'Kennedy',
'Kenneth',
'Kennett',
'Kennie',
'Kennith',
'Kenny',
'Kenon',
'Kent',
'Kenton',
'Kenyon',
'Ker',
'Kerby',
'Kerk',
'Kermie',
'Kermit',
'Kermy',
'Kerr',
'Kerry',
'Kerwin',
'Kerwinn',
'Kev',
'Kevan',
'Keven',
'Kevin',
'Kevon',
'Khalil',
'Kiel',
'Kienan',
'Kile',
'Kiley',
'Kilian',
'Killian',
'Killie',
'Killy',
'Kim',
'Kimball',
'Kimbell',
'Kimble',
'Kin',
'Kincaid',
'King',
'Kingsley',
'Kingsly',
'Kingston',
'Kinnie',
'Kinny',
'Kinsley',
'Kip',
'Kipp',
'Kippar',
'Kipper',
'Kippie',
'Kippy',
'Kirby',
'Kirk',
'Kit',
'Klaus',
'Klemens',
'Klement',
'Kleon',
'Kliment',
'Knox',
'Koenraad',
'Konrad',
'Konstantin',
'Konstantine',
'Korey',
'Kort',
'Kory',
'Kris',
'Krisha',
'Krishna',
'Krishnah',
'Krispin',
'Kristian',
'Kristo',
'Kristofer',
'Kristoffer',
'Kristofor',
'Kristoforo',
'Kristopher',
'Kristos',
'Kurt',
'Kurtis',
'Ky',
'Kyle',
'Kylie',
'Laird',
'Lalo',
'Lamar',
'Lambert',
'Lammond',
'Lamond',
'Lamont',
'Lance',
'Lancelot',
'Land',
'Lane',
'Laney',
'Langsdon',
'Langston',
'Lanie',
'Lannie',
'Lanny',
'Larry',
'Lars',
'Laughton',
'Launce',
'Lauren',
'Laurence',
'Laurens',
'Laurent',
'Laurie',
'Lauritz',
'Law',
'Lawrence',
'Lawry',
'Lawton',
'Lay',
'Layton',
'Lazar',
'Lazare',
'Lazaro',
'Lazarus',
'Lee',
'Leeland',
'Lefty',
'Leicester',
'Leif',
'Leigh',
'Leighton',
'Lek',
'Leland',
'Lem',
'Lemar',
'Lemmie',
'Lemmy',
'Lemuel',
'Lenard',
'Lenci',
'Lennard',
'Lennie',
'Leo',
'Leon',
'Leonard',
'Leonardo',
'Leonerd',
'Leonhard',
'Leonid',
'Leonidas',
'Leopold',
'Leroi',
'Leroy',
'Les',
'Lesley',
'Leslie',
'Lester',
'Leupold',
'Lev',
'Levey',
'Levi',
'Levin',
'Levon',
'Levy',
'Lew',
'Lewes',
'Lewie',
'Lewiss',
'Lezley',
'Liam',
'Lief',
'Lin',
'Linc',
'Lincoln',
'Lind',
'Lindon',
'Lindsay',
'Lindsey',
'Lindy',
'Link',
'Linn',
'Linoel',
'Linus',
'Lion',
'Lionel',
'Lionello',
'Lisle',
'Llewellyn',
'Lloyd',
'Llywellyn',
'Lock',
'Locke',
'Lockwood',
'Lodovico',
'Logan',
'Lombard',
'Lon',
'Lonnard',
'Lonnie',
'Lonny',
'Lorant',
'Loren',
'Lorens',
'Lorenzo',
'Lorin',
'Lorne',
'Lorrie',
'Lorry',
'Lothaire',
'Lothario',
'Lou',
'Louie',
'Louis',
'Lovell',
'Lowe',
'Lowell',
'Lowrance',
'Loy',
'Loydie',
'Luca',
'Lucais',
'Lucas',
'Luce',
'Lucho',
'Lucian',
'Luciano',
'Lucias',
'Lucien',
'Lucio',
'Lucius',
'Ludovico',
'Ludvig',
'Ludwig',
'Luigi',
'Luis',
'Lukas',
'Luke',
'Lutero',
'Luther',
'Ly',
'Lydon',
'Lyell',
'Lyle',
'Lyman',
'Lyn',
'Lynn',
'Lyon',
'Mac',
'Mace',
'Mack',
'Mackenzie',
'Maddie',
'Maddy',
'Madison',
'Magnum',
'Mahmoud',
'Mahmud',
'Maison',
'Maje',
'Major',
'Mal',
'Malachi',
'Malchy',
'Malcolm',
'Mallory',
'Malvin',
'Man',
'Mandel',
'Manfred',
'Mannie',
'Manny',
'Mano',
'Manolo',
'Manuel',
'Mar',
'Marc',
'Marcel',
'Marcello',
'Marcellus',
'Marcelo',
'Marchall',
'Marco',
'Marcos',
'Marcus',
'Marijn',
'Mario',
'Marion',
'Marius',
'Mark',
'Markos',
'Markus',
'Marlin',
'Marlo',
'Marlon',
'Marlow',
'Marlowe',
'Marmaduke',
'Marsh',
'Marshal',
'Marshall',
'Mart',
'Martainn',
'Marten',
'Martie',
'Martin',
'Martino',
'Marty',
'Martyn',
'Marv',
'Marve',
'Marven',
'Marvin',
'Marwin',
'Mason',
'Massimiliano',
'Massimo',
'Mata',
'Mateo',
'Mathe',
'Mathew',
'Mathian',
'Mathias',
'Matias',
'Matt',
'Matteo',
'Matthaeus',
'Mattheus',
'Matthew',
'Matthias',
'Matthieu',
'Matthiew',
'Matthus',
'Mattias',
'Mattie',
'Matty',
'Maurice',
'Mauricio',
'Maurie',
'Maurise',
'Maurits',
'Maurizio',
'Maury',
'Max',
'Maxie',
'Maxim',
'Maximilian',
'Maximilianus',
'Maximilien',
'Maximo',
'Maxwell',
'Maxy',
'Mayer',
'Maynard',
'Mayne',
'Maynord',
'Mayor',
'Mead',
'Meade',
'Meier',
'Meir',
'Mel',
'Melvin',
'Melvyn',
'Menard',
'Mendel',
'Mendie',
'Mendy',
'Meredeth',
'Meredith',
'Merell',
'Merill',
'Merle',
'Merrel',
'Merrick',
'Merrill',
'Merry',
'Merv',
'Mervin',
'Merwin',
'Merwyn',
'Meryl',
'Meyer',
'Mic',
'Micah',
'Michael',
'Michail',
'Michal',
'Michale',
'Micheal',
'Micheil',
'Michel',
'Michele',
'Mick',
'Mickey',
'Mickie',
'Micky',
'Miguel',
'Mikael',
'Mike',
'Mikel',
'Mikey',
'Mikkel',
'Mikol',
'Mile',
'Miles',
'Mill',
'Millard',
'Miller',
'Milo',
'Milt',
'Miltie',
'Milton',
'Milty',
'Miner',
'Minor',
'Mischa',
'Mitch',
'Mitchael',
'Mitchel',
'Mitchell',
'Moe',
'Mohammed',
'Mohandas',
'Mohandis',
'Moise',
'Moises',
'Moishe',
'Monro',
'Monroe',
'Montague',
'Monte',
'Montgomery',
'Monti',
'Monty',
'Moore',
'Mord',
'Mordecai',
'Mordy',
'Morey',
'Morgan',
'Morgen',
'Morgun',
'Morie',
'Moritz',
'Morlee',
'Morley',
'Morly',
'Morrie',
'Morris',
'Morry',
'Morse',
'Mort',
'Morten',
'Mortie',
'Mortimer',
'Morton',
'Morty',
'Mose',
'Moses',
'Moshe',
'Moss',
'Mozes',
'Muffin',
'Muhammad',
'Munmro',
'Munroe',
'Murdoch',
'Murdock',
'Murray',
'Murry',
'Murvyn',
'My',
'Myca',
'Mycah',
'Mychal',
'Myer',
'Myles',
'Mylo',
'Myron',
'Myrvyn',
'Myrwyn',
'Nahum',
'Nap',
'Napoleon',
'Nappie',
'Nappy',
'Nat',
'Natal',
'Natale',
'Nataniel',
'Nate',
'Nathan',
'Nathanael',
'Nathanial',
'Nathaniel',
'Nathanil',
'Natty',
'Neal',
'Neale',
'Neall',
'Nealon',
'Nealson',
'Nealy',
'Ned',
'Neddie',
'Neddy',
'Neel',
'Nefen',
'Nehemiah',
'Neil',
'Neill',
'Neils',
'Nels',
'Nelson',
'Nero',
'Neron',
'Nester',
'Nestor',
'Nev',
'Nevil',
'Nevile',
'Neville',
'Nevin',
'Nevins',
'Newton',
'Nial',
'Niall',
'Niccolo',
'Nicholas',
'Nichole',
'Nichols',
'Nick',
'Nickey',
'Nickie',
'Nicko',
'Nickola',
'Nickolai',
'Nickolas',
'Nickolaus',
'Nicky',
'Nico',
'Nicol',
'Nicola',
'Nicolai',
'Nicolais',
'Nicolas',
'Nicolis',
'Niel',
'Niels',
'Nigel',
'Niki',
'Nikita',
'Nikki',
'Niko',
'Nikola',
'Nikolai',
'Nikolaos',
'Nikolas',
'Nikolaus',
'Nikolos',
'Nikos',
'Nil',
'Niles',
'Nils',
'Nilson',
'Niven',
'Noach',
'Noah',
'Noak',
'Noam',
'Nobe',
'Nobie',
'Noble',
'Noby',
'Noe',
'Noel',
'Nolan',
'Noland',
'Noll',
'Nollie',
'Nolly',
'Norbert',
'Norbie',
'Norby',
'Norman',
'Normand',
'Normie',
'Normy',
'Norrie',
'Norris',
'Norry',
'North',
'Northrop',
'Northrup',
'Norton',
'Nowell',
'Nye',
'Oates',
'Obadiah',
'Obadias',
'Obed',
'Obediah',
'Oberon',
'Obidiah',
'Obie',
'Oby',
'Octavius',
'Ode',
'Odell',
'Odey',
'Odie',
'Odo',
'Ody',
'Ogdan',
'Ogden',
'Ogdon',
'Olag',
'Olav',
'Ole',
'Olenolin',
'Olin',
'Oliver',
'Olivero',
'Olivier',
'Oliviero',
'Ollie',
'Olly',
'Olvan',
'Omar',
'Omero',
'Onfre',
'Onfroi',
'Onofredo',
'Oran',
'Orazio',
'Orbadiah',
'Oren',
'Orin',
'Orion',
'Orlan',
'Orland',
'Orlando',
'Orran',
'Orren',
'Orrin',
'Orson',
'Orton',
'Orv',
'Orville',
'Osbert',
'Osborn',
'Osborne',
'Osbourn',
'Osbourne',
'Osgood',
'Osmond',
'Osmund',
'Ossie',
'Oswald',
'Oswell',
'Otes',
'Othello',
'Otho',
'Otis',
'Otto',
'Owen',
'Ozzie',
'Ozzy',
'Pablo',
'Pace',
'Packston',
'Paco',
'Pacorro',
'Paddie',
'Paddy',
'Padget',
'Padgett',
'Padraic',
'Padraig',
'Padriac',
'Page',
'Paige',
'Pail',
'Pall',
'Palm',
'Palmer',
'Panchito',
'Pancho',
'Paolo',
'Papageno',
'Paquito',
'Park',
'Parke',
'Parker',
'Parnell',
'Parrnell',
'Parry',
'Parsifal',
'Pascal',
'Pascale',
'Pasquale',
'Pat',
'Pate',
'Paten',
'Patin',
'Paton',
'Patric',
'Patrice',
'Patricio',
'Patrick',
'Patrizio',
'Patrizius',
'Patsy',
'Patten',
'Pattie',
'Pattin',
'Patton',
'Patty',
'Paul',
'Paulie',
'Paulo',
'Pauly',
'Pavel',
'Pavlov',
'Paxon',
'Paxton',
'Payton',
'Peadar',
'Pearce',
'Pebrook',
'Peder',
'Pedro',
'Peirce',
'Pembroke',
'Pen',
'Penn',
'Pennie',
'Penny',
'Penrod',
'Pepe',
'Pepillo',
'Pepito',
'Perceval',
'Percival',
'Percy',
'Perice',
'Perkin',
'Pernell',
'Perren',
'Perry',
'Pete',
'Peter',
'Peterus',
'Petey',
'Petr',
'Peyter',
'Peyton',
'Phil',
'Philbert',
'Philip',
'Phillip',
'Phillipe',
'Phillipp',
'Phineas',
'Phip',
'Pierce',
'Pierre',
'Pierson',
'Pieter',
'Pietrek',
'Pietro',
'Piggy',
'Pincas',
'Pinchas',
'Pincus',
'Piotr',
'Pip',
'Pippo',
'Pooh',
'Port',
'Porter',
'Portie',
'Porty',
'Poul',
'Powell',
'Pren',
'Prent',
'Prentice',
'Prentiss',
'Prescott',
'Preston',
'Price',
'Prince',
'Prinz',
'Pryce',
'Puff',
'Purcell',
'Putnam',
'Putnem',
'Pyotr',
'Quent',
'Quentin',
'Quill',
'Quillan',
'Quincey',
'Quincy',
'Quinlan',
'Quinn',
'Quint',
'Quintin',
'Quinton',
'Quintus',
'Rab',
'Rabbi',
'Rabi',
'Rad',
'Radcliffe',
'Raddie',
'Raddy',
'Rafael',
'Rafaellle',
'Rafaello',
'Rafe',
'Raff',
'Raffaello',
'Raffarty',
'Rafferty',
'Rafi',
'Ragnar',
'Raimondo',
'Raimund',
'Raimundo',
'Rainer',
'Raleigh',
'Ralf',
'Ralph',
'Ram',
'Ramon',
'Ramsay',
'Ramsey',
'Rance',
'Rancell',
'Rand',
'Randal',
'Randall',
'Randell',
'Randi',
'Randie',
'Randolf',
'Randolph',
'Randy',
'Ransell',
'Ransom',
'Raoul',
'Raphael',
'Raul',
'Ravi',
'Ravid',
'Raviv',
'Rawley',
'Ray',
'Raymond',
'Raymund',
'Raynard',
'Rayner',
'Raynor',
'Read',
'Reade',
'Reagan',
'Reagen',
'Reamonn',
'Red',
'Redd',
'Redford',
'Reece',
'Reed',
'Rees',
'Reese',
'Reg',
'Regan',
'Regen',
'Reggie',
'Reggis',
'Reggy',
'Reginald',
'Reginauld',
'Reid',
'Reidar',
'Reider',
'Reilly',
'Reinald',
'Reinaldo',
'Reinaldos',
'Reinhard',
'Reinhold',
'Reinold',
'Reinwald',
'Rem',
'Remington',
'Remus',
'Renado',
'Renaldo',
'Renard',
'Renato',
'Renaud',
'Renault',
'Rene',
'Reube',
'Reuben',
'Reuven',
'Rex',
'Rey',
'Reynard',
'Reynold',
'Reynolds',
'Rhett',
'Rhys',
'Ric',
'Ricard',
'Ricardo',
'Riccardo',
'Rice',
'Rich',
'Richard',
'Richardo',
'Richart',
'Richie',
'Richmond',
'Richmound',
'Richy',
'Rick',
'Rickard',
'Rickert',
'Rickey',
'Ricki',
'Rickie',
'Ricky',
'Ricoriki',
'Rik',
'Rikki',
'Riley',
'Rinaldo',
'Ring',
'Ringo',
'Riobard',
'Riordan',
'Rip',
'Ripley',
'Ritchie',
'Roarke',
'Rob',
'Robb',
'Robbert',
'Robbie',
'Robby',
'Robers',
'Robert',
'Roberto',
'Robin',
'Robinet',
'Robinson',
'Rochester',
'Rock',
'Rockey',
'Rockie',
'Rockwell',
'Rocky',
'Rod',
'Rodd',
'Roddie',
'Roddy',
'Roderic',
'Roderich',
'Roderick',
'Roderigo',
'Rodge',
'Rodger',
'Rodney',
'Rodolfo',
'Rodolph',
'Rodolphe',
'Rodrick',
'Rodrigo',
'Rodrique',
'Rog',
'Roger',
'Rogerio',
'Rogers',
'Roi',
'Roland',
'Rolando',
'Roldan',
'Roley',
'Rolf',
'Rolfe',
'Rolland',
'Rollie',
'Rollin',
'Rollins',
'Rollo',
'Rolph',
'Roma',
'Romain',
'Roman',
'Romeo',
'Ron',
'Ronald',
'Ronnie',
'Ronny',
'Rooney',
'Roosevelt',
'Rorke',
'Rory',
'Rosco',
'Roscoe',
'Ross',
'Rossie',
'Rossy',
'Roth',
'Rourke',
'Rouvin',
'Rowan',
'Rowen',
'Rowland',
'Rowney',
'Roy',
'Royal',
'Royall',
'Royce',
'Rriocard',
'Rube',
'Ruben',
'Rubin',
'Ruby',
'Rudd',
'Ruddie',
'Ruddy',
'Rudie',
'Rudiger',
'Rudolf',
'Rudolfo',
'Rudolph',
'Rudy',
'Rudyard',
'Rufe',
'Rufus',
'Ruggiero',
'Rupert',
'Ruperto',
'Ruprecht',
'Rurik',
'Russ',
'Russell',
'Rustie',
'Rustin',
'Rusty',
'Rutger',
'Rutherford',
'Rutledge',
'Rutter',
'Ruttger',
'Ruy',
'Ryan',
'Ryley',
'Ryon',
'Ryun',
'Sal',
'Saleem',
'Salem',
'Salim',
'Salmon',
'Salomo',
'Salomon',
'Salomone',
'Salvador',
'Salvatore',
'Salvidor',
'Sam',
'Sammie',
'Sammy',
'Sampson',
'Samson',
'Samuel',
'Samuele',
'Sancho',
'Sander',
'Sanders',
'Sanderson',
'Sandor',
'Sandro',
'Sandy',
'Sanford',
'Sanson',
'Sansone',
'Sarge',
'Sargent',
'Sascha',
'Sasha',
'Saul',
'Sauncho',
'Saunder',
'Saunders',
'Saunderson',
'Saundra',
'Sauveur',
'Saw',
'Sawyer',
'Sawyere',
'Sax',
'Saxe',
'Saxon',
'Say',
'Sayer',
'Sayers',
'Sayre',
'Sayres',
'Scarface',
'Schuyler',
'Scot',
'Scott',
'Scotti',
'Scottie',
'Scotty',
'Seamus',
'Sean',
'Sebastian',
'Sebastiano',
'Sebastien',
'See',
'Selby',
'Selig',
'Serge',
'Sergeant',
'Sergei',
'Sergent',
'Sergio',
'Seth',
'Seumas',
'Seward',
'Seymour',
'Shadow',
'Shae',
'Shaine',
'Shalom',
'Shamus',
'Shanan',
'Shane',
'Shannan',
'Shannon',
'Shaughn',
'Shaun',
'Shaw',
'Shawn',
'Shay',
'Shayne',
'Shea',
'Sheff',
'Sheffie',
'Sheffield',
'Sheffy',
'Shelby',
'Shelden',
'Shell',
'Shelley',
'Shelton',
'Shem',
'Shep',
'Shepard',
'Shepherd',
'Sheppard',
'Shepperd',
'Sheridan',
'Sherlock',
'Sherlocke',
'Sherm',
'Sherman',
'Shermie',
'Shermy',
'Sherwin',
'Sherwood',
'Sherwynd',
'Sholom',
'Shurlock',
'Shurlocke',
'Shurwood',
'Si',
'Sibyl',
'Sid',
'Sidnee',
'Sidney',
'Siegfried',
'Siffre',
'Sig',
'Sigfrid',
'Sigfried',
'Sigismond',
'Sigismondo',
'Sigismund',
'Sigismundo',
'Sigmund',
'Sigvard',
'Silas',
'Silvain',
'Silvan',
'Silvano',
'Silvanus',
'Silvester',
'Silvio',
'Sim',
'Simeon',
'Simmonds',
'Simon',
'Simone',
'Sinclair',
'Sinclare',
'Siward',
'Skell',
'Skelly',
'Skip',
'Skipp',
'Skipper',
'Skippie',
'Skippy',
'Skipton',
'Sky',
'Skye',
'Skylar',
'Skyler',
'Slade',
'Sloan',
'Sloane',
'Sly',
'Smith',
'Smitty',
'Sol',
'Sollie',
'Solly',
'Solomon',
'Somerset',
'Son',
'Sonnie',
'Sonny',
'Spence',
'Spencer',
'Spense',
'Spenser',
'Spike',
'Stacee',
'Stacy',
'Staffard',
'Stafford',
'Staford',
'Stan',
'Standford',
'Stanfield',
'Stanford',
'Stanislas',
'Stanislaus',
'Stanislaw',
'Stanleigh',
'Stanley',
'Stanly',
'Stanton',
'Stanwood',
'Stavro',
'Stavros',
'Stearn',
'Stearne',
'Stefan',
'Stefano',
'Steffen',
'Stephan',
'Stephanus',
'Stephen',
'Sterling',
'Stern',
'Sterne',
'Steve',
'Steven',
'Stevie',
'Stevy',
'Steward',
'Stewart',
'Stillman',
'Stillmann',
'Stinky',
'Stirling',
'Stu',
'Stuart',
'Sullivan',
'Sully',
'Sumner',
'Sunny',
'Sutherlan',
'Sutherland',
'Sutton',
'Sven',
'Svend',
'Swen',
'Syd',
'Sydney',
'Sylas',
'Sylvan',
'Sylvester',
'Syman',
'Symon',
'Tab',
'Tabb',
'Tabbie',
'Tabby',
'Taber',
'Tabor',
'Tad',
'Tadd',
'Taddeo',
'Taddeusz',
'Tadeas',
'Tadeo',
'Tades',
'Tadio',
'Tailor',
'Tait',
'Taite',
'Talbert',
'Talbot',
'Tallie',
'Tally',
'Tam',
'Tamas',
'Tammie',
'Tammy',
'Tan',
'Tann',
'Tanner',
'Tanney',
'Tannie',
'Tanny',
'Tarrance',
'Tate',
'Taylor',
'Teador',
'Ted',
'Tedd',
'Teddie',
'Teddy',
'Tedie',
'Tedman',
'Tedmund',
'Temp',
'Temple',
'Templeton',
'Teodoor',
'Teodor',
'Teodorico',
'Teodoro',
'Terence',
'Terencio',
'Terrance',
'Terrel',
'Terrell',
'Terrence',
'Terri',
'Terrill',
'Terry',
'Thacher',
'Thaddeus',
'Thaddus',
'Thadeus',
'Thain',
'Thaine',
'Thane',
'Thatch',
'Thatcher',
'Thaxter',
'Thayne',
'Thebault',
'Thedric',
'Thedrick',
'Theo',
'Theobald',
'Theodor',
'Theodore',
'Theodoric',
'Thibaud',
'Thibaut',
'Thom',
'Thoma',
'Thomas',
'Thor',
'Thorin',
'Thorn',
'Thorndike',
'Thornie',
'Thornton',
'Thorny',
'Thorpe',
'Thorstein',
'Thorsten',
'Thorvald',
'Thurstan',
'Thurston',
'Tibold',
'Tiebold',
'Tiebout',
'Tiler',
'Tim',
'Timmie',
'Timmy',
'Timofei',
'Timoteo',
'Timothee',
'Timotheus',
'Timothy',
'Tirrell',
'Tito',
'Titos',
'Titus',
'Tobe',
'Tobiah',
'Tobias',
'Tobie',
'Tobin',
'Tobit',
'Toby',
'Tod',
'Todd',
'Toddie',
'Toddy',
'Toiboid',
'Tom',
'Tomas',
'Tomaso',
'Tome',
'Tomkin',
'Tomlin',
'Tommie',
'Tommy',
'Tonnie',
'Tony',
'Tore',
'Torey',
'Torin',
'Torr',
'Torrance',
'Torre',
'Torrence',
'Torrey',
'Torrin',
'Torry',
'Town',
'Towney',
'Townie',
'Townsend',
'Towny',
'Trace',
'Tracey',
'Tracie',
'Tracy',
'Traver',
'Travers',
'Travis',
'Travus',
'Trefor',
'Tremain',
'Tremaine',
'Tremayne',
'Trent',
'Trenton',
'Trev',
'Trevar',
'Trever',
'Trevor',
'Trey',
'Trip',
'Tripp',
'Tris',
'Tristam',
'Tristan',
'Troy',
'Trstram',
'Trueman',
'Trumaine',
'Truman',
'Trumann',
'Tuck',
'Tucker',
'Tuckie',
'Tucky',
'Tudor',
'Tull',
'Tulley',
'Tully',
'Turner',
'Ty',
'Tybalt',
'Tye',
'Tyler',
'Tymon',
'Tymothy',
'Tynan',
'Tyrone',
'Tyrus',
'Tyson',
'Udale',
'Udall',
'Udell',
'Ugo',
'Ulberto',
'Ulick',
'Ulises',
'Ulric',
'Ulrich',
'Ulrick',
'Ulysses',
'Umberto',
'Upton',
'Urbain',
'Urban',
'Urbano',
'Urbanus',
'Uri',
'Uriah',
'Uriel',
'Urson',
'Vachel',
'Vaclav',
'Vail',
'Val',
'Valdemar',
'Vale',
'Valentijn',
'Valentin',
'Valentine',
'Valentino',
'Valle',
'Van',
'Vance',
'Vanya',
'Vasili',
'Vasilis',
'Vasily',
'Vassili',
'Vassily',
'Vaughan',
'Vaughn',
'Verge',
'Vergil',
'Vern',
'Verne',
'Vernen',
'Verney',
'Vernon',
'Vernor',
'Vic',
'Vick',
'Victoir',
'Victor',
'Vidovic',
'Vidovik',
'Vin',
'Vince',
'Vincent',
'Vincents',
'Vincenty',
'Vincenz',
'Vinnie',
'Vinny',
'Vinson',
'Virge',
'Virgie',
'Virgil',
'Virgilio',
'Vite',
'Vito',
'Vittorio',
'Vlad',
'Vladamir',
'Vladimir',
'Von',
'Wade',
'Wadsworth',
'Wain',
'Wainwright',
'Wait',
'Waite',
'Waiter',
'Wake',
'Wakefield',
'Wald',
'Waldemar',
'Walden',
'Waldo',
'Waldon',
'Walker',
'Wallace',
'Wallache',
'Wallas',
'Wallie',
'Wallis',
'Wally',
'Walsh',
'Walt',
'Walther',
'Walton',
'Wang',
'Ward',
'Warde',
'Warden',
'Ware',
'Waring',
'Warner',
'Warren',
'Wash',
'Washington',
'Wat',
'Waverley',
'Waverly',
'Way',
'Waylan',
'Wayland',
'Waylen',
'Waylin',
'Waylon',
'Wayne',
'Web',
'Webb',
'Weber',
'Webster',
'Weidar',
'Weider',
'Welbie',
'Welby',
'Welch',
'Wells',
'Welsh',
'Wendall',
'Wendel',
'Wendell',
'Werner',
'Wernher',
'Wes',
'Wesley',
'West',
'Westbrook',
'Westbrooke',
'Westleigh',
'Westley',
'Weston',
'Weylin',
'Wheeler',
'Whit',
'Whitaker',
'Whitby',
'Whitman',
'Whitney',
'Whittaker',
'Wiatt',
'Wilbert',
'Wilbur',
'Wilburt',
'Wilden',
'Wildon',
'Wilek',
'Wiley',
'Wilfred',
'Wilfrid',
'Wilhelm',
'Will',
'Willard',
'Willdon',
'Willem',
'Willey',
'Willi',
'William',
'Willie',
'Willis',
'Willy',
'Wilmar',
'Wilmer',
'Wilt',
'Wilton',
'Win',
'Windham',
'Winfield',
'Winfred',
'Winifield',
'Winn',
'Winnie',
'Winny',
'Winslow',
'Winston',
'Winthrop',
'Wit',
'Wittie',
'Witty',
'Wolf',
'Wolfgang',
'Wolfie',
'Wolfy',
'Wood',
'Woodie',
'Woodman',
'Woodrow',
'Woody',
'Worden',
'Worth',
'Worthington',
'Worthy',
'Wright',
'Wyatan',
'Wyatt',
'Wye',
'Wylie',
'Wyn',
'Wyndham',
'Wynn',
'Xavier',
'Xenos',
'Xerxes',
'Xever',
'Ximenes',
'Ximenez',
'Xymenes',
'Yale',
'Yanaton',
'Yance',
'Yancey',
'Yancy',
'Yank',
'Yankee',
'Yard',
'Yardley',
'Yehudi',
'Yehudit',
'Yorgo',
'Yorgos',
'York',
'Yorke',
'Yorker',
'Yul',
'Yule',
'Yulma',
'Yuma',
'Yuri',
'Yurik',
'Yves',
'Yvon',
'Yvor',
'Zaccaria',
'Zach',
'Zacharia',
'Zachariah',
'Zacharias',
'Zacharie',
'Zachary',
'Zacherie',
'Zachery',
'Zack',
'Zackariah',
'Zak',
'Zane',
'Zared',
'Zeb',
'Zebadiah',
'Zebedee',
'Zebulen',
'Zebulon',
'Zechariah',
'Zed',
'Zedekiah',
'Zeke',
'Zelig',
'Zerk',
'Zollie',
'Zolly'] |
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
pre,cur = 0,1
while cur < len(nums):
if nums[pre] == nums[cur]:
nums.pop(cur)
else:
pre,cur = pre + 1, cur + 1
return len(nums)
|
# by Kami Bigdely
# Extract class
class Actor:
def __init__(self, first_name, last_name, birth_year, movies, email) -> None:
self.first_name = first_name
self.last_name = last_name
self.birth_year = birth_year
self.movies = movies
self.email = email
def send_hiring_email(self):
print("Email sent to: ", self.email)
elizabeth_debicki = Actor("Elizabeth", "Debicki", 1990, \
['Tenet', 'Vita & Virgina', 'Guardians of the Galexy', 'The Great Gatsby'], '[email protected]')
jim_carrey = Actor("Jim", "Carrey", 1962, \
['Ace Ventura', 'The Mask', 'Dubm and Dumber', 'The Truman Show', 'Yes Man'], '[email protected]')
actors = [elizabeth_debicki, jim_carrey]
for actor in actors:
if actor.birth_year > 1985:
print(actor.first_name, actor.last_name)
print('Movies Played: ', end='')
for m in actor.movies:
print(m, end=', ')
print()
actor.send_hiring_email()
|
#creating a function
def cal(one,two):
three=float(one)-float(two)
print(three)
return
cal(1,4)
|
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def __init__(self):
self.plus1 = 0
def copyTheResults(self, node, result):
while node != None:
result.next = ListNode(node.val)
result = result.next
result.next = None
if self.plus1 == 1:
result.val = node.val + 1
if result.val >= 10:
result.val = result.val - 10
self.plus1 = 1
else:
self.plus1 = 0
node = node.next
if self.plus1 == 1:
result.next = ListNode(1)
result = result.next
result.next = None
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
if l1 == None:
return l2
if l2 == None:
return l1
resultHead = result = ListNode(0)
while l1 != None and l2 != None:
result.next = ListNode(l1.val + l2.val)
result = result.next
result.next = None
if self.plus1 == 1:
result.val = result.val + 1
self.plus1 = 0
if result.val >= 10:
result.val = result.val - 10
self.plus1 = 1
l1 = l1.next
l2 = l2.next
if l1 == None:
self.copyTheResults(l2, result)
if l2 == None:
self.copyTheResults(l1, result)
return resultHead.next |
class XYZfileWrongFormat(Exception):
pass
class XYZfileDidNotExist(Exception):
pass
|
def number_length(a: int) -> int:
# your code here
# algorithm
# 1) Will recive an argument called "a" of datatype "int"
# 2) Convert the integer into a string
# 3) Calculate the length of the string
# 4) Return the Length of the string
return len(str(a))
def number_length_two(a: int) -> int:
mystring = str(a)
mylength = len(mystring)
return mylength
if __name__ == '__main__':
print("Example:")
print(number_length(10))
# These "asserts" are used for self-checking and not for an auto-testing
assert number_length(10) == 2
assert number_length(0) == 1
assert number_length(4) == 1
assert number_length(44) == 2
print("Coding complete? Click 'Check' to earn cool rewards!")
|
# URI Online Judge 2152
N = int(input())
for n in range(N):
entrada = [int(i) for i in input().split()]
if entrada[2] == 0: estado = 'fechou'
else: estado = 'abriu'
print('{:02d}:{:02d} - A porta {}!'.format(entrada[0], entrada[1], estado)) |
# -*- coding: utf-8 -*-
"""
lswifi.ie
~~~~~~~~~
schema definition for information element
"""
class InformationElement:
"""Base class for Information Elements"""
def __init__(
self,
element,
element_id,
element_id_extension=None,
extensible=None,
fragmentable=None,
):
self.element = element
self.element_id = element_id
self.element_id_extension = element_id_extension
self.extensible = extensible
self.fragmentable = fragmentable
|
# Count and display the number of vowels,
# consonants, uppercase, lowercase characters in string
def countCharacterType(s):
vowels = 0
consonant = 0
lowercase = 0
uppercase = 0
for i in range(0, len(s)):
ch = s[i]
if ((ch >= 'a' and ch <= 'z') or
(ch >= 'A' and ch <= 'Z')):
if ch.islower():
lowercase += 1
if ch.isupper():
uppercase += 1
ch = ch.lower()
if (ch == 'a' or ch == 'e' or ch == 'i'
or ch == 'o' or ch == 'u'):
vowels += 1
else:
consonant += 1
print("Vowels:", vowels)
print("Consonant:", consonant)
print("LowerCase:", lowercase)
print("UpperCase:", uppercase)
k = True
while k == True:
s = input('Enter a string: ')
countCharacterType(s)
option = input('Do you want to try again.(y/n): ').lower()
if option == 'y':
continue
else:
k = False
|
class Solution:
def __init__(self, N: int, blacklist: List[int]):
self.validRange = N - len(blacklist)
self.dict = {}
for b in blacklist:
self.dict[b] = -1
for b in blacklist:
if b < self.validRange:
while N - 1 in self.dict:
N -= 1
self.dict[b] = N - 1
N -= 1
def pick(self) -> int:
value = randint(0, self.validRange - 1)
if value in self.dict:
return self.dict[value]
return value
|
class Node(object):
def __init__(self, key, value):
self.key = key
self.value = value
self.pre = None
self.next = None
class LRUCache(object):
def __init__(self, capacity):
"""
:type capacity: int
"""
self.capacity = capacity
self.hkeys = {}
# 设置一个头尾指针,和尾指针
self.head = Node(None, -1)
self.tail = Node(None, -1)
self.size = 0
self.head.next, self.tail.pre = self.tail, self.head
def get(self, key):
"""
:type key: int
:rtype: int
"""
if key not in self.hkeys:
return -1
cur = self.hkeys[key]
cur.pre.next, cur.next.pre = cur.next, cur.pre
node = self.head.next
self.head.next, cur.pre, cur.next, node.pre = cur, self.head, self.head.next, cur
return self.hkeys.get(key).value
def put(self, key, value):
"""
:type key: int
:type value: int
:rtype: None
"""
# 存在时修改值,并放到头的位置
if key in self.hkeys:
cur = self.hkeys[key]
cur.value = value
cur.pre.next, cur.next.pre = cur.next, cur.pre
node = self.head.next
self.head.next, cur.pre, cur.next, node.pre = cur, self.head, node, cur
else:
if self.size == self.capacity:
tail = self.tail.pre
self.hkeys.pop(tail.key)
tail.pre.next, tail.next.pre = tail.next, tail.pre
self.size -= 1
cur = Node(key, value)
self.hkeys[key] = cur
node = self.head.next
self.head.next, cur.next, cur.pre, node.pre = cur, node, self.head, cur
self.size += 1
# 删除最后一个元素
# Your LRUCache object will be instantiated and called as such:
# obj = LRUCache(capacity)
# param_1 = obj.get(key)
# obj.put(key,value) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright 2020, Yutong Xie, UIUC.
Iteratively reverse a singly linked list
'''
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution(object):
def reverseList(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
prev = None
curr = head
while curr:
tmp = curr.next
curr.next = prev
prev = curr
curr = tmp
return prev
|
totalelements=int(input())
numeratorele=[int(ele) for ele in input().split()]
denomele=[int(ele) for ele in input().split()]
resnumerator=0
if len(numeratorele) == len(denomele):
for i in range(totalelements):
cal=numeratorele[i]*denomele[i]
resnumerator+=cal
print(round(resnumerator/sum(denomele),1))
#weighted mean |
def foo():
'''
>>> from mod import Good as Good
'''
pass # Ignore PyUnusedCodeBear
|
class Node:
def __init__(self):
self.children = {}
self.endOfWord = False
class Trie:
def __init__(self):
"""
Initialize your data structure here.
"""
# Trie intializes with a Node
self.root = Node()
def insert(self, word: str) -> None:
"""
Inserts a word into the trie.
"""
# have a pointer to the root
cur = self.root
# for every letter in the word
for letter in word:
# if its not in the the roots children
if letter not in cur.children:
# have a the letter be the key and the node be the value
cur.children[letter] = Node()
# then curent points to the child's letter
cur = cur.children[letter]
# after all of the letters set end of word to true
cur.endOfWord = True
def search(self, word: str) -> bool:
"""
Returns if the word is in the trie.
"""
# have a pointer to the root
cur = self.root
# for every letter in the word
for letter in word:
# if the letter is not in the cur.children then it doesnt exist so return False
if letter not in cur.children:
return False
# then continue to point to the next child's letters
cur = cur.children[letter]
# then if the the end of word is true or false return it
return cur.endOfWord
def startsWith(self, prefix: str) -> bool:
"""
Returns if there is any word in the trie that starts with the given prefix.
"""
cur = self.root
# for every letter in the prefix
for letter in prefix:
# if its not in the children return False
if letter not in cur.children:
return False
cur = cur.children[letter]
# otherwise it exists so return true
return True
t = Trie()
t.insert("word")
t.insert("the")
t.insert("what")
t.startsWith("search")
print(t.search("the"))
print(t.root.children) |
#!/usr/bin/env python3
# Conditional statements check for a condition,
# and act accordingly.
# Python uses the `if/elif/else` structure for this.
# Example 1
if 2 > 1:
print("2 greater than 1")
# Example 2
var1 = 1
var2 = 10
if var1 > var2:
print("var1 greater than var2")
else:
print("var2 greater than var1")
# Example 3
# Ask for an input
value = input("What is the price for that thing?")
value = int(value) # Try converting it to an int
if value < 10:
print("That's great!")
elif 10 <= value <= 20:
print("I would still buy it!")
else:
print("That's costly!")
|
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def isBalanced(self, root):
"""
:type root: TreeNode
:rtype: bool
"""
def _treeDepth(node):
if node is None:
return 0
else:
return 1 + max(_treeDepth(node.left), _treeDepth(node.right))
if root is None:
return True
else:
return abs(_treeDepth(root.left)-_treeDepth(root.right)) <= 1 and self.isBalanced(root.left) and self.isBalanced(root.right)
|
class Rollout:
'''
Usage: rollout = Rollout(state)
'''
def __init__(self, state):
self.state_list = [state]
self.action_list = []
self.reward_list = []
self.act_val_list = []
self.done = False
def append(self, state, action, reward, done, act_val):
self.state_list.append(state)
self.action_list.append(action)
self.reward_list.append(reward)
self.act_val_list.append(act_val)
self.done = done
'''
Length of the rollout is (number of states - 1) or (number of rewards)
'''
def __len__(self):
return len(self.reward_list)
|
#!/usr/bin/env python
TEST_PUBLIC_KEY = 5764801
CARD_PUBLIC_KEY = 18499292
DOOR_PUBLIC_KEY = 8790390
def find_loop_size(
target_key,
subject=7,
starting_value=1,
):
value = starting_value
loop_size = 0
while value != target_key:
value = value * subject
value = value % 20201227
loop_size += 1
return loop_size
def find_encryption_key(
public_key,
loop_size,
starting_value=1,
):
value = starting_value
loop_count = 0
while loop_count < loop_size:
value = value * public_key
value = value % 20201227
loop_count += 1
return value
def main():
test_loop_size = find_loop_size(TEST_PUBLIC_KEY)
assert(test_loop_size == 8)
card_loop_size = find_loop_size(CARD_PUBLIC_KEY)
door_loop_size = find_loop_size(DOOR_PUBLIC_KEY)
card_encryption_key = find_encryption_key(
DOOR_PUBLIC_KEY, card_loop_size
)
door_encryption_key = find_encryption_key(
CARD_PUBLIC_KEY, door_loop_size
)
assert(card_encryption_key == door_encryption_key)
part_1_result = card_encryption_key
print(f"Part 1: {part_1_result}")
# part_2_result = None
# print(f"Part 2: {part_2_result}")
if __name__ == "__main__":
main()
|
class BaseDerivative:
def __init__(self, config, instance, *args, **kwargs):
self.config = config
self.instance = instance
|
# display characters
BLANK_STR = ' '
PLAYER_1_STR = ' X '
PLAYER_2_STR = ' O '
LEFT_PAD_STR = ' '
HORIZ_BOARD_STR = '-'
HORIZ_BOARD_STR_THREE = ''.join(HORIZ_BOARD_STR for x in xrange(3))
VERTICAL_BOARD_STR = '|'
assert len(BLANK_STR) == len(PLAYER_1_STR) == len(PLAYER_2_STR)
def get_board_display(board_state, debug_mode=False):
"""
The L{board_state} must be a 2-dimensional array (list of lists)
where each positional value is what should be printed in the
corresponding cell.
Returns a string representation of the board state. Always
has number labels on the columns.
If L{debug_mode} is C{True}, the column number labels will
be zero-based (0...NUM_COLS) and 0-based row labels
will be present. If C{debug_mode} is C{False}, the column labels
will be 1-based (1...NUM_COLS+1) and there will be no row labels.
Example (debug mode):
0 1 2 3 4 5 6 7 8 9
|---|---|---|---|---|---|---|---|---|---|
0 | | | | | | | | | | |
1 | | | | | | | | | | |
2 | | | | | | | | | | |
3 | | | | | | | | | | |
4 | | | | | | | | | | |
5 | | | | | | | | | | |
6 | | | | | | | | | | |
7 | | | | | | | | | | |
|---|---|---|---|---|---|---|---|---|---|
"""
assert isinstance(board_state, list) # better be a list
assert isinstance(debug_mode, bool) # better be a boolean
# detect the board dimensions
board_height = len(board_state)
assert board_height >= 1
# just asserted there is at least 1 element, grab it to detect width
board_width = len(board_state[0])
# make sure 2d array is rectangular
assert all(len(cols) == board_width for cols in board_state)
# make the base of the string that will represent the top and bottom of the board.
# the statement 'STR_1.join(iterable)'' will join each element from the iterable using STR_1.
# for example, 'm'.join(('1','2','3','4')) will create the string 1m2m3m4
# NOTE: it doesn't put one before or after, so we do it manually.
BASE_TOP_BOT = (LEFT_PAD_STR + # indent the top line by the pad
VERTICAL_BOARD_STR + # add one before
# this join uses a shortcut syntax for defining an iterable,
# the innards of the join(stuff to join) will yield an iterable
# the same length as the xrange (which we're using just to
# count iterations) but with every element as '---'
VERTICAL_BOARD_STR.join(HORIZ_BOARD_STR_THREE for x in xrange(board_width)) +
VERTICAL_BOARD_STR + # add one after
'\n')
# debug mode shows the 0-based indices of the columns, but
# when we're playing the game we use 1 to len(cols)
if debug_mode:
col_labels = xrange(0, board_width)
else:
col_labels = xrange(1, board_width + 1)
# the line with the numbers labelling the columns
HEADER = ('\n' +
LEFT_PAD_STR +
# this next one labels the columns
' '.join('%3d' % x for x in col_labels) +
'\n' +
BASE_TOP_BOT)
FOOTER = '' # just in case we want to add feet or something
board_display_string = '' # build this string as we go
board_display_string += HEADER
# for each row in the grid, print the grid lines
# with the contents of any cell injected into them.
for idx, row_cell_list in enumerate(board_state):
if debug_mode:
# add the row counter
board_display_string += '%2d ' % idx
else:
board_display_string += LEFT_PAD_STR
board_display_string += (VERTICAL_BOARD_STR +
VERTICAL_BOARD_STR.join(row_cell_list) +
VERTICAL_BOARD_STR +
'\n')
board_display_string += BASE_TOP_BOT
board_display_string += FOOTER
return board_display_string
# end of the function: get_board_state
def get_next_free_row_in_column(col_number, board_state):
"""
Calculate and return the row index.
indicating the next available cell in the given L{col_number}.
All row/col indices this deals with are zero-based.
DO NOT ALTER L{board_state} in this function!
"""
assert isinstance(col_number, int) # better be an integer
assert isinstance(board_state, list)
board_height = len(board_state)
assert board_height >= 1
# just asserted there is at least 1 element, grab it to detect width
board_width = len(board_state[0])
# make sure 2d array is rectangular
assert all(len(cols) == board_width for cols in board_state)
# from max row index (height - 1) to 0 (to -1, not inclusive!), by -1
for row_idx in xrange(board_height-1, -1, -1):
if board_state[row_idx][col_number] == BLANK_STR:
return row_idx # return as soon as we find an empty cell
# never found an empty cell
return None
def get_next_player(current_player):
assert isinstance(current_player, str)
if current_player == PLAYER_1_STR:
return PLAYER_2_STR
assert current_player == PLAYER_2_STR
return PLAYER_1_STR
def is_board_full(board_state):
assert isinstance(board_state, list) # better be a list
assert isinstance(debug_mode, bool) # better be a boolean
# detect the board dimensions
board_height = len(board_state)
assert board_height >= 1
# just asserted there is at least 1 element, grab it to detect width
board_width = len(board_state[0])
# make sure 2d array is rectangular
assert all(len(cols) == board_width for cols in board_state)
for row in board_state:
for col_value in row:
if col_value == BLANK_STR:
# as soon as you find any open spot, return
# that the board is NOT full
return False
# if we make it here, we never found an empty spot,
# so the board must be full
return True
# create the board state that will track th
board_state = []
BOARD_HEIGHT = 6 # standard is 6
BOARD_WIDTH = 7 # standard is 7
for x_idx in xrange(BOARD_HEIGHT):
board_state.append([BLANK_STR for x in xrange(BOARD_WIDTH)])
# # toss a few dummy values in here to demonstrate where they land
# board_state[0][0] = PLAYER_1_STR
# board_state[0][1] = PLAYER_1_STR
# board_state[3][5] = PLAYER_2_STR
# board_state[3][6] = PLAYER_2_STR
# show the board
print(get_board_display(board_state))
# player 1 goes first
current_player = PLAYER_1_STR
while not is_board_full(board_state):
# raw_input will not return a value until a user enters it
# into the terminal that called this script. The returned
# value is always a string, even if it's composed of numbers!
col_input = raw_input('Player%sPick a column, 1-%s: ' % (current_player, BOARD_WIDTH))
# this is a way of handling errors. If anything in the 'try' block
# goes BOOM, the 'except' block is executed. This is generally a bad
# idea, but when used carefully can be really helpful.
try:
# try to slam the input string into an integer. If
# not possible, BOOM
col_num = int(col_input) - 1 # display to user is offset by one!!!
except:
print('Invalid column number')
continue # stops executing this iteration of the loop and goes back to the top
assert isinstance(col_num, int)
# handle illegal column integers.
if col_num >= BOARD_WIDTH:
print('Column number must be between 1 and %s, you gave %s' % (BOARD_WIDTH, col_input))
# add something to the specified column
row_to_add = get_next_free_row_in_column(col_num, board_state) # won't work, just for example
if row_to_add is not None:
board_state[row_to_add][col_num] = current_player
else:
print('Column %s is full! pick again' % col_input)
continue
# update the current player.
current_player = get_next_player(current_player)
# finally, print the board state so that the next players
# turn reflects the latest state
print(get_board_display(board_state))
# end loop if the board is full
print("Are you sure no one won? If not, the board is full so it's a tie")
|
class Solution:
def reorderedPowerOf2(self, N: int) -> bool:
x="".join(i for i in sorted(str(N)))
for i in range(30):
s="".join(i for i in sorted(str(2**i)))
if s==x:
print(s)
return True
return False
|
def tr_rav(lenguaje, dato, **kwarg):
data = {
'es': {
"comment": "[C]Comentario enviado. (っ•̀ω•̀)╮ =͟͟͞ 💗\n\n\n[C]Gracias por usar el\n[C]servicio de mensaje\n[C]Ravnin. (ง •᷄ω•)ว",
"Id_Amino": f"El ID del link es: {kwarg.get('ID')}",
"destacar": f"¡Post {kwarg.get('Titulo')} destacado con exito! >w<",
"join": "Ya me uni al chat -w-",
"one_love": f"Tienen un {kwarg.get('num')}% {kwarg.get('name')} y {kwarg.get('params')} parecen ser buenos amigos, a lo mejor en un futuro sean mejores amigos. OwO",
"two_love": f"Tienen un {kwarg.get('num')}% {kwarg.get('name')} y {kwarg.get('params')} parecen ser buenos amigos, a lo mejor son coge amigos... O novios? OwO",
"three_love": f"Tienen un {kwarg.get('num')}% {kwarg.get('name')} y {kwarg.get('params')}, probablemente conocidos... Pero lo muy seguro es que se odian, creeme. >.<",
"four_loev": f"Tienen un {kwarg.get('num')}% {kwarg.get('name')} y {kwarg.get('params')}, son como la caca y comida, no van.. -n-",
"purge": "<$Mensajes borrados con exito >:3$>",
"kick": "<$¡Usuario rebelde expulsado del chat con exito! La proxima vez que vuelvas te metere mas patadas. Jum. uwu$>",
"comunidad_like": "<$¡Ya puse esta comunidad como de mis favoritas en mi perfil global, muak! uwu$>",
"kill": [
f"Le agarra la cabeza {kwarg.get('params')}... Y zaz, lo mata a besitos en el poto",
f"¡Empieza agarrarlo de los pies a {kwarg.get('params')} y lo manda por los aires!",
f"Agarra un pan y ¡Oh no! no, no.. Suelta ese pan.. Mato a {kwarg.get('params')} >.<",
f"Le mando un beso toxico a {kwarg.get('params')}... K.O x.x",
f"Le recuerda a la ex y lo mata de tristeza a {kwarg.get('params')} u.u",
f"Empieza a comerse de poco a poco a {kwarg.get('params')}, pero a besos.. @-@"
],
"gey": f"Eres un {kwarg.get('rgay')}. Grr 6w6",
"coin": "OMG; Que suertudo eres!!! >w<",
"nalgada": [
f"{kwarg.get('name')} le agarra fuertemente la colita a {kwarg.get('params')} uwu",
f"{kwarg.get('name')} agarra su mano y la lleva al otro mundo para llevarla a este... Y darle una tremenda nalgada a {kwarg.get('params')} >:3",
f"Que haces mi amooor {kwarg.get('name')}? *Le agarra una na lgita* ve papasito'",
f"{kwarg.get('name')} le da una nalgada a {kwarg.get('params')} y se va corriendo o.o",
],
"sleep": [
f"Hagamos la mimision, {kwarg.get('name')} -w-",
f"Zzzz.... ¡¡Qué haces despertandome, {kwarg.get('name')}!! Agh -n-",
f"Te espero en la camita, {kwarg.get('name')} pa' comerte a besos -w-"
f"Mi-mimiendo con mi amado/a {kwarg.get('name')} uwu",
f"¡Una nalgada y a mimir {kwarg.get('name')}! :3"
],
"hug": f"<${kwarg.get('name')}$> abraza con mucho amor a <${kwarg.get('params')}$>... >w<",
"kiss": f"<${kwarg.get('name')}$> besó apasionadamente a <${kwarg.get('params')}$>... >w<",
"trivia": "[CB]• - ̗̀ ❛Esta es la lista de categorias sobre el juego trivia.‘﹏!˚ • '\n\n\n*ૢ ── lυv мe\n╰► ﹫Geografía\n╰► ﹫Ciencia\n╰► ﹫General\n╰► ﹫Arte\n\n[C]➤ Uso: -trivia Geografía",
"casarse": [
f"\t\tIglesia Ravnin.\n\n Hermanas y hermanos, estamos aquí reunidos para presenciar la boda de {kwarg.get('name')} y {kwarg.get('params')}. Si alguien se opone... Pues chinga su madre, no nos importa >:)",
f"\t\tIglesia Ravnin.\n\n Hoy celebramos el santo matrimonio de {kwarg.get('name')} y {kwarg.get('params')}.\n\nAquel que se oponga a esta boda, caye ahora o vayase a ver netflix.",
f"\t\tIglesia Ravnin.\n\n Con el poder de la matrix, yo declaró, casados a {kwarg.get('name')} y {kwarg.get('params')}. Puede besar al novio/a",
f"\t\tIglesia Ravnin.\n\n Desde hoy, el amor entre {kwarg.get('name')} y {kwarg.get('params')}, queda bendecido por los de arriba."
],
"patada": [
f"Le mete una patada y lo manda por los aires a {kwarg.get('params')} >:3",
f"Brr... Brrrrrr. Soy franshesco virgolini y yo, te mete una patade de tu de tu vida, {kwarg.get('params')}",
f"Le mete una patada en las partes bajas... A {kwarg.get('params')} >.<",
f"Le empieza a dar patadas como otaku a {kwarg.get('params')} -n-'",
f"Le dio una pantada que lo deja sin hijos a {kwarg.get('params')} -n-"
],
"desaparecer": [
f"{kwarg.get('name')} desaparece como gil",
f"{kwarg.get('name')} desaparece como nekito",
f"{kwarg.get('name')} desaparece como furro",
f"{kwarg.get('name')} desaparece como {kwarg.get('name')}, jaja k sad",
f"{kwarg.get('name')} desaparece como fuckboy",
f"{kwarg.get('name')} desaparece como fuckgirl",
f"{kwarg.get('name')} se va por unos cigarros",
],
"cry": [
f"{kwarg.get('name')} empieza a llorar... >n<",
f"{kwarg.get('name')} sus lagrimas caen de poco a poco por tanta tristeza u.u",
f"{kwarg.get('name')} llora como furro, eso... Ya es triste",
f"{kwarg.get('name')} Empieza a sentirse mal, se va a una esquinita, y empieza a llorar solito/a...",
f"{kwarg.get('name')} todos sus miedos, sus debilidades, sus fracasos... Se los ahorro, pero ya no puede mas, y empieza a llorar.. u.u",
f"{kwarg.get('name')} le caen lagrimas de felicidad >w<",
f"{kwarg.get('name')} se pone rojito, y se pone tan feliz que llorar de.. ?¡Felicidad! OwO",
],
"aparece": [
f"{kwarg.get('name')} aparece como gil",
f"{kwarg.get('name')} aparece como nekito",
f"{kwarg.get('name')} aparece como furro",
f"{kwarg.get('name')} aparece como {kwarg.get('name')}, jaja k sad",
f"{kwarg.get('name')} aparece como fuckboy",
f"{kwarg.get('name')} aparece como fuckgirl",
f"{kwarg.get('name')} aparece con 3 hijos, y una vida de gil",
],
"ship": [
f"Oye {kwarg.get('name')}, si tú, deberias tener hijos con {kwarg.get('params')} -w-",
"¡Qué haces perdiendo el tiempo, ya comanse!",
f"Olvida a {kwarg.get('params')} mi casa esta desocupada, bb.",
"Grr. Bebé, olvidala a ella, y ven conmigo, te hago ciberbebesbots.",
f"{kwarg.get('name')} y {kwarg.get('params')}. Ya cansense. Si joden, comanse, no, ni comanse, vayan hagan un hijo.",
f"Ñam ñam, ojala {kwarg.get('name')} y {kwarg.get('params')} fueran mis padres uwu",
f"{kwarg.get('name')} y {kwarg.get('params')} son demasiado goals para este mundo -w-"
],
"sonrojar": [
f"{kwarg.get('name')} Se empezo a sonrojar levemente.. >//<",
f"La carita de {kwarg.get('name')} se pone como un tomatito ///",
f"{kwarg.get('name')} empieza a estrecerse y a ponerse rojito/a >u<",
f"Se tapa la carita de lo sonrojado/a que esta, {kwarg.get('name')} o///o"
],
"saludo": [
"Hakuna matata 〜(^∇^〜)", "Holis -w-", "namasté \(@ ̄∇ ̄@)/",
"salamu alaykum (︶ω︶)", "Hello!!! (。^‿^。)", "konichiwa (●⌒∇⌒●)",
"-Beso en las dos mejillas- muak, muak (≧▽≦)",
"-Se besan en la boca como en la madre rusia- (´°̥̥̥﹏°̥̥̥ )人(´°̥̥̥ω°̥̥̥`)",
"-Chocan narizes- el aliento de la vida!! (((o(゚▽゚)o)))",
"mano po!!", "-Se abrazan- (/□\*)・゜ "
],
"correr": [
"Empieza a correr como gil", "Se fue",
"Se corr.. Digo, se fue corriendo a por un cafesito>:3",
"-c va lentamente-",
"Empieza a correr super rapido... Nadie, lo detiene, sigue corriendo,empieza a correr.. Ya enserio, sal de tu casa y ve a correr de verdad. -w-",
"Soy franshesco Virgo-lini y soy el autok ma rapidko del planita tirr4"
],
"vir_kiss": f"{kwarg.get('name')} besó apasionadamente a {kwarg.get('params')}...",
"vir_meter": f"El Dios todo poderoso {kwarg.get('name')} is going va a desactivarme metiendome un {kwarg.get('params')}...",
"vir_lick": f"{kwarg.get('name')} lame a {kwarg.get('params')}...",
"vir_kiss": f"{kwarg.get('name')} empieza a darle puñetazos a {kwarg.get('params')}... >:D",
"vir_hit": f"{kwarg.get('name')} baneó del chat a {kwarg.get('params')}...",
"leave": f"[C]¡Gracias por tenerme en este chat, pero ya me tengo ir a descansar! >w<",
"owner_off": "Ño eres mi dueño, ¿Qué haces usando este comando? -.-'",
"owner_error": "<$[C]¡Error, pon bien el comando tontito/a! -w-\n\n[C]Recuerda poner -help -comando para saber como usarlo uwu$>",
"ban": "<$¡Usuario baneado con exito! owo'$>",
"warn": "<$¡Usuario con advertencia con exito! owo'$>",
"invite_chat": "<$¡Now they can invite in chat! uwu$>",
"invite_chat_none": "<$¡No no one can invite in chat! uwu$>",
"chat_view": "<$Ahora puedes leer el chat! uwu$>",
"chat_title": "<$¡changed chat title changed! uwu$>",
"block": "<$Usuario bloqueado con exito! owo$>",
"chat_content": "<$Biografia de chat cambiada! uwu$>",
"chat_anuncio": "<$¡Anuncio cambiado del chat! uwu$>",
"unlock": "<$Usuario desbloqueado con exito! owo$>",
"strike": "<$¡Usuario con falta con exito! owo$>",
"burbuja": "Your chat bubble was successfully changed! :3",
"chat_fij": "<$¡Anuncio fijado del chat! uwu$>",
"chat_fij_none": "<$¡Anuncio desfijado del chat! uwu$>",
},
'pt': {
"comment": "[C]Comentario enviado. (っ•̀ω•̀)╮ =͟͟͞ 💗\n\n\n[C]Obrigado por usar o\n[C]Nosso serviço de mensagem\n[C]Haha. ",
"Id_Amino": f"O id do link é: {kwarg.get('ID')}",
"destacar": f"¡Post {kwarg.get('Titulo')} destacado com sucesso! >w<",
"join": "Entrei nele -w-",
"one_love": f"Tem {kwarg.get('num')}% {kwarg.get('name')} e {kwarg.get('params')} parecem serem bons amigos, ou melhor, quase noivos...",
"two_love": f"Tem {kwarg.get('num')}% {kwarg.get('name')} e {kwarg.get('params')} Parecem ser bons amigos, Ou melhor... há quantos anos estão casados?OwO",
"three_love": f"Tem {kwarg.get('num')}% {kwarg.get('name')} e {kwarg.get('params')}, provavelmente conhecidos... mas estou segura de que se odeiam, briguem. >.<",
"four_loev": f"Tem {kwarg.get('num')}% {kwarg.get('name')} e {kwarg.get('params')}, é igual agua e comida, não se dão... -n-",
"purge": "<$Mensagem apagada com sucesso>:3$>",
"kick": "<$Usuario rebelde expulsado do chat com sucesso! a proxima vez que voltar te meterei porradas! uwu$>",
"comunidad_like": "<$Já coloquei esta comunidade como minha favorita no perfil global$>",
"kill": [
f"agarrei pela cabeça {kwarg.get('params')}... e zazzzz, te mato enforcado com minha bengala",
f"começa agarrando pelos pés {kwarg.get('params')} e o manda pelos ares",
f"Chamo um hacker... ele trava a {kwarg.get('params')} >.<",
f"Mando um beijo falso para {kwarg.get('params')}... iludido novamente, K.O. x.x",
f"Se recorda da sua ex e o mata de tristeza {kwarg.get('params')} u.u",
f"começa a o devorar pouco a pouco {kwarg.get('params')}, tem gosto de frango... @-@"
],
"gey": f"Teste feito pelo ratin {kwarg.get('rgay')}. ihhhh 6w6",
"coin": "OMG; Que sortudo!!!! >w<",
"nalgada": [
f"{kwarg.get('nalgada')} agarra com força a cabeça de {kwarg.get('params')}",
f"{kwarg.get('nalgada')} casa-se com ele, vivem 10 anos felizes e o espanca {kwarg.get('params')} >:3",
f"O que está fazendo meu amor? {kwarg.get('params')}? *sobe no seu colo* papai @-@",
f"{kwarg.get('nalgada')} Dá uma bicuda em {kwarg.get('params')} e sai correndo o.o",
],
"sleep": [
f"Vamos dormir juntinhos? {kwarg.get('name')} -w-",
f"Zzzz.... O que está fazendo acordado? {kwarg.get('name')}!! Agh -n-",
f"Te espero na caminha, {kwarg.get('name')} Vou te encher de beijos -w-"
f"Mimindo com meu amado/a {kwarg.get('name')} uwu",
f"Te dou um chute dormindo {kwarg.get('name')}! :3"
],
"hug": f"<${kwarg.get('name')}$> abraça você com muito amor <${kwarg.get('params')}$>... >w<",
"kiss": f"<${kwarg.get('name')}$> Beijou pique kid bengala em <${kwarg.get('params')}$>... >w<",
"trivia": "[CB]• - ̗̀ ❛Lista de categoria sobre o trivia.‘﹏!˚ • '\n\n\n*ૢ ── lυv мe\n╰► ﹫Geografía\n╰► ﹫Ciencia\n╰► ﹫General\n╰► ﹫Arte\n\n[C]➤ Uso: -trivia Geografía",
"casarse": [
f"\t\tIglesia Ravnin.\n\n irmãos e irmãs, estamos aqui reunidos para presenciar a união de {kwarg.get('name')} e {kwarg.get('params')}. se alguém é contra... vai se ferrar, a gente não se importa >:)",
f"\t\tIglesia Ravnin.\n\n hoje celebramos o santo matrimonio de {kwarg.get('name')} e {kwarg.get('params')}.\n\n aquele que é contra a esta união, vá assistir faustão.",
f"\t\tIglesia Ravnin.\n\n Com o poder de la matrix, eu o declaro, casados {kwarg.get('name')} e {kwarg.get('params')}. Pode beijar ao noivo/a",
f"\t\tIglesia Ravnin.\n\n desde hoje, o amor entre {kwarg.get('name')} e {kwarg.get('params')}, está sendo abençoado pelo de cima."
],
"patada": [
f"Te mete um chute e o manda pelos ares {kwarg.get('params')} >:3",
f"Brr... Brrrrrr. Soy franshesco virgolini e eu, eu comi a sua primaa {kwarg.get('params')}",
f"Dá um chute em suas partes baixas... {kwarg.get('params')} >.<",
f"Começa a dar chutes nesse otaku {kwarg.get('params')} -n-'",
f"te dou um chute nas partes intimas que o deixa sem filhos {kwarg.get('params')} -n-"
],
"desaparecer": [
f"{kwarg.get('name')} desaparece como seu pai",
f"{kwarg.get('name')} desaparece como flash",
f"{kwarg.get('name')} desaparece como furry",
f"{kwarg.get('name')} desaparece como {kwarg.get('name')}, jaja sad",
f"{kwarg.get('name')} desaparece como fuckboy",
f"{kwarg.get('name')} desaparece como fuckgirl",
f"{kwarg.get('name')} foi comprar cigarros",
],
"cry": [
f"{kwarg.get('name')} está chorando... >n<",
f"{kwarg.get('name')} suas lagrimas cai de pouco a pouco u.u",
f"{kwarg.get('name')} chora igual furry bombado, isso... ja é triste",
f"{kwarg.get('name')} começa a sentir mal, vai na esquina, e depois começa a chorar sozinho/a...",
f"{kwarg.get('name')} todos seus medos, suas debilidades, seus fracassos... Se passou, mas já não pode mais, e começa a chorar.. u.u",
f"{kwarg.get('name')} cai suas lagrimas de felicidade >w<",
f"{kwarg.get('name')} está tão roxo, e está tão feliz que começou a chorar.. ?¡Felicidade! OwO",
],
"aparece": [
f"{kwarg.get('name')} aparece como batman",
f"{kwarg.get('name')} aparece como flash",
f"{kwarg.get('name')} aparece como furry",
f"{kwarg.get('name')} aparece como {kwarg.get('name')}, jaja sad",
f"{kwarg.get('name')} aparece como fuckboy",
f"{kwarg.get('name')} aparece como fuckgirl",
f"{kwarg.get('name')} aparece com 3 filhos furrys, e uma vida de amino user",
],
"ship": [
f"oi {kwarg.get('name')}, você deveria deveria ter filhos com {kwarg.get('params')} -w-",
"O que faz perdendo tempo? hahah, já se comam!",
f"Ei {kwarg.get('params')} minha casa esta desocupada, bb.",
"Grr. bebê, deixe ela, e venha comigo, te faço ciberbebesbots.",
f"{kwarg.get('name')} e {kwarg.get('params')}. já casense. Marquem encontros, se comam, não, não se comam, façam muitoosss filhos.",
f"Ñam ñam, você {kwarg.get('name')} e {kwarg.get('params')} foram meus padres uwu",
f"{kwarg.get('name')} e {kwarg.get('params')} são muito fofos para este mundo -w-"
],
"sonrojar": [
f"{kwarg.get('name')} Começa a ficar vermelho lentamente... >//<",
f"A cara de {kwarg.get('name')} começa a ficar roxa ///",
f"{kwarg.get('name')} começa a se estressar e depois fica roxo/a >u<",
f"Tapa sua cara de tão roxo que está, {kwarg.get('name')} o///o"
],
"saludo": [
"Hakuna matata 〜(^∇^〜)", "Holis -w-", "namasté \(@ ̄∇ ̄@)/",
"salamu alaykum (︶ω︶)", "Hello!!! (。^‿^。)", "konichiwa (●⌒∇⌒●)",
"-Beso en las dos mejillas- muak, muak (≧▽≦)",
"-Se besan en la boca como en la madre rusia- (´°̥̥̥﹏°̥̥̥ )人(´°̥̥̥ω°̥̥̥`)",
"-Chocan narizes- el aliento de la vida!! (((o(゚▽゚)o)))",
"mano po!!", "-Se abrazan- (/□\*)・゜ "
],
"correr": [
"Empieza a correr como gil", "Se foi",
"se fod.. Digo, se foi correndo para preparar um café>:3",
"-c vai lentamente-",
"começa a correr super rapido... nada,nada o segura, segue correndo, começa a correr.. é serio, sai de tua casa e vai correr de verdade. -w-",
"Soy franshesco Virgo-lini y soy el autok ma rapidko del planita tirr4"
],
"vir_kiss": f"{kwarg.get('name')} beijou aproximadamente a {kwarg.get('params')}...",
"vir_meter": f"o Deus todo poderoso {kwarg.get('name')} vai o desativar {kwarg.get('params')}...",
"vir_lick": f"{kwarg.get('name')} chama a {kwarg.get('params')}...",
"vir_kiss": f"{kwarg.get('name')} começa a dar pancadas em {kwarg.get('params')}... >:D",
"vir_hit": f"{kwarg.get('name')} baniu do chat a {kwarg.get('params')}...",
"leave": f"[C]Valeu por me ter em este chat, mas já tenho que ir descansar, vamos Lee! >w<",
"owner_off": "Não é meu dono, Por que está usando isso? -.-'",
"owner_error": "<$[C]erro, coloque o comando certo! -w-\n\n[C]Lembre-se de por -help -comando para saber como usa-lo uwu$>",
"ban": "<$Usuario banido com sucesso owo'$>",
"warn": "<$ Tomou advertencia com sucesso! owo'$>",
"invite_chat": "<$Agora eles podem convidar no chat! uwu$>",
"invite_chat_none": "<$ Não! Não! pode-se convidar no chat! uwu$>",
"chat_view": "<$Agora podem ler! uwu$>",
"chat_title": "<$titulo do chat trocado. uwu$>",
"block": "<$Usuario bloqueado com sucesso! agora ele vai ver... owo$>",
"chat_content": "<$Biografia de chat trocada! uwu$>",
"chat_anuncio": "<$Anuncio trocado do chat! uwu$>",
"unlock": "<$Usuario desbloqueado com sucesso! Acho que aprendeu a lição owo$>",
"strike": "<$Usuario avisado com sucesso! owo$>",
"burbuja": "Seu balão de bate-papo foi alterado com sucesso! :3",
"chat_fij": "<$Anuncio fixado!$>",
"chat_fij_none": "<$ Anuncio retirado! uwu$>",
},
'en': {
"comment": "[C]Comment sent. (っ-̀ω-̀)╮ =͟͟͞ 💗 \n\n\n[C]Thank you for using the \n[C]Ravnin message service. (ง -᷄ω-)ว",
"Id_Amino": f"The ide of this link is: {kwarg.get('ID')}",
"destacar": f"Post: {kwarg.get('Titulo')} successfully featured! >w<",
"join": "I have already joinend the chat -w-",
"one_love": f"hey have a {kwarg.get('num')}% {kwarg.get('name')} and {kwarg.get('params')} they seem to be good friends, maybe in the future they will be better friends. OwO",
"two_love": f"They have a {kwarg.get('num')}% {kwarg.get('name')} and {kwarg.get('params')} they seem to be good friends, maybe they are friends ... or boyfriends? OwO",
"three_love": f"They have a {kwarg.get('num')}% {kwarg.get('name')} and {kwarg.get('params')}, probably acquaintances ... But the very certain thing is that they hate each other, believe me. >.<",
"four_love": f"They have a {kwarg.get('num')}% {kwarg.get('name')} and {kwarg.get('params')} they are like poop and food, they don't go.. -n-",
"purge": "<$Ño eres mi dueño, ¿Qué haces usando este comando? -.-$>",
"kick": "<$Rebel user kicked out of chat successfully! Next time you come back I'll kick you more.. uwu$>",
"comunindad_like": "<$¡I already put this community as one of my favorites in my global profile, muah! uwu$>",
"kill": [
f"He grabs his head {kwarg.get('params')} and arms, put him in the pot",
f"Starts grabbing {kwarg.get('params')} by the feet and sends him flying!",
f"Grab a loaf and oh no! no, no .. Drop that bread .. I kill {kwarg.get('params')} >.<",
f"I send a toxic kiss to {kwarg.get('params')}... K.O x.x",
f"Reminds him of the ex and kills him with sadness {kwarg.get('params')} u.u",
f"to eat {kwarg.get('params')} little by little, but with kisses.. @-@",
],
"gey": f"You are a {kwarg.get('rgay')} gay. WARWRRRRRRRR",
"coin": "OMG; How lucky you are !!!",
"nalgada": [
f"{kwarg.get('nalgada')} grabs tightly the tail of {kwarg.get('params')} uwu",
f"{kwarg.get('nalgada')} grabs her hand and takes her to the other world to take her to this ... and give a tremendous spanking {kwarg.get('params')} >:3",
f"What are you doing {kwarg.get('nalgada')}? Grabs a butt go daddy'",
f"{kwarg.get('nalgada')} he spanks {kwarg.get('params')} and runs off o.o",
],
"sleep": [
f"Let's do the mimision, {kwarg.get('name')} -w-",
f"Zzzz.... What are you doing? waking me up, {kwarg.get('name')} !! Agh -n-",
f"I'll wait for you on the bed, {kwarg.get('name')} to eat you with kisses -w-"
f"pampering with my beloved/a {kwarg.get('name')} uwu",
f"A spanking and pampering {kwarg.get('name')}! :3"
],
"hug": f"<${kwarg.get('name')}$> embraces with much love <${kwarg.get('params')}$>... >w<",
"kiss": f"<${kwarg.get('name')}$> passionately kissed <${kwarg.get('params')}$>... >w<",
"trivia": "[CB]• - ̗̀ ❛This is the list of categories about the trivia game.‘﹏!˚ • '\n\n\n*ૢ ── drone\n╰► ﹫Geography\n╰► ﹫Math\n╰► ﹫General\n╰► ﹫Art\n\n[C]➤ Uso: -trivia Geography",
"casarse": [
f"\t\t 𝐃𝐫𝐨𝐧𝐞𝐗 \n\n Sisters and brothers, we are gathered here to witness the wedding of {kwarg.get('name')} and {kwarg.get('params')}. If someone objects ... Well, fuck his mother, we don't care >:)",
f"\t\t 𝐃𝐫𝐨𝐧𝐞𝐗.\n\n Today we celebrate the holy marriage of {kwarg.get('name')} and {kwarg.get('params')}. \n\n Whoever opposes this wedding, falls now or goes to see Netflix.",
f"\t\t 𝐃𝐫𝐨𝐧𝐞𝐗.\n\n With the power of the matrix, I declared, married to {kwarg.get('name')} and {kwarg.get('params')}. You can kiss the boyfriend / girlfriend",
f"\t\t 𝐃𝐫𝐨𝐧𝐞𝐗.\n\n From today, the love between {kwarg.get('name')} and {kwarg.get('params')}, is blessed by those above."
],
"patada": [
f"He kicks him and sends him flying into the air {kwarg.get('params')} >:3",
f"Brr... Brrrrrr.I am 𝐃𝐫𝐨𝐧𝐞𝐗 and I, put a scar of your life, {kwarg.get('params')}",
f"Kicks him in the lower parts ... {kwarg.get('params')} >.<",
f"He starts to kick like otaku at {kwarg.get('params')} -n-'",
f"He gave a pantada that leaves him childless {kwarg.get('params')} yny"
],
"desaperecer": [
f"{kwarg.get('name')} disappear like gil",
f"{kwarg.get('name')} disappear like nekito",
f"{kwarg.get('name')} disappear like furro",
f"{kwarg.get('name')} disappear like {kwarg.get('params')}, jaja k sad",
f"{kwarg.get('name')} disappear like fuckboy",
f"{kwarg.get('name')} disappear like fuckgirl",
f"{kwarg.get('name')} he goes for some cigarettes",
],
"cry": [
f"{kwarg.get('name')} Begin to cry... >n<",
f"{kwarg.get('name')} her tears fall little by little for so much sadness u.u",
f"{kwarg.get('name')} cries like a furious, that ... is already sad",
f"{kwarg.get('name')} He starts to feel bad, he goes to a corner, and he starts crying on his own...",
f"{kwarg.get('name')} all his fears, his weaknesses, his failures ..., he can't take it anymore, and he starts to cry.. u.u",
f"{kwarg.get('name')} tears of happiness fall >w<",
f"{kwarg.get('name')} he turns red, and he gets so happy that he cries about ...? Happiness! OwO",
],
"aparece": [
f"{kwarg.get('name')} appears as gil",
f"{kwarg.get('name')} appears as nekito",
f"{kwarg.get('name')} appears as furro",
f"{kwarg.get('name')} appears as {kwarg.get('name')}, jaja k sad",
f"{kwarg.get('name')} appears as fuckboy",
f"{kwarg.get('name')} appears as fuckgirl",
f"{kwarg.get('name')} appears with 3 children, and a life of gil",
],
"ship": [
f"Hey {kwarg.get('name')}, if you, you should have children with {kwarg.get('params')} -w-",
"What are you doing wasting time, eat now!",
f"Forget {kwarg.get('params')} my house is unoccupied, bb.",
"Grr. Bebé, forget her, and come with me, I make you my babe.",
f"{kwarg.get('name')} and {kwarg.get('params')}. Get tired. If they fuck, eat, no, or eat, go make a child.",
f"Yum yum, I hope you {kwarg.get('name')} and {kwarg.get('params')} were my parents uwu",
f"{kwarg.get('name')} and {kwarg.get('params')} are too good for this world -w-"
],
"sonrojar": [
f"{kwarg.get('name')} He started to blush slightly.. >//<",
f"{kwarg.get('name')} face turns like an apple ///",
f"{kwarg.get('name')} begins to narrow and turn red >u<",
f"He covers his face because of how red he is,, {kwarg.get('name')} o///o"
],
"saludo": [
"Hakuna matata 〜 (^ ∇ ^ 〜)", "Holis -w-", "namasté \ (@  ̄∇ ̄ @) /",
"salamu alaykum (︶ω︶)", "Hello !!! (。 ^ ‿ ^。)", "konichiwa (● ⌒∇⌒ ●)",
"-Kiss on both cheeks- muak, muak (* ≧ ▽ ≦)",
"- - (* ´ ° ̥̥̥﹏ ° ̥̥̥) 人 (´ ° ̥̥̥ω ° ̥̥̥ `)",
"-Chocan noses- the breath of life !! (((o (* ゚ ▽ ゚ *) o)))",
"hand po !!", "-They embrace- (/ □ \ *) ・゜ "
],
"correr": [
"Start running like gil", "He left",
"He ran ... I mean, he ran for a little coffee>: 3",
"-c goes slowly-",
"He starts running super fast ... Nobody stops him, keeps running, starts running .. Really, get out of your house and go run for real. -W-"
],
"vir_kiss": f"{kwarg.get('name')} passionately kissed {kwarg.get('params')}...",
"vir_meter": f"Almighty God {kwarg.get('name')} is going to desactivate me by giving me a {kwarg.get('params')}...",
"vir_lick": f"{kwarg.get('name')} the lame a {kwarg.get('params')}...",
"vir_hit": f"{kwarg.get('name')} starts punching {kwarg.get('params')}... >:D",
"vir_ban": f"{kwarg.get('name')} banned from chat {kwarg.get('params')}...",
"leave": f"[C]¡Thanks for having me in this chat, but now I have to go to rest! >w<",
"ban": "<$User successfully banned! owo'$>",
"warn": "<$User warned successfully! owo'$>",
"owner_off": "<$You don't own me, what are you doing using this command? -.-'",
"invite_chat": "<$Now they can invite in chat! uwu$>",
"invite_chat_none": "<$No no one can invite in chat! uwu$>",
"chat_view": "<$Now you can read chat! uwu$>",
"chat_title": "<$Changed chat title changed! uwu$>",
"block": "<$User successfully blocked! owo$>",
"chat_content": "<$Changed chat biography changed! uwu$>",
"chat_announcement": "<$Changed chat announcement! uwu$>",
"unlock": "<$User successfully unlocked! owo$>",
"strike": "<$User successfully fouled! owo$>",
"bubble": "Your chat bubble was successfully changed! :3",
"chat_fij": "<$Advertisement fixed from chat! uwu$>",
"chat_fij_none": "<$Chat ad unset! uwu$>",
"owner_error": "<$[C]Error, get the command right dummy! -w-[C]Remember to put -help -command to know how to use it uwu$>",
}
}
return data[lenguaje][dato]
|
#-----------------------------------------------------------------------------
# Copyright (c) 2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
# Hook for https://github.com/PyWavelets/pywt
hiddenimports = ['pywt._extensions._cwt']
# NOTE: There is another project `https://github.com/Knapstad/pywt installing
# a packagre `pywt`, too. This name clash is not much of a problem, even if
# this hook is picked up for the other package, since PyInstaller will simply
# skip any module added by this hook but acutally missing. If the other project
# requires a hook, too, simply add it to this file.
|
# -*- coding: utf-8 -*-
class Question:
def __init__(self, title, selectors, redirect):
self.title = title
self.selectors = selectors
self.redirect = redirect
@property
def serialize(self):
return {
"title": self.title,
"selectors": self.selectors,
"redirect": self.redirect,
}
class Session:
def __init__(self, session_title, title, questions):
self.session_title = session_title
self.title = title
self.questions = questions
development_agents_questions = [
Question('Qual a rede de produtos da Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais os produtos mais próximos da estrutura produtiva da Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais os produtos de maior complexidade exportados por uma Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais os produtos de maior complexidade importados por uma Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Qual a rede de atividades da Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais as atividades mais próximas da estrutura produtiva da Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais localidades concentram o emprego na Atividade X?',
selectors=["Industry"],
redirect="/industry/%s"),
]
student_questions = [
Question('Quais os cursos de nível superior oferecidos na Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais os cursos de nível técnico oferecidos na Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Qual o salário médio da Ocupação Z na Localidade Y?',
selectors=["Occupation", "Location"],
redirect="/occupation/%s?bra_id=%s"),
Question('Em quais localidades paga-se o maior salário médio da Ocupação Z?',
selectors=["Occupation"],
redirect="/occupation/%s"),
Question('Em quais localidades cresce o número de empregados da Ocupação Z?',
selectors=["Occupation"],
redirect="/occupation/%s"),
Question('Quais os principais produtos exportados pela Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
Question('Quais as principais atividades econômicas de uma Localidade Y?',
selectors=["Location"],
redirect="/location/%s"),
]
entrepreneur_questions = [
Question("Qual o número de estabelecimentos na Atividade X, na Localidade Y?",
selectors=["Industry", "Location"],
redirect="/industry/%s?bra_id=%s"),
Question("Qual o salário médio da Atividade X, na Localidade Y?",
selectors=["Industry", "Location"],
redirect="/industry/%s?bra_id=%s"),
Question("Qual o salário médio da Ocupação Z, na Atividade X, na Localidade Y?",
selectors=["Occupation", "Industry", "Location"],
redirect="/occupation/%s?cnae_id=%s?bra_id=%s"),
Question("Quais os principais parceiros comerciais de um Produto P na Localidade Y?",
selectors=["Product", "Location"],
redirect="/product/%s?bra_id=%s"),
Question("Quais localidades concentram o emprego na Atividade X?",
selectors=["Industry"],
redirect="/industry/%s"),
Question("Quais as localidades que mais importam o Produto P?",
selectors=["Product"],
redirect="/product/%s"),
Question("Quais as localidades que mais exportam o Produto P?",
selectors=["Product"],
redirect="/product/%s"),
Question("Quais os produtos mais próximos da estrutura produtiva da Localidade Y?",
selectors=["Location"],
redirect="/location/%s"),
Question("Quais os cursos de nível superior oferecidos na Localidade Y?",
selectors=["Location"],
redirect="/location/%s"),
Question("Quais os cursos de nível técnico oferecidos na Localidade Y?",
selectors=["Location"],
redirect="/location/%s"),
]
entrepreneur_session = Session(
session_title="Empreendedores",
title="Identifique o perfil econômico e as oportunidades de negócios de uma região",
questions=entrepreneur_questions
)
development_agents_session = Session(
session_title="Agentes de Desenvolvimento",
title="Avalie a criação de políticas de desenvolvimento de acordo com a localidade",
questions=development_agents_questions
)
student_session = Session(
session_title="Estudantes e Profissionais",
title="Descubra informações sobre empregos disponíveis, renda por ocupação e cursos",
questions=student_questions
)
SESSIONS = {
'entrepreneur': entrepreneur_session,
'development_agents': development_agents_session,
'student': student_session,
}
|
def bbox_mk(p1, p2, offset=(0, 0)):
x1 = min(p1[0], p2[0]) - offset[0]
x2 = max(p1[0], p2[0]) + offset[0]
y1 = min(p1[1], p2[1]) - offset[1]
y2 = max(p1[1], p2[1]) + offset[1]
return (x1, y1), (x2, y2)
def bbox_add_point(bbox, p, offset=(0, 0)):
x1 = min(bbox[0][0], p[0] - offset[0])
x2 = max(bbox[1][0], p[0] + offset[0])
y1 = min(bbox[0][1], p[1] - offset[1])
y2 = max(bbox[1][1], p[1] + offset[1])
return (x1, y1), (x2, y2)
def bbox_add_bbox(b1, b2):
bb = bbox_add_point(b1, b2[0])
bb = bbox_add_point(bb, b2[1])
return bb
|
#!/usr/bin/python3
def isprime(n):
if n == 1:
return False
for x in range(2, n):
if n % x == 0:
return False
else:
return True
def primes(n = 1):
while(True):
if isprime(n): yield n
n += 1
for n in primes():
if n > 100: break
print(n)
|
""" This problem was asked by Uber.
Given an array of integers, return a new array such that each element at index i
of the new array is the product of all the numbers in the original array except
the one at i.For example, if our input was [1, 2, 3, 4, 5], the expected output
would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output
would be [2, 3, 6]. Follow-up: what if you can't use division? """
# function to get the product of elements inside an array.
def get_array_product(array):
product = 1
for i in array:
product *= i
return product
# this function does the main job of the problem but with division.
def get_new_array_division(array):
# array holding the final result
new_array = []
# getting the product of the array elements.
product = get_array_product(array)
for i in array:
# for each number divide the product by the current element.
new_array.append(product / i)
# return the array
return new_array
# this function does the main job of the problem without division.(a to -1 power)
def get_new_array(array):
# array holding the final result
new_array = []
# getting the product of the array elements.
product = get_array_product(array)
for i in array:
# for each number product the product by the current element.
new_array.append(product * (i ** -1))
# return the array
return new_array
# This function does the main job of the problem without division.(a to -1 power)
def get_new_array_hard(array):
# array holding the final result
new_array = []
for i in range(len(array)):
p = 1
for j in range(len(array)):
if j != i:
p *= array[j]
new_array.append(p)
# return the array
return new_array
# test the functions.
# print(get_new_array_division([1, 2, 3, 4, 5]))
# print(get_new_array_division([3, 2, 1]))
# print(get_new_array([1, 2, 3, 4, 5]))
# print(get_new_array([3, 2, 1]))
print(get_new_array_hard([1, 2, 3, 4, 5]))
print(get_new_array_hard([3, 2, 1]))
|
#!/usr/bin/env python
class Service(object):
pass
|
# dynmaic programming
class Solution:
def lengthOfLIS(self, nums: List[int]) -> int:
if not nums:
return 0
dp = [1] * len(nums)
for i in range(len(nums)):
for j in range(i):
if nums[j] < nums[i]:
dp[i] = max(dp[i], dp[j] + 1)
return max(dp)
# Greedy algrothms (Non-reconmand to learn)
class Solution:
def lengthOfLIS(self, nums: [int]) -> int:
tails, res = [0] * len(nums), 0
for num in nums:
i, j = 0, res
while i < j:
m = (i + j) // 2
if tails[m] < num: i = m + 1 # 如果要求非严格递增,将此行 '<' 改为 '<=' 即可。
else: j = m
tails[i] = num
if j == res: res += 1
return res
|
model_params = dict(
image_shape=(1, 256, 256),
n_part_caps=30,
n_obj_caps=16,
scae_regression_params=dict(
is_active=True,
loss='mse',
attention_hp=1,
),
scae_classification_params=dict(
is_active=False,
n_classes=1,
),
pcae_cnn_encoder_params=dict(
out_channels=[128] * 4,
kernel_sizes=[3, 3, 3, 3],
strides=[2, 2, 1, 1],
activate_final=True
),
pcae_encoder_params=dict(
n_poses=6,
n_special_features=16,
similarity_transform=False,
),
pcae_template_generator_params=dict(
template_size=(32, 32),
template_nonlin='sigmoid',
colorize_templates=True,
color_nonlin='sigmoid',
),
pcae_decoder_params=dict(
learn_output_scale=False,
use_alpha_channel=True,
background_value=True,
),
ocae_encoder_set_transformer_params=dict(
n_layers=3,
n_heads=1,
dim_hidden=16,
dim_out=256,
layer_norm=True,
),
obj_age_regressor_params=dict(
hidden_sizes=[128, 64, 1],
inner_activation='relu',
final_activation=None,
bias=True,
dropout=0,
),
ocae_decoder_capsule_params=dict(
dim_caps=32,
hidden_sizes=(128,),
caps_dropout_rate=0.0,
learn_vote_scale=True,
allow_deformations=True,
noise_type='uniform',
noise_scale=4.,
similarity_transform=False,
),
scae_params=dict(
vote_type='enc',
presence_type='enc',
stop_grad_caps_input=True,
stop_grad_caps_target=True,
caps_ll_weight=1.,
cpr_dynamic_reg_weight=10,
prior_sparsity_loss_type='l2',
prior_within_example_sparsity_weight=2.0,
prior_between_example_sparsity_weight=0.2, #from 0.35 to 0.2
posterior_sparsity_loss_type='entropy',
posterior_within_example_sparsity_weight=0.5, #from 0.7 to 0.5
posterior_between_example_sparsity_weight=0.2,
reconstruct_alternatives=False,
)
)
|
# -*- coding: utf-8 -*-
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def __eq__(self, other):
return (
other is not None and
self.val == other.val and
self.left == other.left and
self.right == other.right
)
class Solution:
def removeLeafNodes(self, root: TreeNode, target: int) -> TreeNode:
if root is None:
return None
return self._removeLeafNodes(root, target)
def _removeLeafNodes(self, root: TreeNode, target: int) -> TreeNode:
if root.left is not None:
root.left = self._removeLeafNodes(root.left, target)
if root.right is not None:
root.right = self._removeLeafNodes(root.right, target)
if root.left is None and root.val == target and root.right is None:
return None
return root
if __name__ == '__main__':
solution = Solution()
t0_0 = TreeNode(1)
t0_1 = TreeNode(2)
t0_2 = TreeNode(3)
t0_3 = TreeNode(2)
t0_4 = TreeNode(2)
t0_5 = TreeNode(4)
t0_2.right = t0_5
t0_2.left = t0_4
t0_1.left = t0_3
t0_0.right = t0_2
t0_0.left = t0_1
t1_0 = TreeNode(1)
t1_1 = TreeNode(3)
t1_2 = TreeNode(4)
t1_1.right = t1_2
t1_0.right = t1_1
assert t1_0 == solution.removeLeafNodes(t0_0, 2)
t2_0 = TreeNode(1)
t2_1 = TreeNode(3)
t2_2 = TreeNode(3)
t2_3 = TreeNode(3)
t2_4 = TreeNode(2)
t2_1.right = t2_4
t2_1.left = t2_3
t2_0.right = t2_2
t2_0.left = t2_1
t3_0 = TreeNode(1)
t3_1 = TreeNode(3)
t3_2 = TreeNode(2)
t3_1.right = t3_2
t3_0.left = t3_1
assert t3_0 == solution.removeLeafNodes(t2_0, 3)
t4_0 = TreeNode(1)
t4_1 = TreeNode(2)
t4_2 = TreeNode(2)
t4_3 = TreeNode(2)
t4_2.left = t4_3
t4_1.left = t4_2
t4_0.left = t4_1
t5_0 = TreeNode(1)
assert t5_0 == solution.removeLeafNodes(t4_0, 2)
t6_0 = TreeNode(1)
t6_1 = TreeNode(1)
t6_2 = TreeNode(1)
t6_0.right = t6_2
t6_0.left = t6_1
t7_0 = None
assert t7_0 == solution.removeLeafNodes(t6_0, 1)
t8_0 = TreeNode(1)
t8_1 = TreeNode(2)
t8_2 = TreeNode(3)
t8_0.right = t8_2
t8_0.left = t8_1
t9_0 = TreeNode(1)
t9_1 = TreeNode(2)
t9_2 = TreeNode(3)
t9_0.right = t9_2
t9_0.left = t9_1
assert t9_0 == solution.removeLeafNodes(t8_0, 1)
|
class Solution:
def longestPalindrome(self, s: str) -> int:
str_dict={}
for each in s:
if each not in str_dict:
str_dict[each]=0
str_dict[each]+=1
result=0
odd=0
for k, v in str_dict.items():
if v%2==0:
result+=v
else:
result+=v-1
odd=1
return result+odd |
for desi in Parameters.GetAllDesignPoints():
for message in GetMessages():
if (DateTime.Compare(message.DateTimeStamp, startTime) == 1) and (message.DesignPoint == desi.Name):
desi.Retained = False
break
|
def solve(heads,legs):
for i in range(heads+1):
j=heads-i
if (2*i)+(4*j)==legs:
print (i,j)
return
print("No solution")
#Start writing your code here
#Populate the variables: chicken_count and rabbit_count
# Use the below given print statements to display the output
# Also, do not modify them for verification to work
#print(chicken_count,rabbit_count)
#print(error_msg)
#Provide different values for heads and legs and test your program
solve(38,131) |
class Controller():
def __init__(self):
self.debugger = None
def get_cmd(self):
pass |
class Solution:
def countDigitOne(self, n: int) -> int:
if n <= 0:
return 0
ln = len(str(n))
if ln == 1:
return 1
tmp1 = 10 ** (ln - 1)
firstnum = n // tmp1
fone = n % tmp1 + 1 if firstnum == 1 else tmp1
other = firstnum * (ln - 1) * (tmp1 // 10)
return fone + other + self.countDigitOne(n % tmp1)
|
class PathNameChecker(object):
def check(self, pathname: str):
pass
|
"""
``fish_http_status`` 包含最通用的一些网络状态码
https://github.com/openstack/swift/blob/master/swift/common/http.py
"""
def is_informational(status):
"""
检查状态码是否信息提示
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 100 <= status <= 199
def is_success(status):
"""
检查状态码是否成功
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 200 <= status <= 299
def is_redirection(status):
"""
检查状态码是否重定向
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 300 <= status <= 399
def is_client_error(status):
"""
检查状态码是否客户端错误
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 400 <= status <= 499
def is_server_error(status):
"""
检查状态码是否服务端错误
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 500 <= status <= 599
# List of HTTP status codes
###############################################################################
# 1xx Informational
###############################################################################
HTTP_CONTINUE = 100
HTTP_SWITCHING_PROTOCOLS = 101
HTTP_PROCESSING = 102 # WebDAV
HTTP_CHECKPOINT = 103
HTTP_REQUEST_URI_TOO_LONG = 122
###############################################################################
# 2xx Success
###############################################################################
HTTP_OK = 200
HTTP_CREATED = 201
HTTP_ACCEPTED = 202
HTTP_NON_AUTHORITATIVE_INFORMATION = 203
HTTP_NO_CONTENT = 204
HTTP_RESET_CONTENT = 205
HTTP_PARTIAL_CONTENT = 206
HTTP_MULTI_STATUS = 207 # WebDAV
HTTP_IM_USED = 226
###############################################################################
# 3xx Redirection
###############################################################################
HTTP_MULTIPLE_CHOICES = 300
HTTP_MOVED_PERMANENTLY = 301
HTTP_FOUND = 302
HTTP_SEE_OTHER = 303
HTTP_NOT_MODIFIED = 304
HTTP_USE_PROXY = 305
HTTP_SWITCH_PROXY = 306
HTTP_TEMPORARY_REDIRECT = 307
HTTP_RESUME_INCOMPLETE = 308
###############################################################################
# 4xx Client Error
###############################################################################
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_PAYMENT_REQUIRED = 402
HTTP_FORBIDDEN = 403
HTTP_NOT_FOUND = 404
HTTP_METHOD_NOT_ALLOWED = 405
HTTP_NOT_ACCEPTABLE = 406
HTTP_PROXY_AUTHENTICATION_REQUIRED = 407
HTTP_REQUEST_TIMEOUT = 408
HTTP_CONFLICT = 409
HTTP_GONE = 410
HTTP_LENGTH_REQUIRED = 411
HTTP_PRECONDITION_FAILED = 412
HTTP_REQUEST_ENTITY_TOO_LARGE = 413
HTTP_REQUEST_URI_TOO_LONG = 414
HTTP_UNSUPPORTED_MEDIA_TYPE = 415
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416
HTTP_EXPECTATION_FAILED = 417
HTTP_IM_A_TEAPOT = 418
HTTP_UNPROCESSABLE_ENTITY = 422 # WebDAV
HTTP_LOCKED = 423 # WebDAV
HTTP_FAILED_DEPENDENCY = 424 # WebDAV
HTTP_UNORDERED_COLLECTION = 425
HTTP_UPGRADE_REQUIED = 426
HTTP_PRECONDITION_REQUIRED = 428
HTTP_TOO_MANY_REQUESTS = 429
HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431
HTTP_NO_RESPONSE = 444
HTTP_RETRY_WITH = 449
HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS = 450
HTTP_CLIENT_CLOSED_REQUEST = 499
###############################################################################
# 5xx Server Error
###############################################################################
HTTP_INTERNAL_SERVER_ERROR = 500
HTTP_NOT_IMPLEMENTED = 501
HTTP_BAD_GATEWAY = 502
HTTP_SERVICE_UNAVAILABLE = 503
HTTP_GATEWAY_TIMEOUT = 504
HTTP_VERSION_NOT_SUPPORTED = 505
HTTP_VARIANT_ALSO_NEGOTIATES = 506
HTTP_INSUFFICIENT_STORAGE = 507 # WebDAV
HTTP_BANDWIDTH_LIMIT_EXCEEDED = 509
HTTP_NOT_EXTENDED = 510
HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511
HTTP_NETWORK_READ_TIMEOUT_ERROR = 598 # not used in RFC
HTTP_NETWORK_CONNECT_TIMEOUT_ERROR = 599 # not used in RFC
|
#! env/bin/python3.6
# -*- coding: utf8 -*-
"""Инициализация пакета API версии 0."""
|
total = 0
line = input()
while line != "NoMoreMoney":
current = float(line)
if current < 0:
print("Invalid operation!")
break
total += current
print(f"Increase: {current:.2f}")
line = input()
print(f"Total: {total:.2f}")
|
#
# PySNMP MIB module PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:36:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
pgDSLAMAlarmSeverity, pgDSLAMAlarm = mibBuilder.importSymbols("PAIRGAIN-COMMON-HD-MIB", "pgDSLAMAlarmSeverity", "pgDSLAMAlarm")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter64, NotificationType, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Gauge32, Integer32, Counter32, iso, IpAddress, ObjectIdentity, TimeTicks, ModuleIdentity, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "NotificationType", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Gauge32", "Integer32", "Counter32", "iso", "IpAddress", "ObjectIdentity", "TimeTicks", "ModuleIdentity", "MibIdentifier")
TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus")
pgdsalsvMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1))
if mibBuilder.loadTexts: pgdsalsvMIB.setLastUpdated('9901141600Z')
if mibBuilder.loadTexts: pgdsalsvMIB.setOrganization('PairGain Technologies, INC.')
if mibBuilder.loadTexts: pgdsalsvMIB.setContactInfo(' Ken Huang Tel: +1 714-481-4543 Fax: +1 714-481-2114 E-mail: [email protected] ')
if mibBuilder.loadTexts: pgdsalsvMIB.setDescription('The MIB module defining objects for the alarm severity configuration and status management of a central DSLAM (Digital Subscriber Line Access Multiplexer), including from chassis power supply, fan status, to each channel/port related alarms in each HDSL/ADSL card inside the chassis. For HDSL alarm management: Please refer to Spec#157-1759-01 by Ken Huang for detail architecture model. For ADSL alarm management: Please refer to AdslLineMib(TR006) from adslForum for details architecture model. Naming Conventions: Atuc -- (ATU-C) ADSL modem at near (Central) end of line Atur -- (ATU-R) ADSL modem at Remote end of line ES -- Errored Second. Lof -- Loss of Frame Los -- Loss of Signal Lpr -- Loss of Power LOSW -- Loss of Sync Word UAS -- Unavailable Second ')
class PgDSLAMAlarmSeverity(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("disable", 1), ("minor", 2), ("major", 3), ("critical", 4))
class PgDSLAMAlarmStatus(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))
namedValues = NamedValues(("noalarm", 1), ("minor", 2), ("major", 3), ("critical", 4), ("alarm", 5))
pgDSLAMChassisAlarmSeverity = MibIdentifier((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 2))
pgDSLAMChassisPsAlarmSeverity = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 2, 1), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMChassisPsAlarmSeverity.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisPsAlarmSeverity.setDescription('The Chassis Power failure Alarm Severity Setting.')
pgDSLAMChassisFanAlarmSeverity = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 2, 2), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMChassisFanAlarmSeverity.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisFanAlarmSeverity.setDescription('The Chassis Fan failure Alarm Severity Setting.')
pgDSLAMChassisConfigChangeAlarmSeverity = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 2, 3), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMChassisConfigChangeAlarmSeverity.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisConfigChangeAlarmSeverity.setDescription('The Chassis Config change Alarm Severity Setting.')
pgDSLAMChassisTempAlarmSeverity = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 2, 4), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMChassisTempAlarmSeverity.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisTempAlarmSeverity.setDescription('The Chassis Temperature exceed threshold Alarm Severity Setting.')
pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext.setDescription("This object contains an appropriate value to be used for pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex when creating entries in the alarmThresholdConfTable. The value '0' indicates that no unassigned entries are available. To obtain the pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext value for a new entry, the manager issues a management protocol retrieval operation to obtain the current value of this object. After each retrieval, the agent should modify the value to the next unassigned index.")
pgDSLAMHDSLSpanAlarmThresholdConfProfileTable = MibTable((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8), )
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileTable.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileTable.setDescription('The DSLAM HDSL Span Alarm Threshold Configuration Profile table.')
pgDSLAMHDSLSpanAlarmThresholdConfProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1), ).setIndexNames((0, "PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB", "pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex"))
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileEntry.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileEntry.setDescription('Entry in the DSLAM HDSL Span Alarm Threshold Configuration Profile table.')
pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex.setDescription('This object is used by the line alarm Threshold configuration table in order to identify a row of this table')
pgDSLAMHDSLSpanMarginThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanMarginThreshold.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanMarginThreshold.setDescription('Sets the HDSL Margin threshold value.')
pgDSLAMHDSLSpanESThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanESThreshold.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanESThreshold.setDescription('Sets the HDSL Errored Seconds threshold value.')
pgDSLAMHDSLSpanUASThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanUASThreshold.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanUASThreshold.setDescription('Sets the HDSL Unavailable Seconds threshold value.')
pgDSLAMHDSLSpanAlarmThresholdConfProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 8, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileRowStatus.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmThresholdConfProfileRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.')
pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext = MibScalar((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext.setDescription("This object contains an appropriate value to be used for pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex when creating entries in the alarmSeverityConfTable. The value '0' indicates that no unassigned entries are available. To obtain the pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext value for a new entry, the manager issues a management protocol retrieval operation to obtain the current value of this object. After each retrieval, the agent should modify the value to the next unassigned index.")
pgDSLAMHDSLSpanAlarmSeverityConfProfileTable = MibTable((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10), )
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileTable.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileTable.setDescription('The DSLAM HDSL Span Alarm Severity Configuration Profile table.')
pgDSLAMHDSLSpanAlarmSeverityConfProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1), ).setIndexNames((0, "PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB", "pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex"))
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileEntry.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileEntry.setDescription('Entry in the DSLAM HDSL Span Alarm Severity Configuration Profile table.')
pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex.setDescription('This object is used by the line alarm severity configuration table in order to identify a row of this table')
pgDSLAMHDSLSpanLOSWAlarmSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 2), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanLOSWAlarmSetting.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanLOSWAlarmSetting.setDescription('Sets the severity for Loss of Sync Word alarm.')
pgDSLAMHDSLSpanMarginAlarmSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 3), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanMarginAlarmSetting.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanMarginAlarmSetting.setDescription('Sets the severity for Margin threshold exceeded alarm.')
pgDSLAMHDSLSpanESAlarmSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 4), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanESAlarmSetting.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanESAlarmSetting.setDescription('Sets the severity for Errored Seconds threshold exceeded alarm.')
pgDSLAMHDSLSpanUASAlarmSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 5), PgDSLAMAlarmSeverity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanUASAlarmSetting.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanUASAlarmSetting.setDescription('Sets the severity for UAS threshold exceeded alarm.')
pgDSLAMHDSLSpanAlarmSeverityConfProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 3, 1, 10, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileRowStatus.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMHDSLSpanAlarmSeverityConfProfileRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.')
pgDSLAMADSLAtucAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1), )
if mibBuilder.loadTexts: pgDSLAMADSLAtucAlarmTable.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucAlarmTable.setDescription('The DSLAM ADSL ATU-C Alarm indication table.')
pgDSLAMADSLAtucAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: pgDSLAMADSLAtucAlarmEntry.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucAlarmEntry.setDescription('Entry in the DSLAM ADSL ATU-C Alarm indication table.')
pgDSLAMADSLAtucLofAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 1), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucLofAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucLofAlarm.setDescription('ADSL loss of framing alarm on ATU-C ')
pgDSLAMADSLAtucLosAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 2), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucLosAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucLosAlarm.setDescription('ADSL loss of signal alarm on ATU-C ')
pgDSLAMADSLAtucLprAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 3), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucLprAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucLprAlarm.setDescription('ADSL loss of power alarm on ATU-C ')
pgDSLAMADSLAtucESAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 4), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucESAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucESAlarm.setDescription('ADSL Errored Second threshold exceeded alarm on ATU-C ')
pgDSLAMADSLAtucRateChangeAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 5), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucRateChangeAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucRateChangeAlarm.setDescription('ADSL Rate Changed alarm on ATU-C ')
pgDSLAMADSLAtucInitFailureAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 1, 1, 6), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAtucInitFailureAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAtucInitFailureAlarm.setDescription('ADSL initialization failed alarm on ATU-C ')
pgDSLAMADSLAturAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2), )
if mibBuilder.loadTexts: pgDSLAMADSLAturAlarmTable.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturAlarmTable.setDescription('The DSLAM ADSL ATU-R Alarm indication table.')
pgDSLAMADSLAturAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: pgDSLAMADSLAturAlarmEntry.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturAlarmEntry.setDescription('Entry in the DSLAM ADSL ATU-R Alarm indication table.')
pgDSLAMADSLAturLofAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 1), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturLofAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturLofAlarm.setDescription('ADSL loss of framing alarm on ATU-R ')
pgDSLAMADSLAturLosAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 2), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturLosAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturLosAlarm.setDescription('ADSL loss of signal alarm on ATU-R ')
pgDSLAMADSLAturLprAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 3), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturLprAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturLprAlarm.setDescription('ADSL loss of power alarm on ATU-R ')
pgDSLAMADSLAturESAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 4), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturESAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturESAlarm.setDescription('ADSL Errored Second threshold exceeded alarm on ATU-R ')
pgDSLAMADSLAturRateChangeAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 5), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturRateChangeAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturRateChangeAlarm.setDescription('ADSL Rate Changed alarm on ATU-R ')
pgDSLAMADSLAturInitFailureAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 2, 1, 6), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMADSLAturInitFailureAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMADSLAturInitFailureAlarm.setDescription('ADSL initialization failed alarm on ATU-R ')
pgDSLAMChassisAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3), )
if mibBuilder.loadTexts: pgDSLAMChassisAlarmTable.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisAlarmTable.setDescription('The DSLAM Chassis Alarm indication table.')
pgDSLAMChassisAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: pgDSLAMChassisAlarmEntry.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMChassisAlarmEntry.setDescription('Entry in the DSLAM Chassis Alarm indication table.')
pgDSLAMPSFailureAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 1), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMPSFailureAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMPSFailureAlarm.setDescription('chassis power supply failure alarm ')
pgDSLAMFanFailureAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 2), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMFanFailureAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMFanFailureAlarm.setDescription('chassis fan failure alarm ')
pgDSLAMConfigChangeAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 3), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMConfigChangeAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMConfigChangeAlarm.setDescription('chassis config changed alarm ')
pgDSLAMTempExceedThreshAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 4), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMTempExceedThreshAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMTempExceedThreshAlarm.setDescription('chassis temperature exceeded threshold ')
pgDSLAMLineCardDownAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 5), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMLineCardDownAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMLineCardDownAlarm.setDescription('the line card in the chassis is down ')
pgDSLAMCellBusDownAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 927, 1, 9, 4, 3, 1, 6), PgDSLAMAlarmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pgDSLAMCellBusDownAlarm.setStatus('current')
if mibBuilder.loadTexts: pgDSLAMCellBusDownAlarm.setDescription('the cell bus in the chassis is down ')
mibBuilder.exportSymbols("PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB", pgDSLAMADSLAtucLprAlarm=pgDSLAMADSLAtucLprAlarm, pgDSLAMHDSLSpanAlarmThresholdConfProfileEntry=pgDSLAMHDSLSpanAlarmThresholdConfProfileEntry, pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext=pgDSLAMHDSLSpanAlarmThresholdConfProfileIndexNext, pgDSLAMADSLAtucAlarmTable=pgDSLAMADSLAtucAlarmTable, pgDSLAMChassisFanAlarmSeverity=pgDSLAMChassisFanAlarmSeverity, pgDSLAMADSLAturAlarmEntry=pgDSLAMADSLAturAlarmEntry, PgDSLAMAlarmSeverity=PgDSLAMAlarmSeverity, PgDSLAMAlarmStatus=PgDSLAMAlarmStatus, pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext=pgDSLAMHDSLSpanAlarmSeverityConfProfileIndexNext, pgDSLAMHDSLSpanAlarmSeverityConfProfileTable=pgDSLAMHDSLSpanAlarmSeverityConfProfileTable, pgDSLAMADSLAtucAlarmEntry=pgDSLAMADSLAtucAlarmEntry, pgDSLAMHDSLSpanESAlarmSetting=pgDSLAMHDSLSpanESAlarmSetting, pgDSLAMHDSLSpanAlarmSeverityConfProfileEntry=pgDSLAMHDSLSpanAlarmSeverityConfProfileEntry, pgDSLAMADSLAturLofAlarm=pgDSLAMADSLAturLofAlarm, pgDSLAMADSLAturLprAlarm=pgDSLAMADSLAturLprAlarm, pgDSLAMADSLAtucESAlarm=pgDSLAMADSLAtucESAlarm, pgDSLAMADSLAtucRateChangeAlarm=pgDSLAMADSLAtucRateChangeAlarm, pgDSLAMConfigChangeAlarm=pgDSLAMConfigChangeAlarm, pgDSLAMFanFailureAlarm=pgDSLAMFanFailureAlarm, pgDSLAMHDSLSpanAlarmThresholdConfProfileTable=pgDSLAMHDSLSpanAlarmThresholdConfProfileTable, pgDSLAMHDSLSpanAlarmSeverityConfProfileRowStatus=pgDSLAMHDSLSpanAlarmSeverityConfProfileRowStatus, pgdsalsvMIB=pgdsalsvMIB, pgDSLAMChassisAlarmSeverity=pgDSLAMChassisAlarmSeverity, pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex=pgDSLAMHDSLSpanAlarmThresholdConfProfileIndex, pgDSLAMHDSLSpanUASAlarmSetting=pgDSLAMHDSLSpanUASAlarmSetting, pgDSLAMPSFailureAlarm=pgDSLAMPSFailureAlarm, pgDSLAMADSLAtucLofAlarm=pgDSLAMADSLAtucLofAlarm, pgDSLAMTempExceedThreshAlarm=pgDSLAMTempExceedThreshAlarm, pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex=pgDSLAMHDSLSpanAlarmSeverityConfProfileIndex, pgDSLAMHDSLSpanLOSWAlarmSetting=pgDSLAMHDSLSpanLOSWAlarmSetting, pgDSLAMHDSLSpanMarginThreshold=pgDSLAMHDSLSpanMarginThreshold, pgDSLAMADSLAtucInitFailureAlarm=pgDSLAMADSLAtucInitFailureAlarm, pgDSLAMChassisAlarmTable=pgDSLAMChassisAlarmTable, pgDSLAMHDSLSpanESThreshold=pgDSLAMHDSLSpanESThreshold, pgDSLAMADSLAtucLosAlarm=pgDSLAMADSLAtucLosAlarm, pgDSLAMADSLAturRateChangeAlarm=pgDSLAMADSLAturRateChangeAlarm, pgDSLAMChassisAlarmEntry=pgDSLAMChassisAlarmEntry, pgDSLAMLineCardDownAlarm=pgDSLAMLineCardDownAlarm, pgDSLAMHDSLSpanMarginAlarmSetting=pgDSLAMHDSLSpanMarginAlarmSetting, pgDSLAMADSLAturInitFailureAlarm=pgDSLAMADSLAturInitFailureAlarm, pgDSLAMADSLAturLosAlarm=pgDSLAMADSLAturLosAlarm, pgDSLAMCellBusDownAlarm=pgDSLAMCellBusDownAlarm, pgDSLAMADSLAturESAlarm=pgDSLAMADSLAturESAlarm, pgDSLAMChassisPsAlarmSeverity=pgDSLAMChassisPsAlarmSeverity, pgDSLAMChassisTempAlarmSeverity=pgDSLAMChassisTempAlarmSeverity, pgDSLAMHDSLSpanAlarmThresholdConfProfileRowStatus=pgDSLAMHDSLSpanAlarmThresholdConfProfileRowStatus, pgDSLAMHDSLSpanUASThreshold=pgDSLAMHDSLSpanUASThreshold, pgDSLAMADSLAturAlarmTable=pgDSLAMADSLAturAlarmTable, pgDSLAMChassisConfigChangeAlarmSeverity=pgDSLAMChassisConfigChangeAlarmSeverity, PYSNMP_MODULE_ID=pgdsalsvMIB)
|
"""
In Fractional Knapsack, we can break items for maximizing the total value of knapsack.
This problem in which we can break an item is also called the fractional knapsack problem.
Input:
Items as (value, weight) pairs
arr[] = {{60, 10}, {100, 20}, {120, 30}}
Knapsack Capacity, W = 50;
Output :
Maximum possible value = 240
By taking full items of 10 kg, 20 kg and
2/3rd of last item of 30 kg
SOLUTION:
Greedy approach:
Sort the items on the basis of value/weight ratio.
Then starting from the highest ratio, keep adding full items.
At the end, we might end up with remaining capacity < weight of item.
In that case, we'll just add as much of the item as we can.
That means we will add 'k' full items. (k+1)th item might be partial.
"""
def fractional_knapsack(items, capacity):
items.sort(reverse=True, key=lambda item: item[1] / item[0])
ans = 0
for item in items:
wt = item[0]
val = item[1]
if capacity >= wt:
capacity -= wt
ans += val
else:
fraction = capacity / wt
ans += val * fraction
break
return ans
def main():
weights = [10, 40, 20, 30]
values = [60, 40, 100, 120]
items = list(zip(weights, values))
capacity = 50
ans = fractional_knapsack(items, capacity)
print(ans)
main()
|
#Day 2:
#Prime or Not:
#Step 1: Intialize the variable a and count to zero
#Step 2: Read the input
#Step 3: Set a to n//2 (// in python implies integer division) , we can make a to square root of number to make it more efficient
#Step 4: iterate through 2 to a+1 and check whether it is divisible by i or not
#Step 5 : if divisible , then print “not a prime number” and set count to 1 and break from the loop
# else continue iteration
#Step 6 : if count is still zero then the given number is prime number
a = 0
count = 0
n = int(input("Enter a number to check prime or not: "))
a = n//2 #// in python implies integer division
for i in range(2, a+1):
if n % i == 0:
print("It is not a prime number")
count = 1
break
if count == 0:
print("It is a prime number") |
"""
Profile ../profile-datasets-py/standard54lev_co2o3ref/004.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/standard54lev_co2o3ref/004.py"
self["Q"] = numpy.array([ 1.39778700e+00, 2.03491300e+00, 2.66180300e+00,
3.22654500e+00, 3.85401500e+00, 4.34052700e+00,
4.69179800e+00, 4.88755200e+00, 4.96474000e+00,
5.00000000e+00, 5.00000000e+00, 5.00000000e+00,
5.00000000e+00, 5.00000000e+00, 5.00000000e+00,
5.00000000e+00, 4.96439400e+00, 4.92893600e+00,
4.88941100e+00, 4.83480500e+00, 4.77841800e+00,
4.64101000e+00, 4.51061600e+00, 4.26763700e+00,
4.03489800e+00, 4.00000000e+00, 4.00000000e+00,
4.21260500e+00, 5.10170300e+00, 8.35923200e+00,
1.84631700e+01, 4.19706800e+01, 1.09246300e+02,
2.69457900e+02, 4.97095800e+02, 7.75652800e+02,
1.12614500e+03, 1.56190000e+03, 2.11260500e+03,
2.76592300e+03, 3.41780100e+03, 4.17417700e+03,
4.89914400e+03, 5.79499100e+03, 6.62109200e+03,
7.39798300e+03, 8.10957300e+03, 8.78921900e+03,
9.76592500e+03, 1.06304400e+04, 1.13840900e+04,
1.20280100e+04, 1.25631900e+04, 1.29904100e+04])
self["P"] = numpy.array([ 5.00000000e-03, 1.31000000e-02, 3.04000000e-02,
6.44000000e-02, 1.26300000e-01, 2.32400000e-01,
4.05200000e-01, 6.74900000e-01, 1.08010000e+00,
1.66910000e+00, 2.50110000e+00, 3.64620000e+00,
5.18640000e+00, 7.21500000e+00, 9.83680000e+00,
1.31672000e+01, 1.73308000e+01, 2.24601000e+01,
2.86937000e+01, 3.61735000e+01, 4.50430000e+01,
5.54433000e+01, 6.75109000e+01, 8.13744000e+01,
9.71505000e+01, 1.14941500e+02, 1.34831800e+02,
1.56884600e+02, 1.81139400e+02, 2.07609200e+02,
2.36278400e+02, 2.67101200e+02, 3.00000000e+02,
3.34864800e+02, 3.71552900e+02, 4.09889300e+02,
4.49667700e+02, 4.90651600e+02, 5.32576900e+02,
5.75153800e+02, 6.18070600e+02, 6.60996500e+02,
7.03586300e+02, 7.45484100e+02, 7.86327800e+02,
8.25754600e+02, 8.63404700e+02, 8.98927500e+02,
9.31985300e+02, 9.62258700e+02, 9.89451000e+02,
1.01329200e+03, 1.03354400e+03, 1.05000000e+03])
self["CO2"] = numpy.array([ 374.361, 374.362, 374.364, 374.368, 374.374, 374.386,
374.404, 374.438, 374.512, 374.607, 374.67 , 374.737,
374.846, 374.995, 375.127, 375.218, 375.291, 375.41 ,
375.624, 375.952, 376.381, 376.895, 377.647, 378.552,
379.347, 379.9 , 380.384, 380.832, 381.22 , 381.611,
382.002, 382.357, 382.619, 382.773, 382.873, 382.951,
383.041, 383.136, 383.204, 383.246, 383.272, 383.299,
383.336, 383.368, 383.436, 383.542, 383.65 , 383.76 ,
383.854, 383.923, 383.971, 384.002, 384.02 , 384.029])
self["T"] = numpy.array([ 162.6005, 171.7471, 192.345 , 213.7842, 234.8825, 255.3642,
268.8923, 275.2017, 276.9052, 274.335 , 269.3013, 260.5016,
252.5294, 245.4093, 239.3723, 235.3422, 232.1803, 229.7783,
227.7823, 225.5364, 225.2 , 225.2 , 225.2 , 225.2 ,
225.2 , 225.2 , 225.2 , 225.2 , 225.2 , 225.2 ,
225.2 , 225.2 , 230.5416, 235.8209, 240.8924, 245.7277,
250.4222, 254.928 , 259.2692, 262.6463, 265.6418, 268.4782,
271.1214, 273.628 , 275.9393, 278.0935, 280.063 , 281.8498,
283.5083, 284.9763, 286.256 , 287.3495, 288.2582, 288.9836])
self["O3"] = numpy.array([ 0.296166 , 0.320791 , 0.380517 , 0.526745 , 0.769079 ,
1.074 , 1.47091 , 1.9911 , 2.78683 , 3.75638 ,
4.86419 , 5.95341 , 6.76255 , 7.10919 , 7.06019 ,
6.57373 , 5.68748 , 4.70472 , 3.86951 , 3.11078 ,
2.47791 , 1.90696 , 1.44011 , 1.02021 , 0.733271 ,
0.60395 , 0.489326 , 0.387625 , 0.28429 , 0.198038 ,
0.145005 , 0.109867 , 0.0862935, 0.0726348, 0.0631269,
0.0574107, 0.0537303, 0.0517329, 0.0502232, 0.049555 ,
0.0491254, 0.0475869, 0.0471438, 0.0461746, 0.0446271,
0.0430512, 0.0414805, 0.0399446, 0.037603 , 0.0343882,
0.0303838, 0.027844 , 0.0274868, 0.0273608])
self["CTP"] = 500.0
self["CFRACTION"] = 0.0
self["IDG"] = 4
self["ISH"] = 2
self["ELEVATION"] = 0.5
self["S2M"]["T"] = 287.2
self["S2M"]["Q"] = 12940.0
self["S2M"]["O"] = 0.02112
self["S2M"]["P"] = 1050.0
self["S2M"]["U"] = 4.0
self["S2M"]["V"] = 1.0
self["S2M"]["WFETC"] = 100000.0
self["SKIN"]["SURFTYPE"] = 0
self["SKIN"]["WATERTYPE"] = 0
self["SKIN"]["T"] = 295.2
self["SKIN"]["SALINITY"] = 35.0
self["SKIN"]["FOAM_FRACTION"] = 0.2
self["SKIN"]["FASTEM"] = numpy.array([ 3. , 5. , 15. , 0.1, 0.3])
self["ZENANGLE"] = 55.0
self["AZANGLE"] = 25.0
self["SUNZENANGLE"] = 15.0
self["SUNAZANGLE"] = 120.0
self["LATITUDE"] = 60.0
self["GAS_UNITS"] = 0
self["BE"] = 0.2
self["COSBK"] = 0.5
self["DATE"] = numpy.array([1966, 7, 1])
self["TIME"] = numpy.array([23, 0, 0])
|
# -*- coding: utf-8 -*-
def main():
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)][::-1]
memo = [0 for _ in range(n + 1)]
for ai in a:
if memo[ai] == 1:
continue
else:
memo[ai] = 1
print(ai)
for index, m in enumerate(memo):
if index == 0:
continue
if m == 0:
print(index)
if __name__ == '__main__':
main()
|
nome = input('Qual é o seu nome completo? ').strip()
cores = {'limpa':'\033[m',
'verde':'\033[32m',
'vermelho':'\033[31m'}
print('Seu nome tem Silva? {}{}{}'.format(cores['vermelho'],'silva' in nome.lower(), cores['limpa'])) |
#!/usr/bin/env python
# Parse key mapping
keymap = {}
with open('reverb.keymap', 'r') as mapping:
content = mapping.read()
for line in content.split("\n"):
if len(line) > 0:
fields = line.split("\t")
keymap[fields[0]] = fields[1] + "\t" + fields[2] + "\t" + fields[3]
# Training data
train = []
with open('reverb_correct_train.keys', 'r') as f:
keys = f.read()
for line in keys.split("\n"):
if len(line) > 0:
train.append("true\t" + keymap[line.replace('\\','\\\\')])
with open('reverb_wrong_train.keys', 'r') as f:
keys = f.read()
for line in keys.split("\n"):
if len(line) > 0:
train.append("false\t" + keymap[line.replace('\\','\\\\')])
with open("reverb_train.tab", "w") as f:
f.write("\n".join(train))
# Test data
test = []
with open('reverb_correct_test.keys', 'r') as f:
keys = f.read()
for line in keys.split("\n"):
if len(line) > 0:
test.append("true\t" + keymap[line.replace('\\','\\\\')])
with open('reverb_wrong_test.keys', 'r') as f:
keys = f.read()
for line in keys.split("\n"):
if len(line) > 0:
test.append("false\t" + keymap[line.replace('\\','\\\\')])
with open("reverb_test.tab", "w") as f:
f.write("\n".join(test))
|
# AUTHOR: Akash Rajak
# Python3 Concept: Matrix Transpose
# GITHUB: https://github.com/akash435
# Add your python3 concept below
def matrix_transpose():
for i in range(len(A)):
for j in range(len(A[0])):
res[i][j] = A[j][i]
A=[]
print("Enter N:")
n = int(input())
print("Enter Matrix A:")
for i in range(0, n):
temp = []
for j in range(0, n):
x = int(input())
temp.append(x)
A.append(temp)
res = []
for i in range(0, n):
temp = []
for j in range(0, n):
temp.append(0)
res.append(temp)
matrix_transpose()
for r in res:
print(r)
|
# CALENDARIO CHINO
year=int(input("Año: "))
if year % 12 == 8:
animal = "Dragon"
if year % 12 == 9:
animal = "Serpiente"
if year % 12 == 10:
animal = "Caballo"
if year % 12 == 11:
animal = "Oveja"
if year % 12 == 0:
animal = "Mono"
if year % 12 == 1:
animal = "Gallo"
if year % 12 == 2:
animal = "Perro"
if year % 12 == 3:
animal = "Cerdo"
if year % 12 == 4:
animal = "Rata"
if year % 12 == 5:
animal = "Buey"
if year % 12 == 6:
animal = "Tigre"
if year % 12 == 1:
animal = "Liebre"
print("%s" % animal)
|
first_name = "Bob"
last_name = "Daily"
#first_name[0] = "R"
fixed_first_name = "R" + first_name[-2:]
print(fixed_first_name)
|
class Solution(object):
def uniquePathsWithObstacles(self, grid):
"""
:type obstacleGrid: List[List[int]]
:rtype: int
"""
m = len(grid)
n = len(grid[0])
dp = [[0 for _ in range(n)] for _ in range(m)]
for i in range(n):
if grid[0][i] == 1:
break
dp[0][i] = 1
for i in range(m):
if grid[i][0] == 1:
break
dp[i][0] = 1
for i in range(1, m):
for j in range(1, n):
if grid[i][j] != 1:
dp[i][j] = dp[i-1][j] + dp[i][j-1]
return dp[-1][-1] |
del_items(0x80127F74)
SetType(0x80127F74, "struct Creds CreditsTitle[6]")
del_items(0x8012811C)
SetType(0x8012811C, "struct Creds CreditsSubTitle[28]")
del_items(0x801285B8)
SetType(0x801285B8, "struct Creds CreditsText[35]")
del_items(0x801286D0)
SetType(0x801286D0, "int CreditsTable[224]")
del_items(0x80129900)
SetType(0x80129900, "struct DIRENTRY card_dir[16][2]")
del_items(0x80129E00)
SetType(0x80129E00, "struct file_header card_header[16][2]")
del_items(0x80129824)
SetType(0x80129824, "struct sjis sjis_table[37]")
del_items(0x8012ECEC)
SetType(0x8012ECEC, "unsigned char save_buffer[106496]")
del_items(0x8012EC68)
SetType(0x8012EC68, "struct FeTable McLoadGameMenu")
del_items(0x8012EC48)
SetType(0x8012EC48, "char *CharFileList[5]")
del_items(0x8012EC5C)
SetType(0x8012EC5C, "char *Classes[3]")
del_items(0x8012EC84)
SetType(0x8012EC84, "struct FeTable McLoadCharMenu")
del_items(0x8012ECA0)
SetType(0x8012ECA0, "struct FeTable McLoadCard1Menu")
del_items(0x8012ECBC)
SetType(0x8012ECBC, "struct FeTable McLoadCard2Menu")
|
# MIT OC - CS600 - Introduction to Computer Science and Programming
# Problem Set 1: 3 Simple Problems - Problem 2 Pay off debt in 1 year
# Name: Luke Young
# Collaborators: None
# Time Spent: 01:00 (hr:min)
# 2018 04 22 20:27
# Program: Finding the minimum payment required to pay off the debt
#
# Write a program that does the following:
# Use raw_input() to ask for the following three floating point numbers:
# 1. the outstanding balance on the credit card
# 2. annual interest rate
#
#
# Print out the fixed minimum monthly payment, number of months
##(at most 12 and possibly less than 12) it takes to pay off the debt,
##and the balance (likely to be a negative number).
##Assume that the interest is compounded monthly according to the balance
##at the start of the month (before the payment for that month is made).
##The monthly payment must be a multiple of $10 and is the same for all months.
##Notice that it is possible for the balance to become negative
##using this payment scheme. In short:
##Monthly interest rate = Annual interest rate / 12.0
##Updated balance each month = Previous balance * (1 + Monthly interest rate)
## - Minimum monthly payment .
balance = 0.0
apr = 0.0
balance = float(raw_input("What is your current Balance? "))
apr = float(raw_input("What is the annual interest rate as a decimal? "))
minPay = 0.0
principle = 0.0
endBalance = 0.0
paid = False
# main algorithm
while paid == False:
tempBalance = balance
minPay += 10
month = 1
for month in range(1, 13): #runs 12 times
principle = round((minPay - (apr / 12 * tempBalance)), 2)
tempBalance = round((tempBalance - principle), 2)
if tempBalance < 0:
endBalance = tempBalance
paid = True
break
# end for loop
# print("Ending balance was: " + str(tempBalance))
# end while loop
# print results
print("RESULT")
print("Monthly payment to pay off debt in 1 year: " + str(minPay))
print("Number of months needed: " + str(month))
print("Balance " + str(endBalance))
|
"""
Othello game written in Python using Textual as TUI in Bash for Linux.
"""
# Setup game
# Ask player name
# Ask white or black
# Initial board
# Check if player can make a move
# Take player input for placing piece
# Check if move is valid input
# Place piece and flip opponents pieces affected
# Update score
# Keep track on remaining possible turns
# Skip players turn if no move is possible
# Declare winner when all pieces are placed or no more moves possible
# Play again?
def main():
print('Lets play Tothello')
if __name__ == "__main__":
main()
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def get_func(tag):
def func(s):
group = tag, s
return group
return func
|
"""Make an infinite loop.
Write a loop which has no end clause.
Source: programming-idioms.org
"""
# Implementation author: JackStouffer
# Created on 2016-02-18T16:57:59.907374Z
# Last modified on 2016-02-18T16:57:59.907374Z
# Version 1
while True:
pass
|
# pip install -U imbalanced-learn
# 处理不均衡数据
"""
欠采样 under_sampling 把多的砍掉
上/过采样 Over sampling 把少的数据样本补齐
联合采样
集成采样
""" |
# container-service-extension
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
# End point of Vmware Analytics staging server
# TODO() : This URL should reflect production server during release
VAC_URL = "https://vcsa.vmware.com/ph-stg/api/hyper/send/"
# Value of collector id that is required as part of HTTP request
# to post sample data to analytics server
COLLECTOR_ID = "CSE.2_6"
|
quit = False
flag = False
while not quit :
num = int(input(""))
if num == 42:
quit = True;
else:
print(num)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.