// ShimLocal is a ShimOpt for using an in process shim implementation
504001
func ShimLocal(c *Config, exchange *exchange.Exchange) ShimOpt {
	return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
		return b.shimConfig(ns, c, ropts), client.WithLocal(exchange)
	}
}
193003
func newChatLocal(config Config) *chatLocal {
	return newChatLocalWithData(config, &chatLocalSharedData{
		convs:     make(convLocalByTypeMap),
		convsByID: make(convLocalByIDMap),
		newChannelCBs: map[Config]newConvCB{
			config: nil,
		},
	})
}
37960
func (v Volumes) MarshalYAML() (interface{}, error) {
	vs := []string{}
	for _, volume := range v.Volumes {
		vs = append(vs, volume.String())
	}
	return vs, nil
}
954349
func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool {
	return NotNil(a.t, object, msgAndArgs...)
}
543098
func (f *FakeFS) MkdirAll(dirName string, perm os.FileMode) error {
	_, err := f.Create(dirName)
	return err
}
979314
func IsTerminal(w io.Writer) bool {
	fw, ok := w.(interface {
		Fd() uintptr
	})
	if !ok {
		return false
	}
	var st uint32
	r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fw.Fd(), uintptr(unsafe.Pointer(&st)), 0)
	return r != 0 && e == 0
}
178212
func ToYAML(s string) (string, error) {
	m, err := Parse(s)
	if err != nil {
		return "", err
	}
	d, err := yaml.Marshal(m)
	return string(d), err
}
1277592
func (s *SigningConfiguration) SetHashAlgorithmOptions(v *HashAlgorithmOptions) *SigningConfiguration {
	s.HashAlgorithmOptions = v
	return s
}
1145685
func ProcessYAML(input []byte, options *ProcessorOptions) ([]byte, error) {

	// Convert short form intrinsic functions (e.g. !Sub) to long form
	registerTagMarshallers()

	data, err := yamlwrapper.YAMLToJSON(input)
	if err != nil {
		return nil, fmt.Errorf("invalid YAML template: %s", err)
	}

	return ProcessJSON(data, options)

}
1100897
func (g *G) StartLoc() Location {
	f, l, fn := g.variable.bi.PCToLine(g.StartPC)
	return Location{PC: g.StartPC, File: f, Line: l, Fn: fn}
}
89047
func IsTerminal(file *os.File) bool {
	var tios syscall.Termios
	_, _, ep := syscall.Syscall(syscall.SYS_IOCTL,
		uintptr(file.Fd()), syscall.TCGETS, uintptr(unsafe.Pointer(&tios)))
	if ep != 0 {
		// syscall failed, it's not a terminal
		return false
	}
	return true
}
189424
func IsTerminal(w io.Writer) bool {
	if f, ok := w.(interface {
		Fd() uintptr
	}); ok {
		return isatty.IsTerminal(f.Fd())
	}
	return false
}
270177
func (n Networks) MarshalYAML() (interface{}, error) {
	m := map[string]*Network{}
	for _, network := range n.Networks {
		m[network.Name] = network
	}
	return m, nil
}
1274609
func (soc *Socket) SetHandshakeIvl(value time.Duration) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HANDSHAKE_IVL, val)
}
836989
func (s *Server) updateLocalLegacyACLs(changes structs.ACLRequests, ctx context.Context) (bool, error) {
	defer metrics.MeasureSince([]string{"leader", "updateLocalACLs"}, time.Now())

	minTimePerOp := time.Second / time.Duration(s.config.ACLReplicationApplyLimit)
	for _, change := range changes {
		// Note that we are using the single ACL interface here and not
		// performing all this inside a single transaction. This is OK
		// for two reasons. First, there's nothing else other than this
		// replication routine that alters the local ACLs, so there's
		// nothing to contend with locally. Second, if an apply fails
		// in the middle (most likely due to losing leadership), the
		// next replication pass will clean up and check everything
		// again.
		var reply string
		start := time.Now()
		if err := aclApplyInternal(s, change, &reply); err != nil {
			return false, err
		}

		// Do a smooth rate limit to wait out the min time allowed for
		// each op. If this op took longer than the min, then the sleep
		// time will be negative and we will just move on.
		elapsed := time.Since(start)
		select {
		case <-ctx.Done():
			return true, nil
		case <-time.After(minTimePerOp - elapsed):
			// do nothing
		}
	}
	return false, nil
}
1354448
func (l *LocalDevices) MarshalYAML() (interface{}, error) {
	return &struct {
		Driver    string            `json:"driver" yaml:"driver"`
		DeviceMap map[string]string `json:"deviceMap,omitempty" yaml:"deviceMap,omitempty"`
	}{l.Driver, l.DeviceMap}, nil
}
1366456
func (u *UlimitsConfig) MarshalYAML() (interface{}, error) {
	if u.Single != 0 {
		return u.Single, nil
	}
	return u, nil
}