// NewFakeSeeker returns a ReadSeeker that can pretend to Seek (based
// on the provided total size of the reader's content), but any reads
// will fail if the fake seek position doesn't match reality.
967816
func NewFakeSeeker(r io.Reader, size int64) io.ReadSeeker {
	return &fakeSeeker{r: r, size: size}
}
1145199
func NewFakeS3Context(ctx context.Context) context.Context {
	return context.WithValue(ctx, fakeS3Key, true)
}
1277801
func NewMatcher(dictionary [][]byte) *Matcher {
	m := new(Matcher)

	m.buildTrie(dictionary)

	return m
}
1364688
func NewFakeDater(month int32, day int32, year int32) FakeDater {
	return newFakeDater(month, day, year)
}
415760
func NewFakeVolumeManager(initialVolumes []v1.UniqueVolumeName) *FakeVolumeManager {
	volumes := map[v1.UniqueVolumeName]bool{}
	for _, v := range initialVolumes {
		volumes[v] = true
	}
	return &FakeVolumeManager{
		volumes:       volumes,
		reportedInUse: map[v1.UniqueVolumeName]bool{},
	}
}
354805
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{
		dec: codec.NewDecoder(r, new(codec.CborHandle)),
	}
}
1343694
func (cp *CachePool) GetReadSeeker(fileIndex int64) (io.ReadSeeker, error) {
	// this will block until the channel is closed,
	// or immediately succeed if it's already closed
	<-cp.fileChans[fileIndex]

	return cp.cache.GetReadSeeker(fileIndex)
}
550441
func NewReader(in io.Reader) (*Reader, error) {
	r := new(Reader)
	r.r.source = in
	r.r.seeker, _ = in.(io.Seeker)
	if err := r.init(); err != nil {
		return nil, err
	}
	return r, nil
}
785071
func NewDecoder(r io.Reader) (*Decoder, error) {
	err := checkMagic(r)
	if err != nil {
		return nil, err
	}

	d := &Decoder{r: r}
	if d.MetaData, err = readMetaData(d.r); err != nil {
		return nil, err
	}
	if d.StreamInfo == nil {
		return nil, errors.New("Missing STREAMINFO header")
	}

	if d.BitsPerSample != 8 && d.BitsPerSample != 16 && d.BitsPerSample != 24 {
		return nil, errors.New("Unsupported bits per sample (" + strconv.Itoa(d.BitsPerSample) + "), supported values are: 8, 16, and 24")
	}

	return d, nil
}
251850
func newValidator(image io.ReadSeeker) (*validator, error) {
	manifest, err := aci.ManifestFromImage(image)
	if err != nil {
		return nil, err
	}
	v := &validator{
		image:    image,
		manifest: manifest,
	}
	return v, nil
}
221877
func NewProfiler() (prof *Profiler, err error) {
	p, err := mem.NewProfiler()
	if err != nil {
		return nil, err
	}
	return &Profiler{Profiler: p}, nil
}
857238
func (j *JSONPb) NewDecoder(r io.Reader) Decoder {
	d := json.NewDecoder(r)
	return DecoderWrapper{Decoder: d}
}
1037288
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{r, defaultDelimiter, defaultEscape, false, false}
}
673390
func NewChecksummedReader(delegate io.ReadSeeker, interval int, newHash func() hash.Hash32) ChecksummedReader {
	return newChecksummedReaderImpl(delegate, interval, newHash)
}
343689
func NewFakeDelayer(delay time.Duration) *Ethash {
	return &Ethash{
		config: Config{
			PowMode: ModeFake,
		},
		fakeDelay: delay,
	}
}
761021
func NewDecoder(r io.Reader) *Decoder {
	decoder := new(Decoder)
	decoder.pendingTag = -1
	decoder.syms = make([]string, 0)
	decoder.in = bufio.NewReader(r)
	//	decoder.currentCursor = nil
	decoder.readHeader()
	return decoder
}
1341232
func NewReader(e *message.Entity) *Reader {
	mr := e.MultipartReader()
	if mr == nil {
		// Artificially create a multipart entity
		// With this header, no error will be returned by message.NewMultipart
		var h message.Header
		h.Set("Content-Type", "multipart/mixed")
		me, _ := message.NewMultipart(h, []*message.Entity{e})
		mr = me.MultipartReader()
	}

	l := list.New()
	l.PushBack(mr)

	return &Reader{Header{e.Header}, e, l}
}