<commit_before>def bubble_sort(array)
  element1 = 0
  element2 = 0
  counter = 0
  while counter < array.length - 1
    if array[counter] > array[counter + 1]
      element1 = array[counter]
      element2 = array[counter + 1]
      array[counter] = element2
      array[counter + 1] = element1
      counter = 0
    else
      counter += 1
    end
  end
  return array
end

p bubble_sort([4,3,78,2,0,2])
# => [0,2,2,3,4,78]<commit_msg>finished bubble_sort_by<commit_after>def bubble_sort(array)
  element1 = 0
  element2 = 0
  counter = 0
  while counter < array.length - 1
    if array[counter] > array[counter + 1]
      element1 = array[counter]
      element2 = array[counter + 1]
      array[counter] = element2
      array[counter + 1] = element1
      counter = 0
    else
      counter += 1
    end
  end
  return array
end

p bubble_sort([4,3,78,2,0,2])
# => [0,2,2,3,4,78]

def bubble_sort_by(array)
  element1 = ""
  element2 = ""
  counter = 0
  while counter < array.length - 1
    if array[counter].length > array[counter + 1].length
      element1 = array[counter]
      element2 = array[counter + 1]
      array[counter] = element2
      array[counter + 1] = element1
      counter = 0
    else
      counter += 1
    end
  end
  return array
end

p bubble_sort_by(["hi","hello","hey"])
# => ["hi", "hey", "hello"]


p bubble_sort_by(["hi","hello","hey","yo","sup","howdy"])
# => ["hi", "yo", "hey", "sup", "hello", "howdy"]
{'fraction_non_alphanumeric': 0.1463245492371706, 'fraction_numerical': 0.049237170596393896, 'mean_word_length': 2.858288770053476, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '2623506', 'n_tokens_mistral': 543, 'n_tokens_neox': 508, 'n_words': 125}