<commit_before>
some_file() { local base="$1"; shift; find -H "$base" ! -path "$base" "$@" -print -quit; }

dir_full() { local base="$1"; shift; test "$(cd "$base" &>/dev/null && find -H . -maxdepth 1 ! -path . "$@" -print -quit)"; }

dir_not_empty() { test "$(ls -A "$@" 2>/dev/null)" ;}

dir_empty() { find -H "$1" -maxdepth 0 -empty | read v ;}

dir_count() { test -d "$1" && echo $(( $(\ls -afq "$1" 2>/dev/null | wc -l )  -2 )) ;}

existing_path() {
  local path="$1"
  until [[ $path == '.' || -e $path ]]; do
    path=$(dirname $path)
  done
  echo $path
}

path_owner() {
  local path="$(existing_path "$1")"
  echo $(stat -c '%U' $path)
}

safe_rm() {
  local suffix=".saferm"
  for i in "$@"; do
    test '/' = "$i" && echo "Invalid path: '$i'" && return 1
    test -e "$i" || continue
    echo "Removing '$i'..." && mv "$i" "$i$suffix" && rm -rf "$i$suffix" || return
  done
  return 0
}<commit_msg>dir_not_empty: Use `\ls` to avoid aliases<commit_after>
some_file() { local base="$1"; shift; find -H "$base" ! -path "$base" "$@" -print -quit; }

dir_full() { local base="$1"; shift; test "$(cd "$base" &>/dev/null && find -H . -maxdepth 1 ! -path . "$@" -print -quit)"; }

dir_not_empty() { test "$(\ls -A "$@" 2>/dev/null)" ;}

dir_empty() { find -H "$1" -maxdepth 0 -empty | read v ;}

dir_count() { test -d "$1" && echo $(( $(\ls -afq "$1" 2>/dev/null | wc -l )  -2 )) ;}

existing_path() {
  local path="$1"
  until [[ $path == '.' || -e $path ]]; do
    path=$(dirname $path)
  done
  echo $path
}

path_owner() {
  local path="$(existing_path "$1")"
  echo $(stat -c '%U' $path)
}

safe_rm() {
  local suffix=".saferm"
  for i in "$@"; do
    test '/' = "$i" && echo "Invalid path: '$i'" && return 1
    test -e "$i" || continue
    echo "Removing '$i'..." && mv "$i" "$i$suffix" && rm -rf "$i$suffix" || return
  done
  return 0
}
{'fraction_non_alphanumeric': 0.2601406165494862, 'fraction_numerical': 0.015143320713899405, 'mean_word_length': 2.952991452991453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1006303', 'n_tokens_mistral': 765, 'n_tokens_neox': 730, 'n_words': 219}