def combine(*seqin):
    """
    Returns a list of all combinations of argument sequences.
    For example: combine((1,2),(3,4)) returns [[1, 3], [1, 4], [2, 3], [2, 4]]
    """
    def rloop(seqin,listout,comb):
        """recursive looping function"""
        if seqin:                       # any more sequences to process?
            for item in seqin[0]:
                newcomb=comb+[item]     # add next item to current comb
                rloop(seqin[1:],listout,newcomb)
        else:                           # processing last sequence
            listout.append(comb)        # comb finished, add to list
    listout=[]                      # listout initialization
    rloop(seqin,listout,[])         # start recursive process
    return listout