code: func (daemon *Daemon) GetNetworks(filter filters.Args, config types.NetworkListConfig) ([]types.NetworkResource, error) {
  	networks := daemon.getAllNetworks()
  
  	list := make([]types.NetworkResource, 0, len(networks))
  	var idx map[string]libnetwork.Network
  	if config.Detailed {
  		idx = make(map[string]libnetwork.Network)
  	}
  
  	for _, n := range networks {
  		nr := buildNetworkResource(n)
  		list = append(list, nr)
  		if config.Detailed {
  			idx[nr.ID] = n
  		}
  	}
  
  	var err error
  	list, err = internalnetwork.FilterNetworks(list, filter)
  	if err != nil {
  		return nil, err
  	}
  
  	if config.Detailed {
  		for i, n := range list {
  			np := &n
  			buildDetailedNetworkResources(np, idx[n.ID], config.Verbose)
  			list[i] = *np
  		}
  	}
  
  	return list, nil
  }
docs: // GetNetworks returns a list of all networks