code: def filter_reachable_routes(
          routes: List[RouteState],
          nodeaddresses_to_networkstates: NodeNetworkStateMap,
  ) -> List[RouteState]:
      
      reachable_routes = []
  
      for route in routes:
          node_network_state = nodeaddresses_to_networkstates.get(
              route.node_address,
              NODE_NETWORK_UNREACHABLE,
          )
  
          if node_network_state == NODE_NETWORK_REACHABLE:
              reachable_routes.append(route)
  
      return reachable_routes
docs: This function makes sure we use reachable routes only.