<s> """<STR_LIT>""" <EOL> from abc import ABC , abstractmethod <EOL> from inspect import getmembers , isfunction <EOL> class Tombola ( ABC ) : <EOL> @ abstractmethod <EOL> def __init__ ( self , iterable ) : <EOL> """<STR_LIT>""" <EOL> @ abstractmethod <EOL> def load ( self , iterable ) : <EOL> """<STR_LIT>""" <EOL> @ abstractmethod <EOL> def pick ( self ) : <EOL> """<STR_LIT>""" <EOL> def loaded ( self ) : <EOL> try : <EOL> item = self . pick ( ) <EOL> except LookupError : <EOL> return False <EOL> else : <EOL> self . load ( [ item ] ) <EOL> return True <EOL> @ classmethod <EOL> def __subclasshook__ ( cls , other_cls ) : <EOL> if cls is Tombola : <EOL> interface_names = function_names ( cls ) <EOL> found_names = set ( ) <EOL> for a_cls in other_cls . __mro__ : <EOL> found_names |= function_names ( a_cls ) <EOL> if found_names >= interface_names : <EOL> return True <EOL> return NotImplemented <EOL> def function_names ( obj ) : <EOL> return { name for name , _ in getmembers ( obj , isfunction ) } </s>
