// getStdinPipe returns nil if the context's stdin is not a pipe.
963408
func getStdinPipe(ctx *cmd.Context) (io.Reader, error) {
	if stdIn, ok := ctx.Stdin.(*os.File); ok && !terminal.IsTerminal(int(stdIn.Fd())) {
		// stdIn from pipe but not terminal
		stat, err := stdIn.Stat()
		if err != nil {
			return nil, err
		}
		content, err := ioutil.ReadAll(stdIn)
		if err != nil {
			return nil, err
		}
		if (stat.Mode()&os.ModeCharDevice) == 0 && len(content) > 0 {
			// workaround to get piped stdIn size because stat.Size() always == 0
			return bytes.NewReader(content), nil
		}
	}
	return nil, nil
}
660160
func getPipelineConfigCommand() *cli.Command {
	return &cli.Command{
		Name:     GetPipelineConfigCommandName,
		Usage:    GetPipelineConfigCommandUsage,
		Action:   ActionWrapper(getPipelineConfigAction),
		Category: "Pipeline Configs",
		Flags: []cli.Flag{
			cli.StringFlag{Name: "name"},
		},
	}
}
923439
func GetStdLogger(inj inject.Injector) StdLogger {
	if loggerType := inj.Get(inject.InterfaceOf((*StdLogger)(nil))); loggerType.IsValid() {
		logger := loggerType.Interface().(StdLogger)
		return logger
	}
	return DefaultLogger
}
815396
func getPipelineTemplateCommand() *cli.Command {
	return &cli.Command{
		Name:     GetPipelineTemplateCommandName,
		Usage:    GetPipelineTemplateCommandUsage,
		Action:   ActionWrapper(getPipelineTemplateAction),
		Category: "Pipeline Templates",
		Flags: []cli.Flag{
			cli.StringFlag{Name: "template-name", Usage: "Name of the Pipeline Template configuration."},
		},
	}
}
939092
func (konsolePipe *ConsolePipe) Pipe(input string) error {
	if !golfilesystem.PathExists(konsolePipe.PipePath) {
		return fmt.Errorf("%s path doesn't exists!", konsolePipe.PipePath)
	}
	cmd := fmt.Sprintf("echo '%s' > %s", input, konsolePipe.PipePath)
	ExecOutput(cmd)
	return nil
}
379176
func (c AccountClient) EnterResetPipeline(ctx context.Context, __arg EnterResetPipelineArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.account.enterResetPipeline", []interface{}{__arg}, nil)
	return
}
210560
func (c *Component) GetContext(token string) context.Context {
	if c.Context == nil {
		c.initBgCtx()
	}
	ctx := c.Context
	if token == "" && c.Identity != nil {
		token, _ = c.BuildJWT()
	}
	ctx = ttnctx.OutgoingContextWithToken(ctx, token)
	return ctx
}
973970
func GetIntelRdtPath(id string) (string, error) {
	rootPath, err := getIntelRdtRoot()
	if err != nil {
		return "", err
	}

	path := filepath.Join(rootPath, id)
	return path, nil
}
792967
func (r RedisPipeline) Get(key string) *redis.StringCmd {
	return r.pipeline.Get(key)
}
1098893
func (pg *PipelineGroups) GetGroupByPipelineName(pipelineName string) *PipelineGroup {
	for _, pipelineGroup := range *pg {
		for _, pipeline := range pipelineGroup.Pipelines {
			if pipeline.Name == pipelineName {
				return pipelineGroup
			}
		}
	}
	return nil
}
406666
func (c *ContainerIO) Pipe() {
	wg := c.closer.wg
	wg.Add(1)
	go func() {
		if _, err := io.Copy(c.stdoutGroup, c.stdout); err != nil {
			logrus.WithError(err).Errorf("Failed to pipe stdout of container %q", c.id)
		}
		c.stdout.Close()
		c.stdoutGroup.Close()
		wg.Done()
		logrus.Infof("Finish piping stdout of container %q", c.id)
	}()

	if !c.fifos.Terminal {
		wg.Add(1)
		go func() {
			if _, err := io.Copy(c.stderrGroup, c.stderr); err != nil {
				logrus.WithError(err).Errorf("Failed to pipe stderr of container %q", c.id)
			}
			c.stderr.Close()
			c.stderrGroup.Close()
			wg.Done()
			logrus.Infof("Finish piping stderr of container %q", c.id)
		}()
	}
}
917605
func (md *RootMetadata) GetTlfHandle() *tlfhandle.Handle {
	if md.tlfHandle == nil {
		panic(fmt.Sprintf("RootMetadata %v with no handle", md))
	}

	return md.tlfHandle
}
933930
func (dfs *DistributedFilesystem) imageLoadPipe() (*io.PipeWriter, <-chan error) {
	return loadPipe(dfs.docker.LoadImage)
}
320412
func (d *Context) GetBuffer(index int) (rawPtr unsafe.Pointer, outSize uint) {
	rawPtr = C.duk_get_buffer(d.duk_context, C.duk_idx_t(index), (*C.duk_size_t)(unsafe.Pointer(&outSize)))
	return rawPtr, outSize
}
217645
func getPipelineCommand() *cli.Command {
	return &cli.Command{
		Name:     GetPipelineCommandName,
		Usage:    GetPipelineCommandUsage,
		Category: "Pipelines",
		Flags: []cli.Flag{
			cli.StringFlag{Name: "name"},
		},
		Action: ActionWrapper(getPipelineAction),
	}
}
475747
func GetFdInfo(in interface{}) (uintptr, bool) {
	var inFd uintptr
	var isTerminalIn bool
	if file, ok := in.(*os.File); ok {
		inFd = file.Fd()
		isTerminalIn = IsTerminal(inFd)
	}
	return inFd, isTerminalIn
}
165377
func (t *Template) GetAllAWSCodePipelinePipelineResources() map[string]*resources.AWSCodePipelinePipeline {
	results := map[string]*resources.AWSCodePipelinePipeline{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSCodePipelinePipeline:
			results[name] = resource
		}
	}
	return results
}