<commit_before># bash

equals_var() {
  declare -p $1 >/dev/null 2>&1 || return 1
  declare -p $2 >/dev/null 2>&1 || return 1
  declare -n equals_var__left=$1
  declare -n equals_var__right=$2
  # 非配列
  if [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*[aA]' | wc -l) == 0 ]]; then
    [[ $equals_var__left == $equals_var__right ]]; return $?
  fi
  # 配列or連想配列
  [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*a' | wc -l) == [02] ]] || return 1
  [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*A' | wc -l) == [02] ]] || return 1
  [[ ${#equals_var__left[@]} == ${#equals_var__right[@]} ]] || return 1
  local idx
  for idx in "${!equals_var__left[@]}"; do
    [[ ${equals_var__left[$idx]} == ${equals_var__right[$idx]} ]] || return 1
  done
  for idx in "${!equals_var__right[@]}"; do
    [[ ${equals_var__left[$idx]} == ${equals_var__right[$idx]} ]] || return 1
  done
}<commit_msg>Support bash version is less than 4.3<commit_after># bash

equals_var() {
  declare -p $1 >/dev/null 2>&1 || return 1
  declare -p $2 >/dev/null 2>&1 || return 1
  if true || [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then
    eval "$(declare -p "$1" | perl -pe's/\S+?=/equals_var__left=/')"
    eval "$(declare -p "$2" | perl -pe's/\S+?=/equals_var__right=/')"
  else
    declare -n equals_var__left=$1
    declare -n equals_var__right=$2
  fi
  # 非配列
  if [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*[aA]' | wc -l) == 0 ]]; then
    [[ $equals_var__left == $equals_var__right ]]; return $?
  fi
  # 配列or連想配列
  [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*a' | wc -l) == [02] ]] || return 1
  [[ $(declare -p $1 $2 | grep -E '^declare -[^ ]*A' | wc -l) == [02] ]] || return 1
  [[ ${#equals_var__left[@]} == ${#equals_var__right[@]} ]] || return 1
  local idx
  for idx in "${!equals_var__left[@]}"; do
    [[ ${equals_var__left[$idx]} == ${equals_var__right[$idx]} ]] || return 1
  done
  for idx in "${!equals_var__right[@]}"; do
    [[ ${equals_var__left[$idx]} == ${equals_var__right[$idx]} ]] || return 1
  done
}
{'fraction_non_alphanumeric': 0.24067796610169492, 'fraction_numerical': 0.03002421307506053, 'mean_word_length': 3.349473684210526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6381534', 'n_tokens_mistral': 912, 'n_tokens_neox': 842, 'n_words': 219}