chooseMatrix creates an n matrix with unique rows with m ones in each row and the rest zeros.
I couldn't find any direct form of replacing this function in python with NumPy.
What I did that solved my problem, but it's inefficient because values are not treated as unique by itertools:
import numpy as np
from itertools import permutations
myset = set(i for i in permutations([0, 0, 1, 1]))
matrix = np.matrix(list(myset))
print(matrix)
output:
matrix([[1, 0, 1, 0],
[1, 1, 0, 0],
[1, 0, 0, 1],
[0, 1, 1, 0],
[0, 1, 0, 1],
[0, 0, 1, 1]])