<commit_before># Document to collect useful, custom-written functions.

def sym_matrix(matrix, part="upper"):
    """Makes square, symmetric matrix, from matrix and upper/lower flag.
    
    Requires: import numpy as np
    
    Supply a square matrix and a flag like "upper" or "lower", and copy the
    chosen matrix part, symmetrically, to the other part. Diagonals are left
    alone. For example:
    matrix <- [[8, 1, 2],<commit_msg>edited docstring for sym_matrix<commit_after># Document to collect useful, custom-written functions.

def sym_matrix(matrix, part="upper"):
    """Returns a symmetric matrix, from a square matrix and a triangle flag.
    
    Requires: import numpy as np
    
    Supply a square matrix and a flag like "upper" or "lower", and copy the
    chosen matrix part, symmetrically, to the other part. Diagonals are left
    alone. For example:
    matrix <- [[8, 1, 2],
{'fraction_non_alphanumeric': 0.08647450110864745, 'fraction_numerical': 0.0066518847006651885, 'mean_word_length': 3.4702970297029703, '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': '5020585', 'n_tokens_mistral': 255, 'n_tokens_neox': 252, 'n_words': 117}