def make_domains(lists):
 from six.moves import range
 domains = []
 for iterable in lists:
  new_domain = iterable[:]
  for i in range(len(domains)):
   domains[i] = (domains[i] * len(iterable))
  if domains:
   missing = ((len(domains[0]) - len(iterable)) / len(iterable))
   i = 0
   for j in range(len(iterable)):
    value = iterable[j]
    for dummy in range(missing):
     new_domain.insert(i, value)
     i += 1
    i += 1
  domains.append(new_domain)
 return domains

def make_domains ( lists ) : from six . moves import range domains = [ ] for iterable in lists : new_domain = iterable [ : ] for i in range ( len ( domains ) ) : domains [ i ] = ( domains [ i ] * len ( iterable ) ) if domains : missing = ( ( len ( domains [ 0 ] ) - len ( iterable ) ) / len ( iterable ) ) i = 0 for j in range ( len ( iterable ) ) : value = iterable [ j ] for dummy in range ( missing ) : new_domain . insert ( i , value ) i += 1 i += 1 domains . append ( new_domain ) return domains
given a list of lists .