<commit_before>
#-------------------------------------------------

# cd into the directory of the given filename
function cdf() {
  cd $(dirname $1)
}

#-------------------------------------------------

# overwrites behavior of 'cd'
function cd_pushd() {
  local dest=${1:-"$HOME"}
  if [ -f "$dest" ]; then
    cdf "$dest"
  else
    pushd "$dest" >/dev/null
  fi
}
alias cd="cd_pushd"

#-------------------------------------------------

# pick from directories in $HOME/.gorc and cd into it
function go() {
  if [ ! -f $HOME/.gorc ]; then
    echo "$HOME/.gorc does not exist..."
    return 1
  fi

  pick_with_vim "cat $HOME/.gorc" "cd" $1
}

# HELPER -- append to .gorc
alias mark_dir='echo $PWD >> $HOME/.gorc'

#-------------------------------------------------

# pick from directories visited in this session and cd into it
function tb() {
  pick_with_vim "dirs -l -p" "cd"
}

#-------------------------------------------------

# HELPER -- generate the list of parent directories
function parent_dirs() {
  local path="${1:-$PWD}"

  while [ "$path" != "/" ]; do
    echo "$path"
    path=`dirname "$path"`
  done
}

# pick from parent directories and cd into it
function b() {
  if [ "$1" == "-" ]; then
    local level=""
  else
    local level="${1:-1}"
  fi

  pick_with_vim "parent_dirs | sed 1d" "cd" $level
}

#-------------------------------------------------

# pick from a list of directories (recursive) and cd into it
function c() {
  pick_with_vim "ftd" "cd"
}

#-------------------------------------------------

# set a HOT directory -- default is current directory
function gh_() {
  echo ${1-$PWD} > $HOME/.gh_dest
}

# cd to HOT directory
function gh() {
  local dest_file="$HOME/.gh_dest"

  if [ ! -e "$dest_file" ]; then
    echo "could not find $dest_file..."
    return 1
  fi

  local dest=`cat $HOME/.gh_dest`
  cd $dest
}

<commit_msg>bash: better usability for 'b' function<commit_after>
#-------------------------------------------------

# cd into the directory of the given filename
function cdf() {
  cd $(dirname $1)
}

#-------------------------------------------------

# overwrites behavior of 'cd'
function cd_pushd() {
  local dest=${1:-"$HOME"}
  if [ -f "$dest" ]; then
    cdf "$dest"
  else
    pushd "$dest" >/dev/null
  fi
}
alias cd="cd_pushd"

#-------------------------------------------------

# pick from directories in $HOME/.gorc and cd into it
function go() {
  if [ ! -f $HOME/.gorc ]; then
    echo "$HOME/.gorc does not exist..."
    return 1
  fi

  pick_with_vim "cat $HOME/.gorc" "cd" $1
}

# HELPER -- append to .gorc
alias mark_dir='echo $PWD >> $HOME/.gorc'

#-------------------------------------------------

# pick from directories visited in this session and cd into it
function tb() {
  pick_with_vim "dirs -l -p" "cd"
}

#-------------------------------------------------

# HELPER -- generate the list of parent directories
function parent_dirs() {
  local path="${1:-$PWD}"

  while [ "$path" != "/" ]; do
    echo "$path"
    path=`dirname "$path"`
  done
}

# pick from parent directories and cd into it
function b() {
  pick_with_vim "parent_dirs" "cd" $1
}

#-------------------------------------------------

# pick from a list of directories (recursive) and cd into it
function c() {
  pick_with_vim "ftd" "cd"
}

#-------------------------------------------------

# set a HOT directory -- default is current directory
function gh_() {
  echo ${1-$PWD} > $HOME/.gh_dest
}

# cd to HOT directory
function gh() {
  local dest_file="$HOME/.gh_dest"

  if [ ! -e "$dest_file" ]; then
    echo "could not find $dest_file..."
    return 1
  fi

  local dest=`cat $HOME/.gh_dest`
  cd $dest
}


{'fraction_non_alphanumeric': 0.31083287969515516, 'fraction_numerical': 0.005171475231355471, 'mean_word_length': 1.5397373876986868, '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': '3172444', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1115, 'n_words': 368}