<commit_before>from itertools import permutations
from math import factorial
from scipy.spatial.distance import squareform
import numpy as np

def test(strings, meaning_distances, perms):

  # Compute meaning distance residuals
  meaning_residuals = residualize(meaning_distances)

  # Determine category labels and the edit-distances between them
  category_labels = list(set(strings))
  label_distances = squareform(pairwise_string_distances(category_labels))

  # Number of strings, number of categories, and number of category permutations
  m = len(strings)
  n = len(category_labels)
  p = factorial(n)

  # Deterministic test - measure every possible category-meaning mapping
  if p <= perms:

    # Create an empty array to store the covariences
    covariences = np.zeros(p, dtype=float)

    # Enumerate all permutations of category label orders
    for i, order in enumerate(permutations(range(n))):

      # Rearrange the category labels into a new order
      permuted_category_labels = [category_labels[j] for j in order]<commit_msg>Clarified some comments<commit_after>from itertools import permutations
from math import factorial
from scipy.spatial.distance import squareform
import numpy as np

def test(strings, meaning_distances, perms):

  # Compute meaning distance residuals
  meaning_residuals = residualize(meaning_distances)

  # Determine category labels and the edit-distances between them
  category_labels = list(set(strings))
  label_distances = squareform(pairwise_string_distances(category_labels))

  # Number of strings, number of categories, and number of possible category permutations
  m = len(strings)
  n = len(category_labels)
  p = factorial(n)

  # Deterministic test - measure every possible category-meaning mapping
  if p <= perms:

    # Create an empty array to store the covarience for each permutation
    covariences = np.zeros(p, dtype=float)

    # Iterate over an enumeration of all permutations of category label orders
    for i, order in enumerate(permutations(range(n))):

      # Rearrange the category labels into the new order
      permuted_category_labels = [category_labels[j] for j in order]
{'fraction_non_alphanumeric': 0.061224489795918366, 'fraction_numerical': 0.0, 'mean_word_length': 4.752, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2191864', 'n_tokens_mistral': 625, 'n_tokens_neox': 576, 'n_words': 213}