//WithConfig sets an environment variable for the docker config location
163930
func WithConfig(dir string) func(cmd *icmd.Cmd) {
	return func(cmd *icmd.Cmd) {
		env := append(os.Environ(),
			"DOCKER_CONFIG="+dir,
		)
		cmd.Env = append(cmd.Env, env...)
	}
}
416811
func Convert_v1_DockerConfig_To_config_DockerConfig(in *v1.DockerConfig, out *config.DockerConfig, s conversion.Scope) error {
	return autoConvert_v1_DockerConfig_To_config_DockerConfig(in, out, s)
}
957823
func (c *Config) WithRegion(region string) *Config {
	c.Region = &region
	return c
}
41988
func WithImage(image string) func(*TestContainerConfig) {
	return func(c *TestContainerConfig) {
		c.Config.Image = image
	}
}
361182
func Config(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Descriptor, error) {
	manifest, err := Manifest(ctx, provider, image, platform)
	if err != nil {
		return ocispec.Descriptor{}, err
	}
	return manifest.Config, err
}
1096744
func (o *PatchConfigParams) WithConfiguration(configuration *models.DaemonConfigurationSpec) *PatchConfigParams {
	o.SetConfiguration(configuration)
	return o
}
1273468
func (i *Instance) ReadPasswordWithConfig(cfg *Config) ([]byte, error) {
	return i.Operation.PasswordWithConfig(cfg)
}
1142809
func (rco RunContainerOptions) asDockerConfig() dockercontainer.Config {
	return dockercontainer.Config{
		Image:        getImageName(rco.Image),
		User:         rco.User,
		Env:          rco.Env,
		Entrypoint:   rco.Entrypoint,
		OpenStdin:    rco.Stdin != nil,
		StdinOnce:    rco.Stdin != nil,
		AttachStdout: rco.Stdout != nil,
	}
}
1276805
func (c *Context) Config() string {
	f := c.cmd.Flags.Lookup("config")
	if f != nil {
		return f.Value.String()
	}
	return ""
}
754772
func NewClientWithConfig(config ClientConfig) (*Client, error) {
	c := &Client{
		config: config,
		queue:  make([]*Message, 0),

		msgChan:  make(chan *Message, 500),
		queueCtl: make(chan int),
		sendCtl:  make(chan int),
	}

	host, err := os.Hostname()
	if err != nil {
		return nil, err
	}
	c.hostname = host

	return c, nil
}
1238576
func (p *Plan) RunWithConfig(address string, conf *consulapi.Config) error {
	// Setup the client
	p.address = address
	if conf == nil {
		conf = consulapi.DefaultConfig()
	}
	conf.Address = address
	conf.Datacenter = p.Datacenter
	conf.Token = p.Token
	client, err := consulapi.NewClient(conf)
	if err != nil {
		return fmt.Errorf("Failed to connect to agent: %v", err)
	}

	// Create the logger
	output := p.LogOutput
	if output == nil {
		output = os.Stderr
	}
	logger := log.New(output, "", log.LstdFlags)

	return p.RunWithClientAndLogger(client, logger)
}
902198
func MiddlewareWithConfig(config Config) echo.MiddlewareFunc {
	// Defaults
	if config.Skipper == nil {
		config.Skipper = DefaultConfig.Skipper
	}

	return func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {
			if config.Skipper(c) || config.CheckPermission(c) {
				return next(c)
			}

			return echo.ErrForbidden
		}
	}
}
213812
func (p *Project) CreateWithConfig(image string, containerConfig ContainerConfig) (types.ContainerJSON, error) {
	err := p.ensureImageExists(image, false)
	if err != nil {
		return types.ContainerJSON{}, err
	}

	labels := mergeLabels(p.Labels, containerConfig.Labels)
	config := &container.Config{
		Image:  image,
		Labels: labels,
	}

	if len(containerConfig.Entrypoint) > 0 {
		config.Entrypoint = strslice.StrSlice(containerConfig.Entrypoint)
	}
	if len(containerConfig.Cmd) > 0 {
		config.Cmd = strslice.StrSlice(containerConfig.Cmd)
	}

	var containerName string
	if containerConfig.Name != "" {
		containerName = containerConfig.Name
	} else {
		containerName = fmt.Sprintf("kermit_%s", randSeq(10))
	}

	response, err := p.Client.ContainerCreate(context.Background(), config, &container.HostConfig{}, nil, containerName)
	if err != nil {
		return types.ContainerJSON{}, err
	}

	return p.Inspect(response.ID)
}
1335320
func WithConfigDir(ctx context.Context, cfgdir string) context.Context {
	return context.WithValue(ctx, ctxKeyConfigDir, cfgdir)
}
286940
func (t *Template) WithEnv(e map[string]string) *Template {
	t.fields[env] = e
	return t
}
605730
func NewWithConfig(c Config) (*HLLPP, error) {
	if c.Precision == 0 {
		c.Precision = 14
	}

	if c.SparsePrecision == 0 {
		c.SparsePrecision = 20
	}

	p, pp := c.Precision, c.SparsePrecision
	if p < 4 || p > 16 || pp < p || pp > 25 {
		return nil, fmt.Errorf("invalid precision (p: %d, p': %d)", p, pp)
	}

	return &HLLPP{
		p:      p,
		pp:     pp,
		m:      1 << p,
		mp:     1 << pp,
		sparse: true,
	}, nil
}
383322
func (p *Project) StartWithConfig(image string, containerConfig ContainerConfig) (types.ContainerJSON, error) {
	container, err := p.CreateWithConfig(image, containerConfig)
	if err != nil {
		return types.ContainerJSON{}, err
	}

	if err := p.Client.ContainerStart(context.Background(), container.ID, types.ContainerStartOptions{}); err != nil {
		return container, err
	}

	return p.Inspect(container.ID)
}