// NewSprite returns an instance of Sprite
320289
func (sim *simra) NewSprite() Spriter {
	return &sprite{
		simra:         sim,
		animationSets: map[string]*AnimationSet{},
	}
}
529033
func (sim *simra) AddSprite(s Spriter) {
	sp := s.(*sprite)
	err := sim.spritecontainer.AddSprite(&sp.Sprite, nil, nil)
	if err != nil {
		simlog.Errorf("failed to add sprite. err: %s", err.Error())
	}
}
1149804
func NewSimpleFS(appStateUpdater env.AppStateUpdater, config libkbfs.Config) keybase1.SimpleFSInterface {
	return newSimpleFS(appStateUpdater, config)
}
456888
func (p Proc) NewStat() (ProcStat, error) {
	f, err := os.Open(p.path("stat"))
	if err != nil {
		return ProcStat{}, err
	}
	defer f.Close()

	data, err := ioutil.ReadAll(f)
	if err != nil {
		return ProcStat{}, err
	}

	var (
		ignore int

		s = ProcStat{PID: p.PID, fs: p.fs}
		l = bytes.Index(data, []byte("("))
		r = bytes.LastIndex(data, []byte(")"))
	)

	if l < 0 || r < 0 {
		return ProcStat{}, fmt.Errorf(
			"unexpected format, couldn't extract comm: %s",
			data,
		)
	}

	s.Comm = string(data[l+1 : r])
	_, err = fmt.Fscan(
		bytes.NewBuffer(data[r+2:]),
		&s.State,
		&s.PPID,
		&s.PGRP,
		&s.Session,
		&s.TTY,
		&s.TPGID,
		&s.Flags,
		&s.MinFlt,
		&s.CMinFlt,
		&s.MajFlt,
		&s.CMajFlt,
		&s.UTime,
		&s.STime,
		&s.CUTime,
		&s.CSTime,
		&s.Priority,
		&s.Nice,
		&s.NumThreads,
		&ignore,
		&s.Starttime,
		&s.VSize,
		&s.RSS,
	)
	if err != nil {
		return ProcStat{}, err
	}

	return s, nil
}
945711
func NewSetIgnoreInputEventsArgs(ignore bool) *SetIgnoreInputEventsArgs {
	args := new(SetIgnoreInputEventsArgs)
	args.Ignore = ignore
	return args
}
1372733
func NewSubmitSM(fields pdutlv.Fields) Body {
	b := newSubmitSM(&Header{ID: SubmitSMID})
	b.init()
	for tag, value := range fields {
		b.t.Set(tag, value)
	}
	return b
}
324372
func (b *bundle) NewShimClient(ctx context.Context, namespace string, getClientOpts ShimOpt, runcOpts *runctypes.RuncOptions) (*client.Client, error) {
	cfg, opt := getClientOpts(b, namespace, runcOpts)
	return client.New(ctx, cfg, opt)
}
434707
func (service *Service) ShowPublicSite(w http.ResponseWriter, request *http.Request) {
	htmlData, err := html.Asset(mainpageFileName)
	if err != nil {
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	w.Write(htmlData)
}
1245819
func NewSimpleClient(hosts []string) (*simpleEtcdClient, error) {
	cfg := client.Config{
		Endpoints: hosts,
	}

	r, err := client.New(cfg)
	if err != nil {
		return nil, err
	}

	return &simpleEtcdClient{
		realClient: r,
	}, nil
}
141906
func NewSpritesheetFromFile(textureName string, cellWidth, cellHeight int) *Spritesheet {
	res, err := engo.Files.Resource(textureName)
	if err != nil {
		log.Println("[WARNING] [NewSpritesheetFromFile]: Received error:", err)
		return nil
	}

	img, ok := res.(TextureResource)
	if !ok {
		log.Println("[WARNING] [NewSpritesheetFromFile]: Resource not of type `TextureResource`:", textureName)
		return nil
	}

	return NewSpritesheetFromTexture(&img, cellWidth, cellHeight)
}
495498
func newSegment(name string, r *http.Request) *awsxray.Segment {
	// attempt to get IDs first
	parentId := getParentId(r.Header)
	traceId := getTraceId(r.Header)

	// now set the trace ID
	traceHdr := r.Header.Get(awsxray.TraceHeader)
	traceHdr = awsxray.SetTraceId(traceHdr, traceId)

	// create segment
	s := &awsxray.Segment{
		Id:        getRandom(8),
		HTTP:      newHTTP(r),
		Name:      name,
		TraceId:   traceId,
		StartTime: float64(time.Now().Truncate(time.Millisecond).UnixNano()) / 1e9,
	}

	// if we have a parent then we are a subsegment
	if len(parentId) > 0 {
		s.ParentId = parentId
		s.Type = "subsegment"
	} else {
		// set a new parent Id
		traceHdr = awsxray.SetParentId(traceHdr, s.Id)
	}

	// now save the header for the future context
	r.Header.Set(awsxray.TraceHeader, traceHdr)

	return s
}
283981
func NewSimpleWaitGen(init func(WaitInterface)) *WaitGen {
	return &WaitGen{
		nil,
		func() WaitInterface {
			nt := NewWait()
			init(nt)
			return nt
		},
	}
}
294883
func NewSubmitMultiResp() Body {
	b := newSubmitMultiResp(&Header{ID: SubmitMultiRespID})
	b.init()
	return b
}
1371616
func (p *Plugin) NewSyncPublisherToPartition(connectionName string, topic string, partition int32) (messaging.ProtoPublisher, error) {
	return p.NewProtoManualConnection(connectionName).NewSyncPublisherToPartition(topic, partition)
}
1299880
func NewSetStyleTextsArgs(edits []StyleDeclarationEdit) *SetStyleTextsArgs {
	args := new(SetStyleTextsArgs)
	args.Edits = edits
	return args
}
246776
func (v *VersioningTestV2) GetNewset() (o map[int32]struct{}) {
	if v != nil && v.Newset != nil {
		return v.Newset
	}

	return
}
833234
func NewSimpleFieldsMessage(p level.Priority, msg string, f Fields) Composer {
	m := MakeSimpleFieldsMessage(msg, f)
	_ = m.SetPriority(p)
	return m
}