Python function explanation
<p>What does this part of program do (found on <a href="https://github.com/nubela/nus-cs5215-constraint-programming/blob/master/assignment2/solver.py" rel="nofollow">Nubela's guthub</a>)?</p>

<pre><code>def product(*args, **kwds):
    """
    for py2.6&lt; support (they lack itertools lib)
    - http://docs.python.org/2/library/itertools.html#itertools.permutations
    """
    pools = map(tuple, args) * kwds.get('repeat', 1)
    result = [[]]
    for pool in pools:
        result = [x+[y] for x in result for y in pool]
    for prod in result:
        yield tuple(prod)
</code></pre>

<p>And later in program:</p>

<pre><code>list(set((product(*[range(2) for _ in range(length)]))))
</code></pre>
