<commit_before>#!/bin/sh

NAME="$(basename ${PWD})"
SCRIPT="$(basename $0)"

die() {
  local r=$?
  if [ "" != "$*" ]; then
    echo "$*"
  fi
  exit $r
}

if [ "" = "$(grep "AC_INIT(${NAME}" configure.ac 2>/dev/null)" ]; then
  false
  die "${SCRIPT} must be run in top source directory"
fi

DEBUG=""
D() {
  if [ "" != "${DEBUG}" ]; then
    echo "D/ $*"
  fi
}

CPR="Copyright (c)"
CPN="COPYING"

TMP1=""
TMP2=""

cleanup() {
  local r=$?
  echo "cleaning up"
  if [ "" != "${TMP1}" ]; then
    D "removing ${TMP1}"
    rm -f ${TMP1}
  fi
  if [ "" != "${TMP2}" ]; then
    D "removing ${TMP2}"
    rm -f ${TMP2}
  fi
  exit $r
}

signint() {
  echo "Caught ^C. cleaning up.."
  cleanup
}

trap cleanup SIGHUP SIGTERM SIGQUIT SIGABRT || die "failed to install error handler"
trap sigint SIGINT || die "failed to install SIGINT handler"

sleep 20

apply_copyright() {
	local extensions=${1}
	local prefix=${2}<commit_msg>improved update_copyrights.sh<commit_after>#!/bin/sh

NAME="$(basename ${PWD})"
SCRIPT="$(basename $0)"

die() {
  local r=$?
  if [ "" != "$*" ]; then
    echo "$*"
  fi
  exit $r
}

if [ "" = "$(grep "AC_INIT(${NAME}" configure.ac 2>/dev/null)" ]; then
  false
  die "${SCRIPT} must be run in top source directory"
fi

DEBUG=""
D() {
  if [ "" != "${DEBUG}" ]; then
    echo "D/ $*"
  fi
}

CPR="Copyright (c)"
CPN="COPYING"

TMP1=""
TMP2=""

cleanup() {
  local r=$?
  echo "cleaning up"
  if [ "" != "${TMP1}" ]; then
    D "removing ${TMP1}"
    rm -f ${TMP1}
  fi
  if [ "" != "${TMP2}" ]; then
    D "removing ${TMP2}"
    rm -f ${TMP2}
  fi
  exit $r
}

sigint() {
  echo "Caught ^C. cleaning up.."
  cleanup
}

trap cleanup SIGHUP SIGTERM SIGQUIT SIGABRT || die "failed to install error handler"
trap sigint SIGINT || die "failed to install SIGINT handler"

sleep 20

apply_copyright() {
	local extensions=${1}
	local prefix=${2}
{'fraction_non_alphanumeric': 0.2058033315421816, 'fraction_numerical': 0.015045674368619023, 'mean_word_length': 3.1655480984340043, 'pattern_counts': {'":': 0, '<': 3, '<?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': '195208', 'n_tokens_mistral': 749, 'n_tokens_neox': 740, 'n_words': 214}