title: Python generate all possible combinations of matrix
body: <p>I need to generate all combinations of a matrix in Python. The input will be two integers n and m, and I need to generate all possible states of that matrix with 1 and 0 as possible values.</p>
  
  <p>For example:</p>
  
  <pre><code>n = 3 m = 2
  [[0 0 0] [1 0 0] [1 1 0]
   [0 0 0] [0 0 0] [0 0 0]
   [0 0 0],[0 0 0],[0 0 0] . . . . .
  ]
  </code></pre>
  
  <p>Is there a clean and efficient way to do this given I will not know the values for n and m until runtime? The highest value used will be n = 16  m = 16.</p>