code: func (s PluginMetaSet) ConstrainVersions(reqd PluginRequirements) map[string]PluginMetaSet {
  	ret := make(map[string]PluginMetaSet)
  	for p := range s {
  		name := p.Name
  		allowedVersions, ok := reqd[name]
  		if !ok {
  			continue
  		}
  		if _, ok := ret[p.Name]; !ok {
  			ret[p.Name] = make(PluginMetaSet)
  		}
  		version, err := p.Version.Parse()
  		if err != nil {
  			panic(err)
  		}
  		if allowedVersions.Allows(version) {
  			ret[p.Name].Add(p)
  		}
  	}
  	return ret
  }
docs: // ConstrainVersions takes a set of requirements and attempts to
  // return a map from name to a set of metas that have the matching
  // name and an appropriate version.
  //
  // If any of the given requirements match *no* plugins then its PluginMetaSet
  // in the returned map will be empty.
  //
  // All viable metas are returned, so the caller can apply any desired filtering
  // to reduce down to a single option. For example, calling Newest() to obtain
  // the highest available version.
  //
  // If any of the metas in the set have invalid version strings then this
  // function will panic. Use ValidateVersions() first to filter out metas with
  // invalid versions.