<s> import itertools <EOL> from python_toolbox . logic_tools import logic_max <EOL> def test ( ) : <EOL> '''<STR_LIT>''' <EOL> assert logic_max ( list ( range ( <NUM_LIT:4> ) ) ) == [ <NUM_LIT:3> ] <EOL> assert logic_max ( set ( range ( <NUM_LIT:5> ) ) ) == [ <NUM_LIT:4> ] <EOL> assert logic_max ( iter ( list ( range ( <NUM_LIT:6> ) ) ) ) == [ <NUM_LIT:5> ] <EOL> assert logic_max ( tuple ( range ( <NUM_LIT:10> ) ) ) == [ <NUM_LIT:9> ] <EOL> class FunkyString : <EOL> def __init__ ( self , string ) : <EOL> self . string = string <EOL> def __ge__ ( self , other ) : <EOL> assert isinstance ( other , FunkyString ) <EOL> return other . string in self . string <EOL> def __eq__ ( self , other ) : <EOL> assert isinstance ( other , FunkyString ) <EOL> return other . string == self . string <EOL> assert logic_max ( <EOL> [ FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) ] <EOL> ) == [ FunkyString ( '<STR_LIT>' ) ] <EOL> assert logic_max ( <EOL> [ FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) ] <EOL> ) == [ ] <EOL> assert logic_max ( <EOL> [ FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) , <EOL> FunkyString ( '<STR_LIT>' ) ] <EOL> ) == [ FunkyString ( '<STR_LIT>' ) , FunkyString ( '<STR_LIT>' ) , ] <EOL> class FunkyInt : <EOL> def __init__ ( self , number ) : <EOL> self . number = number <EOL> def __ge__ ( self , other ) : <EOL> return ( <NUM_LIT:10> <= self . number <= <NUM_LIT:20> ) <EOL> def __eq__ ( self , other ) : <EOL> assert isinstance ( other , FunkyInt ) <EOL> return other . number == self . number <EOL> assert logic_max ( <EOL> [ FunkyInt ( <NUM_LIT:7> ) , <EOL> FunkyInt ( <NUM_LIT> ) , <EOL> FunkyInt ( <NUM_LIT:3> ) , <EOL> FunkyInt ( <NUM_LIT> ) , <EOL> FunkyInt ( <NUM_LIT> ) , ] <EOL> ) == [ FunkyInt ( <NUM_LIT> ) , FunkyInt ( <NUM_LIT> ) ] </s>
