def dissolve(inlist):
    """
    list and tuple flattening; e.g. [[1, 2], [3, 4]] -> [1, 2, 3, 4]
    """
    out = []
    for i in inlist:
        i = list(i) if isinstance(i, tuple) else i
        out.extend(dissolve(i)) if isinstance(i, list) else out.append(i)
    return out