hpimdm/tree/tree_if_non_root.py
def change_best_upstream_neighbor_state(self, new_best_upstream_neighbor_state):
        """
        A neighbor changed Upstream state due to the reception of any control packet
        (IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync)
        """
        previous_best_upstream_router = self._best_upstream_router
        super().change_best_upstream_neighbor_state(new_best_upstream_neighbor_state)
        self.calculate_assert_winner()

        # Event 7 and 8
        if self.current_tree_state.is_unsure() and new_best_upstream_neighbor_state is not None and \
                 (previous_best_upstream_router is None or previous_best_upstream_router is not new_best_upstream_neighbor_state):
            SFMRNonRootState.tree_remains_unsure_and_best_upstream_router_reelected(self)

        A neighbor changed Upstream state due to the reception of any control packet
        (IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync)
        
A neighbor changed Upstream state due to the reception of any control packet
(IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync)
A neighbor changed Upstream state due to the reception of any control packet ( IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync )
def change_best_upstream_neighbor_state(self, new_best_upstream_neighbor_state):
        previous_best_upstream_router = self._best_upstream_router
        super().change_best_upstream_neighbor_state(new_best_upstream_neighbor_state)
        self.calculate_assert_winner()
        if self.current_tree_state.is_unsure() and new_best_upstream_neighbor_state is not None and \
                 (previous_best_upstream_router is None or previous_best_upstream_router is not new_best_upstream_neighbor_state):
            SFMRNonRootState.tree_remains_unsure_and_best_upstream_router_reelected(self)
def change_best_upstream_neighbor_state ( self , new_best_upstream_neighbor_state ) : previous_best_upstream_router = self . _best_upstream_router super ( ) . change_best_upstream_neighbor_state ( new_best_upstream_neighbor_state ) self . calculate_assert_winner ( ) if self . current_tree_state . is_unsure ( ) and new_best_upstream_neighbor_state is not None and ( previous_best_upstream_router is None or previous_best_upstream_router is not new_best_upstream_neighbor_state ) : SFMRNonRootState . tree_remains_unsure_and_best_upstream_router_reelected ( self )
A neighbor changed Upstream state due to the reception of any control packet
(IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync)
A neighbor changed Upstream state due to the reception of any control packet ( IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync )
"""
        A neighbor changed Upstream state due to the reception of any control packet
        (IamUpstream or IamNoLongerUpstream or Interest or NoInterest or Sync)
        """ # Event 7 and 8
self
new_best_upstream_neighbor_state