// NewTray creates a new tray
174880
func (a *Astilectron) NewTray(o *TrayOptions) *Tray {
	return newTray(o, a.canceller, a.dispatcher, a.identifier, a.writer)
}
1314162
func NewTracker(parentCtx context.Context, logger hclog.Logger, alloc *structs.Allocation,
	allocUpdates *cstructs.AllocListener, consulClient cconsul.ConsulServiceAPI,
	minHealthyTime time.Duration, useChecks bool) *Tracker {

	// Do not create a named sub-logger as the hook controlling
	// this struct should pass in an appropriately named
	// sub-logger.
	t := &Tracker{
		healthy:        make(chan bool, 1),
		allocStopped:   make(chan struct{}),
		alloc:          alloc,
		tg:             alloc.Job.LookupTaskGroup(alloc.TaskGroup),
		minHealthyTime: minHealthyTime,
		useChecks:      useChecks,
		allocUpdates:   allocUpdates,
		consulClient:   consulClient,
		logger:         logger,
	}

	t.taskHealth = make(map[string]*taskHealthState, len(t.tg.Tasks))
	for _, task := range t.tg.Tasks {
		t.taskHealth[task.Name] = &taskHealthState{task: task}
	}

	for _, task := range t.tg.Tasks {
		for _, s := range task.Services {
			t.consulCheckCount += len(s.Checks)
		}
	}

	t.ctx, t.cancelFn = context.WithCancel(parentCtx)
	return t
}
391757
func NewTicker(last time.Time, initialOffset time.Duration, c clock.Clock) *Ticker {
	t := &Ticker{
		C:         make(chan time.Time),
		clock:     c,
		last:      last,
		offset:    initialOffset,
		newOffset: make(chan time.Duration),
	}
	go t.run()
	return t
}
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
}
794693
func NewTree(e StorageEngine, c Config) *Tree {
	return &Tree{eng: e, cfg: c}
}
85246
func NewTreeNode(text string) *TreeNode {
	return &TreeNode{
		text:       text,
		color:      Styles.PrimaryTextColor,
		indent:     2,
		expanded:   true,
		selectable: true,
	}
}
994838
func NewText(content string) *Text {
	text := new(Text)
	text.Content = content
	return text
}
779892
func (auto *AutoGcd) NewTab() (*Tab, error) {
	target, err := auto.debugger.NewTab()
	if err != nil {
		return nil, &InvalidTabErr{Message: "unable to create tab: " + err.Error()}
	}
	auto.tabLock.Lock()
	defer auto.tabLock.Unlock()

	tab, err := open(target)
	if err != nil {
		return nil, err
	}
	auto.tabs[target.Target.Id] = tab
	return tab, nil
}
783470
func NewTfaResetType(Description string) *TfaResetType {
	s := new(TfaResetType)
	s.Description = Description
	return s
}
754941
func NewTable(rowColors []*color.Color, alignRight []bool, indentWidth int) *Table {
	return &Table{rowColors, alignRight, indentWidth}
}
512015
func NewTask(id string) *Task {
	return &Task{
		Name:   id,
		Params: make(map[string]interface{}),
	}
}
247658
func NewTask(name, driver string) *Task {
	return &Task{
		Name:   name,
		Driver: driver,
	}
}
377819
func NewTty(cmd *exec.Cmd) *Tty {
	// Nothing special for Windows at this time
	tty := &Tty{}
	tty.cmd = cmd
	return tty
}
362416
func NewTreeSet(layout geom.Layout, compare Compare) *TreeSet {
	return &TreeSet{
		layout:  layout,
		stride:  layout.Stride(),
		compare: compare,
	}
}
411892
func (dc DefaultClock) NewTicker(d time.Duration) Ticker {
	return &defaultTicker{*time.NewTicker(d)}
}
1076459
func NewTypeItem(in interface{}, context *compiler.Context) (*TypeItem, error) {
	errors := make([]error, 0)
	x := &TypeItem{}
	switch in := in.(type) {
	case string:
		x.Value = make([]string, 0)
		x.Value = append(x.Value, in)
	case []interface{}:
		x.Value = make([]string, 0)
		for _, v := range in {
			value, ok := v.(string)
			if ok {
				x.Value = append(x.Value, value)
			} else {
				message := fmt.Sprintf("has unexpected value for string array element: %+v (%T)", value, value)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
	default:
		message := fmt.Sprintf("has unexpected value for string array: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
1307725
func (s *Set) ToArray() []interface{} {
	s.lock.RLock()
	defer s.lock.RUnlock()
	a := make([]interface{}, len(s.items))
	i := 0
	for item := range s.items {
		a[i] = item
		i++
	}
	return a
}