title: itertools and selection from partitioned sets
body: <p>I have a list of lists, which we can think of as 3 urns with 3 balls. </p>
  
  <pre><code>mylist= [
              ['HIGH_1', 'MED_1', 'LOW_1'],
              ['HIGH_2', 'MED_2', 'LOW_2'],
              ['HIGH_3', 'MED_3', 'LOW_3']
          ]
  </code></pre>
  
  <p>I'm only allowed to select one ball from each urn.
  I would like to get all combinations of 1 ball, 2 balls, and 3 balls. Answer in  a list of lists.</p>
  
  <p>In order to achieve this I place a fake element (None) in each <em>urn</em></p>
  
  <pre><code>mylist= [
              [None, 'HIGH_1', 'MED_1', 'LOW_1'],
              [None, 'HIGH_2', 'MED_2', 'LOW_2'],
              [None, 'HIGH_3', 'MED_3', 'LOW_3']
             ]
  </code></pre>
  
  <p>Now the following use of itertools and filter gets me the desired solution. </p>
  
  <pre><code>combos = []
  for l in itertools.product(*mylist):
      combos.append(filter(lambda a: a is not None, l))
  
  combos.remove(())   # remove the empty element
  print [list(elem) for elem in combos]
  
  
  [['HIGH_3'], ['MED_3'], ['LOW_3'], ... , ['MED_2', 'HIGH_3'], ['MED_2', 'MED_3'], ['MED_1', 'HIGH_3'], ..., ['LOW_1', 'LOW_2', 'MED_3'], ['LOW_1', 'LOW_2', 'LOW_3']]
  </code></pre>
  
  <p>Which produces 63 elements.</p>
  
  <p>9 (single elements) + 27 (two elements) + 27 (three elements)  = 63</p>
  
  <p>Adding in that fake <em>None</em> and post filtering doesn't feel like the best way to do this. </p>
  
  <p>Is there a way to avoid those two seemingly redundant steps?</p>