code: func (daemon *Daemon) localNetworksPrune(ctx context.Context, pruneFilters filters.Args) *types.NetworksPruneReport {
  	rep := &types.NetworksPruneReport{}
  
  	until, _ := getUntilFromPruneFilters(pruneFilters)
  
  	// When the function returns true, the walk will stop.
  	l := func(nw libnetwork.Network) bool {
  		select {
  		case <-ctx.Done():
  			// context cancelled
  			return true
  		default:
  		}
  		if nw.Info().ConfigOnly() {
  			return false
  		}
  		if !until.IsZero() && nw.Info().Created().After(until) {
  			return false
  		}
  		if !matchLabels(pruneFilters, nw.Info().Labels()) {
  			return false
  		}
  		nwName := nw.Name()
  		if runconfig.IsPreDefinedNetwork(nwName) {
  			return false
  		}
  		if len(nw.Endpoints()) > 0 {
  			return false
  		}
  		if err := daemon.DeleteNetwork(nw.ID()); err != nil {
  			logrus.Warnf("could not remove local network %s: %v", nwName, err)
  			return false
  		}
  		rep.NetworksDeleted = append(rep.NetworksDeleted, nwName)
  		return false
  	}
  	daemon.netController.WalkNetworks(l)
  	return rep
  }
docs: // localNetworksPrune removes unused local networks