def _assert_required_roles(cls, roles, methods):
 if (('appender' not in roles) or (not hasattr(cls, roles['appender']))):
  raise sa_exc.ArgumentError(('Type %s must elect an appender method to be a collection class' % cls.__name__))
 elif ((roles['appender'] not in methods) and (not hasattr(getattr(cls, roles['appender']), '_sa_instrumented'))):
  methods[roles['appender']] = ('fire_append_event', 1, None)
 if (('remover' not in roles) or (not hasattr(cls, roles['remover']))):
  raise sa_exc.ArgumentError(('Type %s must elect a remover method to be a collection class' % cls.__name__))
 elif ((roles['remover'] not in methods) and (not hasattr(getattr(cls, roles['remover']), '_sa_instrumented'))):
  methods[roles['remover']] = ('fire_remove_event', 1, None)
 if (('iterator' not in roles) or (not hasattr(cls, roles['iterator']))):
  raise sa_exc.ArgumentError(('Type %s must elect an iterator method to be a collection class' % cls.__name__))

def _assert_required_roles ( cls , roles , methods ) : if ( ( 'appender' not in roles ) or ( not hasattr ( cls , roles [ 'appender' ] ) ) ) : raise sa_exc . ArgumentError ( ( 'Type %s must elect an appender method to be a collection class' % cls . __name__ ) ) elif ( ( roles [ 'appender' ] not in methods ) and ( not hasattr ( getattr ( cls , roles [ 'appender' ] ) , '_sa_instrumented' ) ) ) : methods [ roles [ 'appender' ] ] = ( 'fire_append_event' , 1 , None ) if ( ( 'remover' not in roles ) or ( not hasattr ( cls , roles [ 'remover' ] ) ) ) : raise sa_exc . ArgumentError ( ( 'Type %s must elect a remover method to be a collection class' % cls . __name__ ) ) elif ( ( roles [ 'remover' ] not in methods ) and ( not hasattr ( getattr ( cls , roles [ 'remover' ] ) , '_sa_instrumented' ) ) ) : methods [ roles [ 'remover' ] ] = ( 'fire_remove_event' , 1 , None ) if ( ( 'iterator' not in roles ) or ( not hasattr ( cls , roles [ 'iterator' ] ) ) ) : raise sa_exc . ArgumentError ( ( 'Type %s must elect an iterator method to be a collection class' % cls . __name__ ) )
ensure all roles are present .