<commit_before># Automatically source a swarm from ${SWARM_ROOT} and then "dvm use" to sync docker client versions.
function swarmme() {
  local SWARMNAME=${1}
  local L_SWARM_ROOT=${SWARM_ROOT:-${HOME}/swarm}

  [ -z "${SWARMNAME}" ] && {
    echo "Swarms available:"
    ls ${L_SWARM_ROOT}
    return 0
  }

  local SWARM_DIR="${L_SWARM_ROOT}/${SWARMNAME}"

  [ ! -d "${SWARM_DIR}" ] || [ ! -f "${SWARM_DIR}/docker.env" ] && {
    echo "swarmme: Unrecognized swarm ${SWARMNAME}." >&2
    echo "Swarms available:" >&2
    ls ${L_SWARM_ROOT} >&2
    return 1
  }

  source ${SWARM_DIR}/docker.env
  echo "swarmme: Using swarm ${SWARMNAME}."
  dvm use<commit_msg>Use the same Swarm storage directory as Carina.<commit_after># Automatically source a swarm from ${SWARM_ROOT} and then "dvm use" to sync docker client versions.
function swarmme() {
  local SWARMNAME=${1}
  local ACCOUNTNAME=${CARINA_USERNAME:-}

  if [ -z "${ACCOUNTNAME}" ]; then
    local ACCOUNTS=$(ls ${HOME}/.carina/clusters)
    if echo ${ACCOUNTS} | grep -q ' ' ; then
      echo "swarmme: Please specify an account as \$CARINA_USERNAME." >&2
      echo "Accounts available:" >&2
      echo ${ACCOUNTS} >&2
      return 1
    else
      ACCOUNTNAME=${ACCOUNTS}
    fi
  fi

  local L_SWARM_ROOT=${SWARM_ROOT:-${HOME}/.carina/clusters/${ACCOUNTNAME}}

  [ -z "${SWARMNAME}" ] && {
    echo "Swarms available:"
    ls ${L_SWARM_ROOT}
    return 0
  }

  local SWARM_DIR="${L_SWARM_ROOT}/${SWARMNAME}"

  [ ! -d "${SWARM_DIR}" ] || [ ! -f "${SWARM_DIR}/docker.env" ] && {
    echo "swarmme: Unrecognized swarm ${SWARMNAME}." >&2
    echo "Swarms available:" >&2
    ls ${L_SWARM_ROOT} >&2
    return 1
  }

  source ${SWARM_DIR}/docker.env
  echo "swarmme: Using swarm ${SWARMNAME}."
  dvm use
{'fraction_non_alphanumeric': 0.16240772288472458, 'fraction_numerical': 0.009085746734809767, 'mean_word_length': 3.4160401002506267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '6225605', 'n_tokens_mistral': 717, 'n_tokens_neox': 642, 'n_words': 165}