<commit_before>#!/bin/bash

pushd ${BASH_SOURCE%/*} > /dev/null
if [ -s juxta.conf ]; then
    source juxta.conf
fi
JUXTA_HOME=`pwd`
popd > /dev/null
if [ -s juxta.conf ]; then # Also look for configuration in calling folder
    source juxta.conf
fi
if [ -s "$JUXTA_CONF" ]; then # And see if the caller specified the configuration
    source "$JUXTA_CONF"
fi

# Maximum number of threads to use for processing
: ${THREADS:=1}

# Don't change this unless you know what you are doing
: ${TILE_SIDE:=256}
# Hex RGB for background, when the aspect ration for an image does not fit
: ${BACKGROUND:=cccccc}
: ${TEMPLATE:="$JUXTA_HOME/web/presentation.template.html"}
# Free space (in pixels) around each raw image
: ${MARGIN:=5}
: ${FORMAT:=jpg}
: ${TILE_FORMAT:=$FORMAT}
# Quality only applicable to JPG
: ${QUALITY:=80}
: ${TILE_QUALITY:=$QUALITY}

# The size of the raw (fully zoomed) images, measured in 256x256 pixel tiles.
# RAW_W=4 and RAW_H=3 means (4*256)x(3*256) = 1024x768 pixels.
: ${RAW_W:=4}
: ${RAW_H:=3}

# The preferable aspect ratio of the virtual canvas.
# Note that this is not guaranteed to be exact.
: ${CANVAS_ASPECT_W:=1}
: ${CANVAS_ASPECT_H:=1}

# Controls log level
: ${VERBOSE:=true}

# Ignore missing source images
: ${IGNORE_MISSING:=false}

: ${DEST:=tiles}
if [ ! "." == ".$2" ]; then
    DEST="$2"
fi

# Where to get OpenSeadragon
: ${OSD_ZIP:="openseadragon-bin-1.0.0.zip"}
: ${OSD_URL:="http://github.com/openseadragon/openseadragon/releases/download/v1.0.0/$OSD_ZIP"}

fetch_dragon() {
    if [ -s $JUXTA_HOME/osd/$OSD_ZIP ]; then
        return
    fi
    mkdir -p $JUXTA_HOME/osd/
    echo "  - Fetching $OSD_ZIP from $OSD_URL"
    curl -m 3600 "$OSD_URL" > $JUXTA_HOME/osd/$OSD_ZIP
    if [ ! -s $JUXTA_HOME/osd/$OSD_ZIP ]; then
        >&2 echo "Error: Unable to fetch OpenSeadragon from $OSD_URL"<commit_msg>Bumped OpenSeadragon to 2.2.1 (latest stable)<commit_after>#!/bin/bash

pushd ${BASH_SOURCE%/*} > /dev/null
if [ -s juxta.conf ]; then
    source juxta.conf
fi
JUXTA_HOME=`pwd`
popd > /dev/null
if [ -s juxta.conf ]; then # Also look for configuration in calling folder
    source juxta.conf
fi
if [ -s "$JUXTA_CONF" ]; then # And see if the caller specified the configuration
    source "$JUXTA_CONF"
fi

# Maximum number of threads to use for processing
: ${THREADS:=1}

# Don't change this unless you know what you are doing
: ${TILE_SIDE:=256}
# Hex RGB for background, when the aspect ration for an image does not fit
: ${BACKGROUND:=cccccc}
: ${TEMPLATE:="$JUXTA_HOME/web/presentation.template.html"}
# Free space (in pixels) around each raw image
: ${MARGIN:=5}
: ${FORMAT:=jpg}
: ${TILE_FORMAT:=$FORMAT}
# Quality only applicable to JPG
: ${QUALITY:=80}
: ${TILE_QUALITY:=$QUALITY}

# The size of the raw (fully zoomed) images, measured in 256x256 pixel tiles.
# RAW_W=4 and RAW_H=3 means (4*256)x(3*256) = 1024x768 pixels.
: ${RAW_W:=4}
: ${RAW_H:=3}

# The preferable aspect ratio of the virtual canvas.
# Note that this is not guaranteed to be exact.
: ${CANVAS_ASPECT_W:=1}
: ${CANVAS_ASPECT_H:=1}

# Controls log level
: ${VERBOSE:=true}

# Ignore missing source images
: ${IGNORE_MISSING:=false}

: ${DEST:=tiles}
if [ ! "." == ".$2" ]; then
    DEST="$2"
fi

# Where to get OpenSeadragon
: ${OSD_ZIP:="openseadragon-bin-2.2.1.zip"}
: ${OSD_URL:="http://github.com/openseadragon/openseadragon/releases/download/v2.2.1/$OSD_ZIP"}

fetch_dragon() {
    if [ -s $JUXTA_HOME/osd/$OSD_ZIP ]; then
        return
    fi
    mkdir -p $JUXTA_HOME/osd/
    echo "  - Fetching $OSD_ZIP from $OSD_URL"
    curl -m 3600 "$OSD_URL" > $JUXTA_HOME/osd/$OSD_ZIP
    if [ ! -s $JUXTA_HOME/osd/$OSD_ZIP ]; then
        >&2 echo "Error: Unable to fetch OpenSeadragon from $OSD_URL"
{'fraction_non_alphanumeric': 0.1506186121570737, 'fraction_numerical': 0.02608929532006455, 'mean_word_length': 4.025675675675676, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1099205', 'n_tokens_mistral': 1564, 'n_tokens_neox': 1429, 'n_words': 388}