<commit_before>#!/bin/bash
set -e

STATUS=0
warnings="${TMPDIR:-/tmp}/vcr-warnings.$$"

nano_cmd="$(type -p gdate date | head -1)"
nano_format="+%s%N"
[ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}"

travis_time_start() {
  travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
  travis_start_time=$($nano_cmd -u "$nano_format")
  printf "travis_time:start:%s\r\e[0m" $travis_timer_id
}

travis_time_finish() {
  local travis_end_time=$($nano_cmd -u "$nano_format")
  local duration=$(($travis_end_time-$travis_start_time))
  printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \
    $travis_timer_id $travis_start_time $travis_end_time $duration
}

fold() {
  local name="$1"
  local status=0
  shift 1
  if [ -n "$TRAVIS" ]; then
    printf "travis_fold:start:%s\r\e[0m" "$name"
    travis_time_start
  fi

  "$@" || status=$?

  [ -z "$TRAVIS" ] || travis_time_finish

  if [ "$status" -eq 0 ]; then
    if [ -n "$TRAVIS" ]; then
      printf "travis_fold:end:%s\r\e[0m" "$name"
    fi
  else
    STATUS="$status"
  fi
}

run() {
  # Save warnings on stderr to a separate file
  RUBYOPT="$RUBYOPT -w" "$@" 2> >(tee >(grep 'warning:' >>"$warnings") | grep -v 'warning:')
}<commit_msg>Add missing return to `fold`.<commit_after>#!/bin/bash
set -e

STATUS=0
warnings="${TMPDIR:-/tmp}/vcr-warnings.$$"

nano_cmd="$(type -p gdate date | head -1)"
nano_format="+%s%N"
[ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}"

travis_time_start() {
  travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
  travis_start_time=$($nano_cmd -u "$nano_format")
  printf "travis_time:start:%s\r\e[0m" $travis_timer_id
}

travis_time_finish() {
  local travis_end_time=$($nano_cmd -u "$nano_format")
  local duration=$(($travis_end_time-$travis_start_time))
  printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \
    $travis_timer_id $travis_start_time $travis_end_time $duration
}

fold() {
  local name="$1"
  local status=0
  shift 1
  if [ -n "$TRAVIS" ]; then
    printf "travis_fold:start:%s\r\e[0m" "$name"
    travis_time_start
  fi

  "$@" || status=$?

  [ -z "$TRAVIS" ] || travis_time_finish

  if [ "$status" -eq 0 ]; then
    if [ -n "$TRAVIS" ]; then
      printf "travis_fold:end:%s\r\e[0m" "$name"
    fi
  else
    STATUS="$status"
  fi

  return $status
}

run() {
  # Save warnings on stderr to a separate file
  RUBYOPT="$RUBYOPT -w" "$@" 2> >(tee >(grep 'warning:' >>"$warnings") | grep -v 'warning:')
}
{'fraction_non_alphanumeric': 0.1985530546623794, 'fraction_numerical': 0.017684887459807074, 'mean_word_length': 4.26215644820296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3771527', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1074, 'n_words': 196}