code: def refresh_address_presence(self, address):
          
          composite_presence = {
              self._fetch_user_presence(uid)
              for uid
              in self._address_to_userids[address]
          }
  
          # Iterate over UserPresence in definition order (most to least online) and pick
          # first matching state
          new_presence = UserPresence.UNKNOWN
          for presence in UserPresence.__members__.values():
              if presence in composite_presence:
                  new_presence = presence
                  break
  
          new_address_reachability = USER_PRESENCE_TO_ADDRESS_REACHABILITY[new_presence]
  
          if new_address_reachability == self._address_to_reachability.get(address):
              # Cached address reachability matches new state, do nothing
              return
          log.debug(
              'Changing address presence state',
              current_user=self._user_id,
              address=to_normalized_address(address),
              prev_state=self._address_to_reachability.get(address),
              state=new_address_reachability,
          )
          self._address_to_reachability[address] = new_address_reachability
          self._address_reachability_changed_callback(address, new_address_reachability)
docs: Update synthesized address presence state from cached user presence states.
  
          Triggers callback (if any) in case the state has changed.
  
          This method is only provided to cover an edge case in our use of the Matrix protocol and
          should **not** generally be used.