<commit_before>list_of_people = [
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "Emmanuel",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>"  
  ]

=begin

MVP (Minimum Viable Product) User Stories: 
1. Each group has at least 3 people

input: array (above list)
output: array (with sub-arrays)
psuedocode:

create a new container for the list-of-groups
create a new container for temporary group

WHILE input list has people on the list
go through input list and randomly choose a person and add this person to the temporary group
  IF temporary group has 4 people
    move the temporary group to the list-of-groups container
    reset temporary group
  => repeat above 4 steps until input list has no more people
end WHILE
IF there are less than 3 leftover people in temporary group
  move them to the first two groups on the list-of-groups
IF there are 3 leftover people in temporary group
  move the temporary group to the list-of-groups container
output the list-of-groups container 

=end

# Initial Solution

def acct_groups(list)
  list_of_groups = []
  group = []
  while list.length > 0
    group.push(list.slice!(rand(list.length)))
    if group.length == 4
      list_of_groups.push(group)
      group = []
    end
  end
  
  if group.length < 3
    for i in 0...group.length
      list_of_groups[i].push(group[i])
    end
  else 
    list_of_groups.push(group)
  end
  list_of_groups
end
acct_groups(list_of_people)

# Refactored Solution

def acct_groups(list)<commit_msg>reword pseudocode<commit_after>list_of_people = [
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "Emmanuel",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>",
  "<NAME>"  
  ]

=begin

MVP (Minimum Viable Product) User Stories: 
1. Each group has at least 3 people

input: array (above list)
output: array (with sub-arrays)
psuedocode:

create a new container for the list-of-groups
create a new container for temporary group

WHILE input list has people on the list
go through input list and randomly choose a person and add this person to the temporary group
  IF temporary group has 4 people
    move the temporary group to the list-of-groups container
    reset temporary group
  END IF
END WHILE
IF there are less than 3 leftover people in temporary group
  move them to the first two groups on the list-of-groups
ELSE move the temporary group to the list-of-groups container
END IF
output the list-of-groups container 

=end

# Initial Solution

def acct_groups(list)
  list_of_groups = []
  group = []
  while list.length > 0
    group.push(list.slice!(rand(list.length)))
    if group.length == 4
      list_of_groups.push(group)
      group = []
    end
  end
  
  if group.length < 3
    for i in 0...group.length
      list_of_groups[i].push(group[i])
    end
  else 
    list_of_groups.push(group)
  end
  list_of_groups
end
acct_groups(list_of_people)

# Refactored Solution

def acct_groups(list)
{'fraction_non_alphanumeric': 0.21701860756847166, 'fraction_numerical': 0.0037633284549445953, 'mean_word_length': 3.2562277580071175, 'pattern_counts': {'":': 0, '<': 179, '<?xml version=': 0, '>': 180, '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': '475072', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1868, 'n_words': 507}