<commit_before>#@IgnoreInspection BashAddShebang
# Aliases and functions to make using the build tools within Docker easier.
#
# Source this file from within your .bashrc, .bash_profile or .zshrc file.
#
#    . /path/to/build-tooling/docker/aliases.sh

# Set BUILD_TOOL_DOCKER_TAG to a different tag (e.g., "snapshot") to use
# a different tag.

: ${BUILD_TOOL_DOCKER_TAG:=latest}

for i in bdc databricks gendbc master_parse course dbe
do
  unalias $i 2>/dev/null
  unset -f $i 2>/dev/null
done

function dbe {
  usage="dbe [latest|snapshot]"
  case $# in
    1)
      case "$1" in
        latest|snapshot)
          export BUILD_TOOL_DOCKER_TAG=$1
          dbe
          ;;
        *)
          echo "$usage" >&2
          return 1
          ;;
      esac
      ;;

    0)
      image=databrickseducation/build-tool:${BUILD_TOOL_DOCKER_TAG:-latest}
      echo "Using build tools in Docker image $image"
      ;;

    *)
      echo "$usage" >&1
      return 1
      ;;
  esac
  return 0
}

function bdc {
  docker run -it --rm -w `pwd` -e DB_SHARD_HOME=$DB_SHARD_HOME \
             -e HOME=$HOME -v $HOME:$HOME \
             databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG bdc "$@"
}

function databricks {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG databricks "$@"
}

function gendbc {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG gendbc "$@"
}

function master_parse {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG master_parse "$@"
}

COURSE_ENV_VARS="DB_CONFIG_PATH DB_PROFILE DB_SHARD_HOME COURSE_NAME COURSE_REPO COURSE_HOME COURSE_YAML COURSE_MODULES COURSE_REMOTE_SOURCE COURSE_REMOTE_TARGET PREFIX SOURCE TARGET EDITOR PAGER LESS LESSCHARSET USER"

unset -f create_course_envfile 2>/dev/null

function create_course_envfile {
  : ${1?'Missing file name'}
  egrep=`echo $COURSE_ENV_VARS | sed 's/ /|/g'`
  env | egrep "$egrep" >$1
}

# The course tool can look at a lot of environment variables. To ease passing
# the entire environment into the tool, this "alias" is defined as a function.

function course {

  : ${BUILD_TOOL_DOCKER_TAG:=latest}

  TMP_ENV=/tmp/course-env.$$

  create_course_envfile $TMP_ENV

  docker run -it --rm -w `pwd` --env-file $TMP_ENV -e HOME=$HOME -v $HOME:$HOME databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG course "$@"

  rm -f $TMP_ENV
}

function update_tools {
  curl -L https://git.io/fhaLg | bash
}

<commit_msg>Added update-tools aliases, allowing both update_tools and update-tools. Added both to the unset logic at the top.<commit_after>#@IgnoreInspection BashAddShebang
# Aliases and functions to make using the build tools within Docker easier.
#
# Source this file from within your .bashrc, .bash_profile or .zshrc file.
#
#    . /path/to/build-tooling/docker/aliases.sh

# Set BUILD_TOOL_DOCKER_TAG to a different tag (e.g., "snapshot") to use
# a different tag.

: ${BUILD_TOOL_DOCKER_TAG:=latest}

for i in bdc databricks gendbc master_parse course dbe \
         update_tools update-tools
do
  unalias $i 2>/dev/null
  unset -f $i 2>/dev/null
done

function dbe {
  usage="dbe [latest|snapshot]"
  case $# in
    1)
      case "$1" in
        latest|snapshot)
          export BUILD_TOOL_DOCKER_TAG=$1
          dbe
          ;;
        *)
          echo "$usage" >&2
          return 1
          ;;
      esac
      ;;

    0)
      image=databrickseducation/build-tool:${BUILD_TOOL_DOCKER_TAG:-latest}
      echo "Using build tools in Docker image $image"
      ;;

    *)
      echo "$usage" >&1
      return 1
      ;;
  esac
  return 0
}

function bdc {
  docker run -it --rm -w `pwd` -e DB_SHARD_HOME=$DB_SHARD_HOME \
             -e HOME=$HOME -v $HOME:$HOME \
             databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG bdc "$@"
}

function databricks {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG databricks "$@"
}

function gendbc {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG gendbc "$@"
}

function master_parse {
  docker run -it --rm -w `pwd` -e HOME=$HOME -v $HOME:$HOME \
    databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG master_parse "$@"
}

COURSE_ENV_VARS="DB_CONFIG_PATH DB_PROFILE DB_SHARD_HOME COURSE_NAME COURSE_REPO COURSE_HOME COURSE_YAML COURSE_MODULES COURSE_REMOTE_SOURCE COURSE_REMOTE_TARGET PREFIX SOURCE TARGET EDITOR PAGER LESS LESSCHARSET USER"

unset -f create_course_envfile 2>/dev/null

function create_course_envfile {
  : ${1?'Missing file name'}
  egrep=`echo $COURSE_ENV_VARS | sed 's/ /|/g'`
  env | egrep "$egrep" >$1
}

# The course tool can look at a lot of environment variables. To ease passing
# the entire environment into the tool, this "alias" is defined as a function.

function course {

  : ${BUILD_TOOL_DOCKER_TAG:=latest}

  TMP_ENV=/tmp/course-env.$$

  create_course_envfile $TMP_ENV

  docker run -it --rm -w `pwd` --env-file $TMP_ENV -e HOME=$HOME -v $HOME:$HOME databrickseducation/build-tool:$BUILD_TOOL_DOCKER_TAG course "$@"

  rm -f $TMP_ENV
}

function update_tools {
  curl -L https://git.io/fhaLg | bash
}

alias update-tools=update_tools


{'fraction_non_alphanumeric': 0.11185557416713196, 'fraction_numerical': 0.005211241392145915, 'mean_word_length': 3.1370284834488067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '4180030', 'n_tokens_mistral': 2102, 'n_tokens_neox': 1932, 'n_words': 512}