func ParseNetworks(bytes []byte) (map[string]*NetworkConfig, error) {
	networkConfigs := make(map[string]*NetworkConfig)
	var config Config
	if err := yaml.Unmarshal(bytes, &config); err != nil {
		return nil, err
	}
	if err := utils.Convert(config.Networks, &networkConfigs); err != nil {
		return nil, err
	}
	for key, value := range networkConfigs {
		if value == nil {
			networkConfigs[key] = &NetworkConfig{}
		}
	}
	return networkConfigs, nil
}
ParseNetworks parses networks in a compose file
package config
import (
	"fmt"
	"path"
	"github.com/Sirupsen/logrus"
	"github.com/docker/libcompose/utils"
	"gopkg.in/yaml.v2"
)
func MergeServicesV2(existingServices *ServiceConfigs, environmentLookup EnvironmentLookup, resourceLookup ResourceLookup, file string, bytes []byte, options *ParseOptions) (map[string]*ServiceConfig, error) {
	var config Config
	if err := yaml.Unmarshal(bytes, &config); err != nil {
		return nil, err
	}
	datas := config.Services
	if options.Interpolate {
		if err := Interpolate(environmentLookup, &datas); err != nil {
			return nil, err
		}
	}
	if options.Preprocess != nil {
		var err error
		datas, err = options.Preprocess(datas)
		if err != nil {
			return nil, err
		}
	}
	for name, data := range datas {
		data, err := parseV2(resourceLookup, environmentLookup, file, data, datas, options)
		if err != nil {
			logrus.Errorf("Failed to parse service %s: %v", name, err)
			return nil, err
		}
		if serviceConfig, ok := existingServices.Get(name); ok {
			var rawExistingService RawService
			if err := utils.Convert(serviceConfig, &rawExistingService); err != nil {
				return nil, err
			}
			data = mergeConfig(rawExistingService, data)
		}
		datas[name] = data
	}
	serviceConfigs := make(map[string]*ServiceConfig)
	if err := utils.Convert(datas, &serviceConfigs); err != nil {
		return nil, err
	}
	return serviceConfigs, nil
}
func ParseVolumes(bytes []byte) (map[string]*VolumeConfig, error) {
	volumeConfigs := make(map[string]*VolumeConfig)
	var config Config
	if err := yaml.Unmarshal(bytes, &config); err != nil {
		return nil, err
	}
	if err := utils.Convert(config.Volumes, &volumeConfigs); err != nil {
		return nil, err
	}
	return volumeConfigs, nil
}