<commit_before>#!/bin/bash
HOSTNAME=dev-env
TAG=latest
DOCKER=docker
WORKDIR=$1
SESSIONID=$(cat /dev/urandom | head -c 256 | md5 | head -c 8)
MOUNTFLAGS=""

if [ -z "$IMAGE" ]; then
	IMAGE_NAME=kwketh/dev-env
	IMAGE=$IMAGE_NAME:$TAG
fi

# Set default flags
readonly='false'
mutable='false'
network='bridge'

# Parse flags
while getopts 'rnm' flag; do
  case "${flag}" in
    r) readonly='true'; WORKDIR=$2 ;;
    n) network='none'; WORKDIR=$2 ;;
    m) if [ "$readonly" = "true" ]; then
         mutable=true
       else
         echo "error: mutable option can only be used in read-only mode."
         exit
       fi
       ;;
  esac
done

# Convert work directory to full absolute path
if [ -z "$WORKDIR" ]; then
    WORKDIR=$(pwd)
else
    WORKDIR=$(realpath $WORKDIR)
fi

DIRNAME=$(basename $WORKDIR)

if [ "$readonly" = "true" ]; then
    echo "dev-env: running in read-only mode."
    MOUNTFLAGS=":ro"
fi

if [ "$network" = "none" ]; then
    echo "dev-env: running in no network mode."
    MOUNTFLAGS=":ro"
fi

if [ "$mutable" = "true" ]; then
    SESSIONDIR="$HOME/.tmp_$SESSIONID"<commit_msg>fixed a typo (no network flag would also mount as read only)fixed a typo (no network flag would also mount as read only)<commit_after>#!/bin/bash
HOSTNAME=dev-env
TAG=latest
DOCKER=docker
WORKDIR=$1
SESSIONID=$(cat /dev/urandom | head -c 256 | md5 | head -c 8)
MOUNTFLAGS=""

if [ -z "$IMAGE" ]; then
	IMAGE_NAME=kwketh/dev-env
	IMAGE=$IMAGE_NAME:$TAG
fi

# Set default flags
readonly='false'
mutable='false'
network='bridge'

# Parse flags
while getopts 'rnm' flag; do
  case "${flag}" in
    r) readonly='true'; WORKDIR=$2 ;;
    n) network='none'; WORKDIR=$2 ;;
    m) if [ "$readonly" = "true" ]; then
         mutable=true
       else
         echo "error: mutable option can only be used in read-only mode."
         exit
       fi
       ;;
  esac
done

# Convert work directory to full absolute path
if [ -z "$WORKDIR" ]; then
    WORKDIR=$(pwd)
else
    WORKDIR=$(realpath $WORKDIR)
fi

DIRNAME=$(basename $WORKDIR)

if [ "$readonly" = "true" ]; then
    echo "dev-env: running in read-only mode."
    MOUNTFLAGS=":ro"
fi

if [ "$network" = "none" ]; then
    echo "dev-env: running in no network mode."
fi

if [ "$mutable" = "true" ]; then
    SESSIONDIR="$HOME/.tmp_$SESSIONID"
{'fraction_non_alphanumeric': 0.14934497816593886, 'fraction_numerical': 0.0069868995633187774, 'mean_word_length': 3.258364312267658, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, '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': '440785', 'n_tokens_mistral': 829, 'n_tokens_neox': 793, 'n_words': 248}