<commit_before># When doing it in-place, the basic algo maintains two watchers, i and j.
# j is the boundry between the 'frontier' and the rest of the array
# i is the partition between the elements less than, greater than the pivot
# when a term which is smaller than the pivot is encountered, swap i with j,
# then increment i
# at the end, we swap i with the pivot to put pivot into proper place.
# all about the in-place swaps<commit_msg>Python qSort list comprehensions<commit_after># When doing it in-place, the basic algo maintains two watchers, i and j.
# j is the boundry between the 'frontier' and the rest of the array
# i is the partition between the elements less than, greater than the pivot
# when a term which is smaller than the pivot is encountered, swap i with j,
# then increment i
# at the end, we swap i with the pivot to put pivot into proper place.
# all about the in-place swaps


# all list comprehensions FTW
def qsort_lc(list):
  if len(list) <=1:
    return list

  pivot = list[0]
  less_than = qsort([n for n in list[1:] if n < pivot])
  greater_than = qsort([n for n in list[1:] if n > pivot])
  return (less_than + pivot + greater_than)
{'fraction_non_alphanumeric': 0.06672369546621043, 'fraction_numerical': 0.003421727972626176, 'mean_word_length': 3.9159663865546217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4068493', 'n_tokens_mistral': 355, 'n_tokens_neox': 336, 'n_words': 193}