code: func OpenInstance(ctx context.Context, r pkg.Source, opts OpenInstanceOpts) (pkg.Instance, error) {
  	out := &packageInstance{data: r}
  	if err := out.open(opts); err != nil {
  		return nil, err
  	}
  	return out, nil
  }
docs: // OpenInstance opens a package instance by reading it from the given source.
  //
  // The caller is responsible for closing the instance when done with it.
  //
  // On success it takes ownership of the source, closing it when the instance
  // itself is closed. On errors the source is left open. It's a responsibility of
  // the caller to close it in this case.