def _validate_event_listeners(option, listeners):
 if (not isinstance(listeners, Sequence)):
  raise TypeError(('%s must be a list or tuple' % (option,)))
 for listener in listeners:
  if (not isinstance(listener, _EventListener)):
   raise TypeError(('Listeners for %s must be either a CommandListener, ServerHeartbeatListener, ServerListener, or TopologyListener.' % (option,)))
 return listeners

def _validate_event_listeners ( option , listeners ) : if ( not isinstance ( listeners , Sequence ) ) : raise TypeError ( ( '%s must be a list or tuple' % ( option , ) ) ) for listener in listeners : if ( not isinstance ( listener , _EventListener ) ) : raise TypeError ( ( 'Listeners for %s must be either a CommandListener, ServerHeartbeatListener, ServerListener, or TopologyListener.' % ( option , ) ) ) return listeners
validate event listeners .