def compatibility_mode():
 setattr(EventsCodes, 'ALL_EVENTS', ALL_EVENTS)
 for evname in globals():
  if evname.startswith('IN_'):
   setattr(EventsCodes, evname, globals()[evname])
 global COMPATIBILITY_MODE
 COMPATIBILITY_MODE = True

def compatibility_mode ( ) : setattr ( EventsCodes , 'ALL_EVENTS' , ALL_EVENTS ) for evname in globals ( ) : if evname . startswith ( 'IN_' ) : setattr ( EventsCodes , evname , globals ( ) [ evname ] ) global COMPATIBILITY_MODE COMPATIBILITY_MODE = True
use this function to turn on the compatibility mode .