<commit_before># Returns a new uuid. Can be swapped out for an incremental counter for deterministic testing
define [], () ->
  # Generate UUIDv4 id's (from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript)
  uuid = b = (a) ->
    (if a then (a ^ Math.random() * 16 >> a / 4).toString(16) else ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b))

  prettyUuid = (seed) ->
    return uuid() if not seed

    prefix = seed.toLowerCase()
      .replace(' ', '-')
      .replace(/[^a-z0-9\-]/, '') # prevent any weird characters from slipping through
    
    return "#{prefix}-#{uuid()}" # add the random uuid on the back for uniqueness 

  return prettyUuid<commit_msg>fix bug in pretty uuid generation<commit_after># Returns a new uuid. Can be swapped out for an incremental counter for deterministic testing
define [], () ->
  # Generate UUIDv4 id's (from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript)
  uuid = b = (a) ->
    (if a then (a ^ Math.random() * 16 >> a / 4).toString(16) else ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b))

  prettyUuid = (seed) ->
    return uuid() if not seed

    prefix = seed.toLowerCase()
      .replace(/[ ]+/g, '-')
      .replace(/[^a-z0-9\-]/g, '') # prevent any weird characters from slipping through
    
    return "#{prefix}-#{uuid()}" # add the random uuid on the back for uniqueness 

  return prettyUuid
{'fraction_non_alphanumeric': 0.1674774148714385, 'fraction_numerical': 0.03891591382904795, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '331134', 'n_tokens_mistral': 514, 'n_tokens_neox': 481, 'n_words': 147}