code: def ping():
      '''
      Returns true if the device is reachable, else false.
      '''
      try:
          session, cookies, csrf_token = logon()
          logout(session, cookies, csrf_token)
      except salt.exceptions.CommandExecutionError:
          return False
      except Exception as err:
          log.debug(err)
          return False
      return Truf ping():
      '''
      Returns true if the device is reachable, else false.
      '''
      try:
          session, cookies, csrf_token = logon()
          logout(session, cookies, csrf_token)
      except salt.exceptions.CommandExecutionError:
          return False
      except Exception as err:
          log.debug(err)
          return False
      return True
docs: Returns true if the device is reachable, else false.