<commit_before>#!/bin/bash
blue="\e[1;34m"
green="\e[1;32m"
no_colour="\e[1;0m"

REFRESH=false

function show_usage(){
    echo "get-pods"
    echo
    echo -e "\t--refresh\tkeep querying and re-displaying"
}

while [[ $# -gt 0 ]]
do
    case "$1" in 
        --refresh)
            REFRESH=refresh
            shift 1
            ;;
    esac
done

function dump_pods(){
    IFS=$'\n'
    for pod in $(kubectl get pod -l run=rolling -o json | jq -r '.items | .[] | [.metadata.name, .spec.containers[0].image, (.status.containerStatuses[0].state | keys | .[])] | @tsv' )
    do
        colour=$(echo $pod | grep -Po "(?<=:)(?:[a-z]*)")
        ansiColour=${!colour}
        echo -e "$ansiColour$pod$no_colour"
    done
}


if [ $REFRESH == refresh ]; then
    while [ 1 -eq 1 ]; do
        clear
        dump_pods
        sleep 0.5s
    done
else
    dump_pods
fi<commit_msg>clear screen after query to avoid flicker<commit_after>#!/bin/bash
blue="\e[1;34m"
green="\e[1;32m"
no_colour="\e[1;0m"

REFRESH=false

function show_usage(){
    echo "get-pods"
    echo
    echo -e "\t--refresh\tkeep querying and re-displaying"
}

while [[ $# -gt 0 ]]
do
    case "$1" in 
        --refresh)
            REFRESH=refresh
            shift 1
            ;;
    esac
done

function dump_pods(){
    # $1 is clear to clear screen

    IFS=$'\n'
    lines=$(kubectl get pod -l run=rolling -o json | jq -r '.items | .[] | [.metadata.name, .spec.containers[0].image, (.status.containerStatuses[0].state | keys | .[])] | @tsv' )
    if [ "$1" == clear ]; then
        clear
    fi
    for pod in $lines
    do
        colour=$(echo $pod | grep -Po "(?<=:)(?:[a-z]*)")
        ansiColour=${!colour}
        echo -e "$ansiColour$pod$no_colour"
    done

    # IFS=$'\n'
    # for pod in $(kubectl get pod -l run=rolling -o json | jq -r '.items | .[] | [.metadata.name, .spec.containers[0].image, (.status.containerStatuses[0].state | keys | .[])] | @tsv' )
    # do
    #     colour=$(echo $pod | grep -Po "(?<=:)(?:[a-z]*)")
    #     ansiColour=${!colour}
    #     echo -e "$ansiColour$pod$no_colour"
    # done
}


if [ "$REFRESH" == refresh ]; then
    while [ 1 -eq 1 ]; do
        dump_pods clear
        sleep 0.5s
    done
else
    dump_pods
fi
{'fraction_non_alphanumeric': 0.18112701252236135, 'fraction_numerical': 0.01699463327370304, 'mean_word_length': 2.164073550212164, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '3358995', 'n_tokens_mistral': 897, 'n_tokens_neox': 848, 'n_words': 204}