<commit_before>#!/bin/bash
filea=$(mktemp)
fileb=$(mktemp)
copya=$(mktemp)
for i in $(cut -f1 -d',' dynamic.csv | grep . | tail --lines=+2)
do
  seq --format=",$i,%g,," 1 14 | tee -a "$filea" >> "$fileb"
done
cp "$filea" "$copya"
while IFS= read -r line
do
  IFS=, read n attr val n n <<< "$line"
  if [ ".$n." == ".." ]
  then
    n=
  fi
  attr=$(echo "$line" | cut -f2 -d',')
  val=$(echo "$line" | cut -f3 -d',')
  insert=$(grep . "$fileb" | grep -vw "$attr" | sort -R | head -1)
  iat=$(echo "$insert" | cut -f2 -d',')
  ival=$(echo "$insert" | cut -f3 -d',')
  sed -i -e "s/$insert//g" "$fileb"
  sed -i -e "s/^,$attr,$val,,$/,$attr,$val,$iat,$ival,,/g" "$filea"
done < "$copya"
cp "$filea" "$1"
rm -f "$filea" "$fileb" "$copya"<commit_msg>Change constants to variables<commit_after>#!/bin/bash
filea=$(mktemp)
fileb=$(mktemp)
copya=$(mktemp)
outfile=outcards.csv
max=14
for i in $(cut -f1 -d',' dynamic.csv | grep . | tail --lines=+2)
do
  seq --format=",$i,%g,," 1 "$max" | tee -a "$filea" >> "$fileb"
done
cp "$filea" "$copya"
while IFS= read -r line
do
  IFS=, read n attr val n n <<< "$line"
  if [ ".$n." == ".." ]
  then
    n=
  fi
  attr=$(echo "$line" | cut -f2 -d',')
  val=$(echo "$line" | cut -f3 -d',')
  insert=$(grep . "$fileb" | grep -vw "$attr" | sort -R | head -1)
  iat=$(echo "$insert" | cut -f2 -d',')
  ival=$(echo "$insert" | cut -f3 -d',')
  sed -i -e "s/$insert//g" "$fileb"
  sed -i -e "s/^,$attr,$val,,$/,$attr,$val,$iat,$ival,,/g" "$filea"
done < "$copya"
cp "$filea" "$outfile"
rm -f "$filea" "$fileb" "$copya"
{'fraction_non_alphanumeric': 0.2807244501940492, 'fraction_numerical': 0.013583441138421734, 'mean_word_length': 3.215258855585831, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '1911521', 'n_tokens_mistral': 710, 'n_tokens_neox': 680, 'n_words': 194}