title: Get r-length tuple combinations of m lists, with no more than a single element from any list, and r < m
body: <p>In the example below, I have <code>m = 3</code> lists which and I calculate the combinations of size <code>r = 2</code>.</p>
  <pre><code>import itertools
  
  a = ['a1', 'a2', 'a3']
  b = ['b1', 'b2', 'b3']
  c = ['c1', 'c2', 'c3']
  
  print(list(itertools.combinations(itertools.chain(a, b, c), 2)))
  </code></pre>
  <p><strong>Output:</strong></p>
  <pre><code>[('a1', 'a2'), ('a1', 'a3'), ('a1', 'b1'), ('a1', 'b2'), ('a1', 'b3'), ('a1', 'c1'), ('a1', 'c2'), ('a1', 'c3'), ('a2', 'a3'), ('a2', 'b1'), ('a2', 'b2'), ('a2', 'b3'), ('a2', 'c1'), ('a2', 'c2'), ('a2', 'c3'), ('a3', 'b1'), ('a3', 'b2'), ('a3', 'b3'), ('a3', 'c1'), ('a3', 'c2'), ('a3', 'c3'), ('b1', 'b2'), ('b1', 'b3'), ('b1', 'c1'), ('b1', 'c2'), ('b1', 'c3'), ('b2', 'b3'), ('b2', 'c1'), ('b2', 'c2'), ('b2', 'c3'), ('b3', 'c1'), ('b3', 'c2'), ('b3', 'c3'), ('c1', 'c2'), ('c1', 'c3'), ('c2', 'c3')]
  </code></pre>
  <p><strong>Problem:</strong></p>
  <p>I don't want the combinations that come from the same list. For example, <code>('a1', 'a2')</code> and <code>('a1', 'a3')</code> are should be removed.</p>