code: func parseNetworkOpts(copts *containerOptions) (map[string]*networktypes.EndpointSettings, error) {
  	var (
  		endpoints                         = make(map[string]*networktypes.EndpointSettings, len(copts.netMode.Value()))
  		hasUserDefined, hasNonUserDefined bool
  	)
  
  	for i, n := range copts.netMode.Value() {
  		if container.NetworkMode(n.Target).IsUserDefined() {
  			hasUserDefined = true
  		} else {
  			hasNonUserDefined = true
  		}
  		if i == 0 {
  			// The first network corresponds with what was previously the "only"
  			// network, and what would be used when using the non-advanced syntax
  			// `--network-alias`, `--link`, `--ip`, `--ip6`, and `--link-local-ip`
  			// are set on this network, to preserve backward compatibility with
  			// the non-advanced notation
  			if err := applyContainerOptions(&n, copts); err != nil {
  				return nil, err
  			}
  		}
  		ep, err := parseNetworkAttachmentOpt(n)
  		if err != nil {
  			return nil, err
  		}
  		if _, ok := endpoints[n.Target]; ok {
  			return nil, errdefs.InvalidParameter(errors.Errorf("network %q is specified multiple times", n.Target))
  		}
  		endpoints[n.Target] = ep
  	}
  	if hasUserDefined && hasNonUserDefined {
  		return nil, errdefs.InvalidParameter(errors.New("conflicting options: cannot attach both user-defined and non-user-defined network-modes"))
  	}
  	return endpoints, nil
  }
docs: // parseNetworkOpts converts --network advanced options to endpoint-specs, and combines
  // them with the old --network-alias and --links. If returns an error if conflicting options
  // are found.
  //
  // this function may return _multiple_ endpoints, which is not currently supported
  // by the daemon, but may be in future; it's up to the daemon to produce an error
  // in case that is not supported.