<commit_before>package main

import (
	"encoding/json"
	"fmt"
	"os"
	"text/tabwriter"

	"github.com/urfave/cli"
)

var psCommand = cli.Command{
	Name:      "ps",
	Usage:     "ps displays the processes running inside a container",
	ArgsUsage: `<container-id> [ps options]`, Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "format, f",
			Value: "table",
			Usage: `select one of: ` + formatOptions,
		},
	},
	Before: func(context *cli.Context) error {
		return cmdPrepare(context, false, false)
	},
	Action: func(context *cli.Context) error {
		container := context.Args().First()
		if container == "" {
			return cli.NewExitError("container id cannot be empty", -1)
		}
		pids, err := getProcessList(context, container)
		if err != nil {
			return cli.NewExitError(fmt.Sprintf("can't access container, %v", err), -1)
		}

		switch context.String("format") {
		case "table":
			w := tabwriter.NewWriter(os.Stdout, 12, 1, 3, ' ', 0)
			fmt.Fprint(w, "PROCESS\tCMD\n")
			for _, p := range pids {
				fmt.Fprintf(w, "%s\t%s\n",
					p,
					"todo process.Args")
			}
			if err := w.Flush(); err != nil {
				fatal(err)
			}
		case "json":
			pids := make([]string, 0)

			data, err := json.Marshal(pids)
			if err != nil {
				fatal(err)
			}
			os.Stdout.Write(data)
			return nil
		default:
			return cli.NewExitError(fmt.Sprintf("invalid format option"), -1)
		}

		return nil
	},
}
<commit_msg>cli: do not fake pids is runv ps<commit_after>package main

import (
	"encoding/json"
	"fmt"
	"os"
	"text/tabwriter"

	"github.com/urfave/cli"
)

var psCommand = cli.Command{
	Name:      "ps",
	Usage:     "ps displays the processes running inside a container",
	ArgsUsage: `<container-id> [ps options]`, Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "format, f",
			Value: "table",
			Usage: `select one of: ` + formatOptions,
		},
	},
	Before: func(context *cli.Context) error {
		return cmdPrepare(context, false, false)
	},
	Action: func(context *cli.Context) error {
		container := context.Args().First()
		if container == "" {
			return cli.NewExitError("container id cannot be empty", -1)
		}
		pids, err := getProcessList(context, container)
		if err != nil {
			return cli.NewExitError(fmt.Sprintf("can't access container, %v", err), -1)
		}

		switch context.String("format") {
		case "table":
			w := tabwriter.NewWriter(os.Stdout, 12, 1, 3, ' ', 0)
			fmt.Fprint(w, "PROCESS\tCMD\n")
			for _, p := range pids {
				fmt.Fprintf(w, "%s\t%s\n",
					p,
					"todo process.Args")
			}
			if err := w.Flush(); err != nil {
				fatal(err)
			}
		case "json":
			data, err := json.Marshal(pids)
			if err != nil {
				fatal(err)
			}
			os.Stdout.Write(data)
			return nil
		default:
			return cli.NewExitError(fmt.Sprintf("invalid format option"), -1)
		}

		return nil
	},
}

{'fraction_non_alphanumeric': 0.16492617933021245, 'fraction_numerical': 0.006121714079942384, 'mean_word_length': 3.1462686567164178, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '586872', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1031, 'n_words': 258}