code: def generateRandomSDRVaryingSparsity(numSDR, numDims, minSparsity, maxSparsity,
                                       seed=42):
    
    randomSDRs = np.zeros((numSDR, numDims), dtype=uintType)
    indices = np.array(range(numDims))
    np.random.seed(seed)
    for i in range(numSDR):
      sparsity = np.random.random() * (maxSparsity - minSparsity) + minSparsity
      numActiveInputBits = int(sparsity * numDims)
      randomIndices = np.random.permutation(indices)
      activeBits = randomIndices[:numActiveInputBits]
      randomSDRs[i, activeBits] = 1
    return randomSDRs
docs: Generate a set of random SDRs with varying sparsity
    :param numSDR: number of SDRs
    :param numDims: length of SDRs
    :param minSparsity: minimum sparsity
    :param maxSparsity: maximum sparsity
    :param seed: