def get_chat_status(account):
  try:
    presence = xmpp.get_presence(account.email)
    return 'online' if presence else 'offline'
  except Exception as err:
    logging.error('Exception getting XMPP presence: %s', err)
    return 'Error (%s)' % err
dataset/ETHPy150Open rietveld-codereview/rietveld/codereview/notify_xmpp.py/get_chat_status/original