<commit_before>module Lengthable
  def length
    rand length_min..length_max
  end

  def length_min
    if min_no_max?
      min
    elsif max_no_min?
      if max < default_min
        low_limit
      else
        default_min
      end
    elsif min_and_max?
      if min <= max
        min
      else
        default_min
      end
    else
      default_min
    end
  end

  def length_max
    if max_no_min?
      max
    elsif min_no_max?
      if min > default_max
        high_limit
      else
        default_max
      end
    elsif min_and_max?
      if min <= max
        max
      else
        default_max
      end
    else
      default_max
    end
  end

  def default_min
    0
  end

  def default_max
    0
  end

  def low_limit
    0
  end
<commit_msg>Refactor Lengthable length_min and length_max<commit_after>module Lengthable
  def length
    rand length_min..length_max
  end

  def length_min
    if min_no_max?
      min
    elsif max_no_min? && max < default_min
      low_limit
    elsif min_and_max? && min <= max
      min
    else
      default_min
    end
  end

  def length_max
    if max_no_min?
      max
    elsif min_no_max? && min > default_max
      high_limit
    elsif min_and_max? && min <= max
      max
    else
      default_max
    end
  end

  def default_min
    0
  end

  def default_max
    0
  end

  def low_limit
    0
  end

{'fraction_non_alphanumeric': 0.030434782608695653, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 1.610586011342155, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '6929076', 'n_tokens_mistral': 483, 'n_tokens_neox': 472, 'n_words': 134}