<s> __author__ = """<STR_LIT>""" <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from os import getcwd <EOL> from os import sys <EOL> sys . path . append ( getcwd ( ) ) <EOL> from MOAL . helpers . display import Section <EOL> import inspect <EOL> import abc <EOL> class Life ( object ) : <EOL> """<STR_LIT>""" <EOL> class Domain ( Life ) : <EOL> def __init__ ( self ) : <EOL> super ( Domain , self ) . __init__ ( ) <EOL> class Kingdom ( Domain ) : <EOL> def __init__ ( self ) : <EOL> super ( Kingdom , self ) . __init__ ( ) <EOL> class Phylum ( Kingdom ) : <EOL> def __init__ ( self ) : <EOL> super ( Phylum , self ) . __init__ ( ) <EOL> class Class ( Phylum ) : <EOL> def __init__ ( self ) : <EOL> super ( Class , self ) . __init__ ( ) <EOL> class Order ( Class ) : <EOL> def __init__ ( self ) : <EOL> super ( Order , self ) . __init__ ( ) <EOL> class Family ( Order ) : <EOL> def __init__ ( self ) : <EOL> super ( Family , self ) . __init__ ( ) <EOL> class Genus ( Family ) : <EOL> def __init__ ( self ) : <EOL> super ( Genus , self ) . __init__ ( ) <EOL> class Species ( Genus ) : <EOL> def __init__ ( self ) : <EOL> super ( Species , self ) . __init__ ( ) <EOL> """<STR_LIT>""" <EOL> class AbstractCat ( Family ) : <EOL> __metaclass__ = abc . ABCMeta <EOL> @ abc . abstractmethod <EOL> def custom_abstractmethod ( self ) : <EOL> """<STR_LIT>""" <EOL> class AbstractCatTwo ( Family ) : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def custom_abstractmethod ( self ) : <EOL> raise NotImplementedError <EOL> class Cat ( AbstractCat ) : <EOL> def __init__ ( self , name ) : <EOL> self . name = name <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . name ) <EOL> def __hash__ ( self ) : <EOL> return len ( self . name ) <EOL> def custom_abstractmethod ( self ) : <EOL> return '<STR_LIT>' <EOL> @ staticmethod <EOL> def custom_staticmethod ( ) : <EOL> return '<STR_LIT>' <EOL> @ classmethod <EOL> def custom_classmethod ( cls ) : <EOL> return '<STR_LIT>' <EOL> @ classmethod <EOL> def meow ( cls ) : <EOL> return '<STR_LIT>' <EOL> class CatTwo ( AbstractCatTwo ) : <EOL> pass <EOL> """<STR_LIT>""" <EOL> class HouseCat ( Cat ) : <EOL> def __init__ ( self , name ) : <EOL> super ( HouseCat , self ) . __init__ ( name ) <EOL> class InernetHouseCats ( HouseCat ) : <EOL> pass <EOL> class Maru ( InernetHouseCats ) : <EOL> def box_attack ( self ) : <EOL> pass <EOL> class Grumpy ( InernetHouseCats ) : <EOL> def frown ( self ) : <EOL> pass <EOL> class ColonelMeow ( InernetHouseCats ) : <EOL> def attack ( self ) : <EOL> pass <EOL> """<STR_LIT>""" <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> with Section ( '<STR_LIT>' ) : <EOL> print ( '<STR_LIT:\n>' ) <EOL> print ( Cat . meow ( ) ) <EOL> print ( Cat . custom_classmethod ( ) ) <EOL> print ( Cat . custom_classmethod ) <EOL> print ( '<STR_LIT:\n>' ) <EOL> """<STR_LIT>""" <EOL> classes = '<STR_LIT>' . join ( [ c . __name__ for c in inspect . getmro ( Species ) ] ) <EOL> print ( '<STR_LIT>' . format ( <EOL> Species , classes ) ) <EOL> leopard = Cat ( '<STR_LIT>' ) <EOL> print ( repr ( leopard ) ) <EOL> calico = HouseCat ( '<STR_LIT>' ) <EOL> print ( calico . meow ( ) ) <EOL> print ( repr ( calico ) ) <EOL> print ( '<STR_LIT>' . format ( Cat . custom_classmethod ( ) ) ) <EOL> print ( Cat . custom_classmethod ) <EOL> print ( '<STR_LIT>' . format ( Cat . custom_staticmethod ( ) ) ) <EOL> print ( Cat . custom_staticmethod ) <EOL> print ( '<STR_LIT>' . format ( leopard . custom_staticmethod ( ) ) ) <EOL> print ( '<STR_LIT>' . format ( <EOL> leopard , calico , ( hash ( leopard ) == hash ( calico ) ) ) ) <EOL> print ( '<STR_LIT:\n>' ) <EOL> abstract_leopard = CatTwo ( ) <EOL> try : <EOL> print ( abstract_leopard . custom_abstractmethod ) <EOL> abstract_leopard . custom_abstractmethod ( ) <EOL> except NotImplementedError : <EOL> print ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> print ( '<STR_LIT:\n>' ) </s>
