// NewTerrainCheck returns a new TerrainCheck
517676
func NewTerrainCheck(LAT int32, LON int32) *TerrainCheck {
	m := TerrainCheck{}
	m.LAT = LAT
	m.LON = LON
	return &m
}
894676
func NewTrainer(opts ...TrainerConsOpt) *Trainer {
	t := new(Trainer)
	// set up the default model
	t.Model = new(Model)
	t.corpus = KnownWords
	t.ts = transitions

	// set up the neural network
	t.nn = new(neuralnetwork2)
	t.nn.NNConfig = DefaultNNConfig
	t.nn.transitions = transitions
	t.nn.dict = KnownWords

	for _, opt := range opts {
		opt(t)
	}
	return t
}
1060268
func DirCheck(filePath string) error {
	dir := filepath.Dir(filePath)
	if !FileExists(dir) {
		return os.MkdirAll(dir, 0777)
	}
	return nil
}
548839
func NewTracker(mynick string) *stateTracker {
	st := &stateTracker{
		chans: make(map[string]*channel),
		nicks: make(map[string]*nick),
	}
	st.me = newNick(mynick)
	st.nicks[mynick] = st.me
	return st
}
668882
func NewTracer(rep reporter.Reporter, opts ...TracerOption) (*Tracer, error) {
	// set default tracer options
	t := &Tracer{
		defaultTags:          make(map[string]string),
		extractFailurePolicy: ExtractFailurePolicyRestart,
		sampler:              AlwaysSample,
		generate:             idgenerator.NewRandom64(),
		reporter:             rep,
		localEndpoint:        nil,
		noop:                 0,
		sharedSpans:          true,
		unsampledNoop:        false,
	}

	// if no reporter was provided we default to noop implementation.
	if t.reporter == nil {
		t.reporter = reporter.NewNoopReporter()
		t.noop = 1
	}

	// process functional options
	for _, opt := range opts {
		if err := opt(t); err != nil {
			return nil, err
		}
	}

	return t, nil
}
307243
func (m *MockClock) NewTicker(d time.Duration) Ticker {
	return NewMockTicker(m, d)
}
296956
func NewTracer(description string) *Tracer {
	return &Tracer{Started: time.Now().UTC(), Description: description}
}
1283687
func newTimSorter(arr sort.Interface, maxTempSlots int) *TimSorter {
	return &TimSorter{
		Sorter:       newSorter(arr),
		runEnds:      make([]int, 1+STACKSIZE),
		maxTempSlots: maxTempSlots,
	}
}
915094
func newTrigger(pthLkp map[string]*watched) trigger {
	return &kq{
		pthLkp: pthLkp,
		idLkp:  make(map[int]*watched),
	}
}
195532
func (c *BundlingChecker) check(items []checkerItem) {
	c.waitc <- struct{}{}
	c.wg.Add(1)
	go func() {
		c.doCheck(items)
		c.wg.Done()
		<-c.waitc
	}()

}
435754
func (u *UpdateChecker) Check() {
	u.updater.config.SetLastUpdateCheckTime()
	if err := u.check(); err != nil {
		u.log.Errorf("Error in update: %s", err)
	}
}
851939
func (c *Client) EdgeCheck(i *EdgeCheckInput) ([]*EdgeCheck, error) {
	resp, err := c.Get("/content/edge_check", &RequestOptions{
		Params: map[string]string{
			"url": i.URL,
		},
	})
	if err != nil {
		return nil, err
	}

	var e []*EdgeCheck
	if err := decodeJSON(&e, resp.Body); err != nil {
		return nil, err
	}
	return e, nil
}
1221014
func (e *Engine) performCheck() {
	log.Printf("Checking for updates to Torus")

	latest, err := e.getLatestVersion()
	if err != nil {
		log.Printf("Could not retrieve latest version of Tours: %s", err)
		return
	}

	e.targetVersion = latest
	if err := e.storeLastCheck(); err != nil {
		log.Printf("Cannot store the last check date: %s", err)
	}

	log.Printf("Successfully checked for updates; available version: %s", latest)
}
335009
func NewTaskCatch(nextState TransitionState, errors ...StateError) *TaskCatch {
	return &TaskCatch{
		errorEquals: errors,
		next:        nextState,
	}
}
727883
func NewTTLRUCache(capacity int, ttl time.Duration) *TTLRUCache {
	rtn := &TTLRUCache{
		capacity:  capacity,
		mapping:   make(map[interface{}]*triple),
		order:     list.New(),
		timeorder: list.New(),
		ttl:       ttl,
	}
	rtn.triplePool.New = newTriple
	go rtn.timer()
	return rtn
}
554381
func NewTemplateCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {

	calls := gosec.NewCallList()
	calls.Add("html/template", "HTML")
	calls.Add("html/template", "HTMLAttr")
	calls.Add("html/template", "JS")
	calls.Add("html/template", "URL")
	return &templateCheck{
		calls: calls,
		MetaData: gosec.MetaData{
			ID:         id,
			Severity:   gosec.Medium,
			Confidence: gosec.Low,
			What:       "this method will not auto-escape HTML. Verify data is well formed.",
		},
	}, []ast.Node{(*ast.CallExpr)(nil)}
}
412453
func NewTar(path string) (*TarReader, error) {
	file, err := os.Open(path)
	if err != nil {
		return nil, err
	}

	tr := tar.NewReader(file)
	return &TarReader{file: file, gz: nil, tr: tr}, nil
}