<commit_before>class Translation

  MAPPINGS = {
    'AUG' => 'Methionine',
    'UUU' => 'Phenylalanine',
    'UUC' => 'Phenylalanine',
    'UUA' => 'Leucine',
    'UUG' => 'Leucine',
    'UCU' => 'Serine',
    'UCC' => 'Serine',
    'UCA' => 'Serine',
    'UCG' => 'Serine',
    'UAU' => 'Tyrosine',
    'UAC' => 'Tyrosine',
    'UGU' => 'Cystine',
    'UGC' => 'Cystine',
    'UGG' => 'Tryptophan',
    'UAA' => 'STOP',
    'UAG' => 'STOP',
    'UGA' => 'STOP'
  }

  def self.of_codon(codon)
    raise InvalidCodonError unless MAPPINGS.include?(codon)
    MAPPINGS[codon]
  end

  def self.of_rna(strand)
    strand.chars.each_slice(3).with_object([]) do |codon, result|
      return result if of_codon(codon.join) == 'STOP'
      result << of_codon(codon.join)
    end
  end

end

class InvalidCodonError < StandardError; end<commit_msg>Protein-translation: style fix<commit_after># Translation
class Translation
  MAPPINGS = {
    'AUG' => 'Methionine',
    'UUU' => 'Phenylalanine',
    'UUC' => 'Phenylalanine',
    'UUA' => 'Leucine',
    'UUG' => 'Leucine',
    'UCU' => 'Serine',
    'UCC' => 'Serine',
    'UCA' => 'Serine',
    'UCG' => 'Serine',
    'UAU' => 'Tyrosine',
    'UAC' => 'Tyrosine',
    'UGU' => 'Cystine',
    'UGC' => 'Cystine',
    'UGG' => 'Tryptophan',
    'UAA' => 'STOP',
    'UAG' => 'STOP',
    'UGA' => 'STOP'
  }.freeze

  def self.of_codon(codon)
    fail InvalidCodonError unless MAPPINGS.include?(codon)
    MAPPINGS[codon]
  end

  def self.of_rna(strand)
    strand.chars.each_slice(3).with_object([]) do |codon, result|
      return result if of_codon(codon.join) == 'STOP'
      result << of_codon(codon.join)
    end
  end
end

class InvalidCodonError < StandardError; end
{'fraction_non_alphanumeric': 0.19103086779266162, 'fraction_numerical': 0.0011648223645894002, 'mean_word_length': 3.0807600950118763, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 37, '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': '2228093', 'n_tokens_mistral': 738, 'n_tokens_neox': 699, 'n_words': 134}