// NewTerrainReport returns a new TerrainReport
325005
func NewTerrainReport(LAT int32, LON int32, TERRAIN_HEIGHT float32, CURRENT_HEIGHT float32, SPACING uint16, PENDING uint16, LOADED uint16) *TerrainReport {
	m := TerrainReport{}
	m.LAT = LAT
	m.LON = LON
	m.TERRAIN_HEIGHT = TERRAIN_HEIGHT
	m.CURRENT_HEIGHT = CURRENT_HEIGHT
	m.SPACING = SPACING
	m.PENDING = PENDING
	m.LOADED = LOADED
	return &m
}
529342
func (t *treeGenerator) newTriple(parent, descendant *node.Node) (*triple.Triple, error) {
	return triple.New(parent, t.predicate, triple.NewNodeObject(descendant))
}
1240326
func NewStatsdReporter(
	config *config.Config,
	serverType string,
	tagsMap map[string]string,
	clientOrNil ...Client,
) (*StatsdReporter, error) {
	host := config.GetString("pitaya.metrics.statsd.host")
	prefix := config.GetString("pitaya.metrics.statsd.prefix")
	rate, err := strconv.ParseFloat(config.GetString("pitaya.metrics.statsd.rate"), 64)
	if err != nil {
		return nil, err
	}
	sr := &StatsdReporter{
		rate:       rate,
		serverType: serverType,
	}

	sr.buildDefaultTags(tagsMap)

	if len(clientOrNil) > 0 {
		sr.client = clientOrNil[0]
	} else {
		c, err := statsd.New(host)
		if err != nil {
			return nil, err
		}
		c.Namespace = prefix
		sr.client = c
	}
	return sr, nil
}
437032
func (rl *ReqLog) Report() []*ReqLogEntry {
	rl.lock.Lock()
	defer rl.lock.Unlock()
	out := make([]*ReqLogEntry, len(rl.Requests))

	for i, e := range rl.Requests {
		out[i] = e.Copy()
	}

	return out
}
198119
func (cfg *TracingConfiguration) NewTracer(defaultServiceName string, scope tally.Scope, logger *zap.Logger) (opentracing.Tracer, io.Closer, error) {
	if cfg.Backend == "" {
		return opentracing.NoopTracer{}, noopCloser{}, nil
	}

	if cfg.Backend != TracingBackendJaeger {
		return nil, nil, fmt.Errorf("unknown tracing backend: %s. Supported backends are: %s", cfg.Backend, TracingBackendJaeger)
	}

	if cfg.Jaeger.ServiceName == "" {
		cfg.Jaeger.ServiceName = defaultServiceName
	}

	jaegerLog := jaegerzap.NewLogger(logger)
	tracer, jaegerCloser, err := cfg.Jaeger.NewTracer(
		jaegercfg.Logger(jaegerLog),
		jaegercfg.Metrics(jaegertally.Wrap(scope)))

	if err != nil {
		return nil, nil, fmt.Errorf("failed to initialize jaeger: %s", err.Error())
	}

	return tracer, jaegerCloser, nil
}
958519
func NewTransport(base http.RoundTripper, modifiers ...RequestModifier) http.RoundTripper {
	return &transport{
		Modifiers: modifiers,
		Base:      base,
	}
}
651136
func NewTrackHandler(xp rpc.Transporter, g *libkb.GlobalContext) *TrackHandler {
	return &TrackHandler{
		BaseHandler:  NewBaseHandler(g, xp),
		Contextified: libkb.NewContextified(g),
	}
}
117341
func (objMgr *ObjectManager) GetCapacityReport(name string) ([]CapacityReport, error) {
	var res []CapacityReport

	capacityObj := CapacityReport{Name: name}
	capacityReport := NewCapcityReport(capacityObj)
	err := objMgr.connector.GetObject(capacityReport, "", &res)
	return res, err
}
952054
func (api *API) Report(info params.MinionReport) error {
	phase, ok := migration.ParsePhase(info.Phase)
	if !ok {
		return errors.New("unable to parse phase")
	}

	mig, err := api.backend.Migration(info.MigrationId)
	if err != nil {
		return errors.Trace(err)
	}

	err = mig.SubmitMinionReport(api.authorizer.GetAuthTag(), phase, info.Success)
	return errors.Trace(err)
}
660340
func (s *Application) NewTemplateEngine(tmplPath string, conf *render.Config) driver.Driver {
	if len(tmplPath) == 0 {
		tmplPath = s.ThemeDir()
	}
	eng := render.New(conf.Engine, tmplPath, s.Core.Logger())
	eng.Init()
	eng.SetDebug(conf.Debug)
	return eng
}
1169976
func newTimeTracer(name string, driver TracerDriver) *timeTracer {
	return &timeTracer{
		name:      name,
		driver:    driver,
		startTime: time.Now(),
	}
}
1318341
func (c *Client) Report(migrationId string, phase migration.Phase, success bool) error {
	args := params.MinionReport{
		MigrationId: migrationId,
		Phase:       phase.String(),
		Success:     success,
	}
	err := c.caller.FacadeCall("Report", args, nil)
	return errors.Trace(err)
}
1108910
func (e *Encoder) NewTrack() *Track {
	t := &Track{ticksPerBeat: e.TicksPerQuarterNote}
	e.Tracks = append(e.Tracks, t)
	return t
}
805396
func NewTrie(options ...Option) *Trie {
	trie := &Trie{}

	for _, opt := range options {
		opt(trie)
	}

	if trie.maxPrefixPerNode <= 0 {
		trie.maxPrefixPerNode = DefaultMaxPrefixPerNode
	}
	if trie.maxChildrenPerSparseNode <= 0 {
		trie.maxChildrenPerSparseNode = DefaultMaxChildrenPerSparseNode
	}

	trie.children = newSparseChildList(trie.maxChildrenPerSparseNode)
	return trie
}
8508
func NewTerrainRequest(MASK uint64, LAT int32, LON int32, GRID_SPACING uint16) *TerrainRequest {
	m := TerrainRequest{}
	m.MASK = MASK
	m.LAT = LAT
	m.LON = LON
	m.GRID_SPACING = GRID_SPACING
	return &m
}
418342
func (s *ListReviewPolicyResultsForHITOutput) SetHITReviewReport(v *ReviewReport) *ListReviewPolicyResultsForHITOutput {
	s.HITReviewReport = v
	return s
}
724482
func NewTransport(tracer *zipkin.Tracer, options ...TransportOption) (http.RoundTripper, error) {
	if tracer == nil {
		return nil, ErrValidTracerRequired
	}

	t := &transport{
		tracer:     tracer,
		rt:         http.DefaultTransport,
		httpTrace:  false,
		errHandler: defaultErrHandler,
	}

	for _, option := range options {
		option(t)
	}

	return t, nil
}