code: func Scheduler(c context.Context, cfg *pb.ProjectConfig) error {
  	// Sort jobs by ID.
  	sort.Slice(cfg.Job, func(i, j int) bool {
  		return cfg.Job[i].Id < cfg.Job[j].Id
  	})
  	sort.Slice(cfg.Trigger, func(i, j int) bool {
  		return cfg.Trigger[i].Id < cfg.Trigger[j].Id
  	})
  
  	// ACL set name => list of ACLs.
  	aclSets := make(map[string][]*pb.Acl)
  	for _, s := range cfg.AclSets {
  		aclSets[s.Name] = s.Acls
  	}
  
  	// Expand ACL sets.
  	for _, x := range cfg.Job {
  		x.Acls = normalizeACLs(x.Acls, x.AclSets, aclSets)
  		x.AclSets = nil
  	}
  	for _, x := range cfg.Trigger {
  		x.Acls = normalizeACLs(x.Acls, x.AclSets, aclSets)
  		x.AclSets = nil
  	}
  	cfg.AclSets = nil
  
  	// Normalize triggers.
  	for _, x := range cfg.Trigger {
  		sort.Strings(x.Triggers)
  		if gt := x.Gitiles; gt != nil {
  			for i, r := range gt.Refs {
  				if !strings.HasPrefix(r, "regexp:") {
  					gt.Refs[i] = "regexp:" + regexp.QuoteMeta(r)
  				}
  			}
  			sort.Strings(gt.Refs)
  		}
  	}
  
  	return nil
  }
docs: // Scheduler normalizes luci-scheduler.cfg config.