parameters: (event)
return_statement: return False
docstring: Prints the messages in the event.
docstring_summary: Prints the messages in the event.
docstring_tokens: Prints the messages in the event .
function: def processGenericEvent(event):
      """Prints the messages in the event."""
  
      # When using a session identity, token generation
      # failure, authorization failure or revocation terminates
      # the session, in which case, applications only need to
      # check session status messages. Applications don't need
      # to handle token or authorization messages, which are
      # still printed. Will return True if session has failed
      # to start or is terminated. False will be returned if otherwise.
  
      eventType = event.eventType()
      for msg in event:
          print(msg)
          messageType = msg.messageType()
          if eventType == blpapi.Event.SESSION_STATUS:
              if messageType == blpapi.Names.SESSION_TERMINATED \
                      or messageType == blpapi.Names.SESSION_STARTUP_FAILURE:
                  print("Session failed to start or terminated.")
                  printContactSupportMessage(msg)
                  return True
          elif eventType == blpapi.Event.SERVICE_STATUS:
              if messageType == blpapi.Names.SERVICE_OPEN_FAILURE:
                  serviceName = msg.getElementAsString("serviceName")
                  print(f"Failed to open {serviceName}")
                  printContactSupportMessage(msg)
  
      return False
function_tokens: def processGenericEvent ( event ) : # When using a session identity, token generation # failure, authorization failure or revocation terminates # the session, in which case, applications only need to # check session status messages. Applications don't need # to handle token or authorization messages, which are # still printed. Will return True if session has failed # to start or is terminated. False will be returned if otherwise. eventType = event . eventType ( ) for msg in event : print ( msg ) messageType = msg . messageType ( ) if eventType == blpapi . Event . SESSION_STATUS : if messageType == blpapi . Names . SESSION_TERMINATED or messageType == blpapi . Names . SESSION_STARTUP_FAILURE : print ( "Session failed to start or terminated." ) printContactSupportMessage ( msg ) return True elif eventType == blpapi . Event . SERVICE_STATUS : if messageType == blpapi . Names . SERVICE_OPEN_FAILURE : serviceName = msg . getElementAsString ( "serviceName" ) print ( f"Failed to open {serviceName}" ) printContactSupportMessage ( msg ) return False