code: func Buildbucket(c context.Context, cfg *pb.BuildbucketCfg) error {
  	// Install or update 'flatten_buildbucket_cfg' tool.
  	bin, err := installFlattenBuildbucketCfg(c)
  	if err != nil {
  		return fmt.Errorf("failed to install buildbucket config flattener: %s", err)
  	}
  
  	// 'flatten_buildbucket_cfg' wants a real file as input.
  	f, err := ioutil.TempFile("", "lucicfg")
  	if err != nil {
  		return err
  	}
  	defer func() {
  		f.Close()
  		os.Remove(f.Name())
  	}()
  	if err := proto.MarshalText(f, cfg); err != nil {
  		return err
  	}
  	if err := f.Close(); err != nil {
  		return err
  	}
  
  	buf := bytes.Buffer{}
  
  	cmd := exec.Command(bin, f.Name())
  	cmd.Stderr = os.Stderr
  	cmd.Stdin = os.Stdin
  	cmd.Stdout = &buf
  	if err := cmd.Run(); err != nil {
  		return fmt.Errorf("failed to flatten the config - %s", err)
  	}
  
  	*cfg = pb.BuildbucketCfg{}
  	if err := proto.UnmarshalText(buf.String(), cfg); err != nil {
  		return err
  	}
  	return nil
  }
docs: // Buildbucket normalizes cr-buildbucket.cfg config.