<commit_before>import numpy as np

def generate(data):

    # Dimensions
    nInnerMin = 2
    nMax = 5
    nRows = np.random.randint(1,nMax+1)
    nInner = np.random.randint(nInnerMin,nMax+1)
    nCols = np.random.randint(1,nMax+1)

    # Number of digits after the decimal
    nDigits = 1

    # Range of entries
    numMax = 10

    # The two matrices to be multiplied
    A = np.random.random_integers(-numMax,numMax,(nRows,nInner))/(10**nDigits)
    B = np.random.random_integers(-numMax,numMax,(nInner,nCols))/(10**nDigits)

    # Product of these two matrices
    C = A.dot(B)

    # Modify data and return
    data["params"]["A"] = A.tolist()
    data["params"]["B"] = B.tolist()
    data["correct_answers"]["C"] = C.tolist()<commit_msg>update example course question<commit_after>import numpy as np
import prairielearn as pl

def generate(data):

    # Dimensions
    nInnerMin = 2
    nMax = 5
    nRows = np.random.randint(1,nMax+1)
    nInner = np.random.randint(nInnerMin,nMax+1)
    nCols = np.random.randint(1,nMax+1)

    # Number of digits after the decimal
    nDigits = 1

    # Range of entries
    numMax = 10

    # The two matrices to be multiplied
    A = np.random.random_integers(-numMax,numMax,(nRows,nInner))/(10**nDigits)
    B = np.random.random_integers(-numMax,numMax,(nInner,nCols))/(10**nDigits)

    # Product of these two matrices
    C = A.dot(B)

    # Modify data and return
    data["params"]["A"] = pl.to_json(A)
    data["params"]["B"] = pl.to_json(B)
    data["correct_answers"]["C"] = pl.to_json(C)
{'fraction_non_alphanumeric': 0.14137483787289234, 'fraction_numerical': 0.018158236057068743, 'mean_word_length': 3.286111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6955935', 'n_tokens_mistral': 593, 'n_tokens_neox': 567, 'n_words': 120}