MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / level_from_cpm

Method level_from_cpm

pokemongo_bot/inventory.py:626–627  ·  view source on GitHub ↗
(cls, cp_multiplier)

Source from the content-addressed store, hash-verified

624
625 @classmethod
626 def level_from_cpm(cls, cp_multiplier):
627 return min(range(len(cls.STATIC_DATA)), key=lambda i: abs(cls.STATIC_DATA[i] - cp_multiplier)) * 0.5 + 1
628
629
630class _Attacks(_StaticInventoryComponent):

Callers 2

__init__Method · 0.80
test_levels_to_cpmMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_levels_to_cpmMethod · 0.64