def flatten(l):
    """Flatten nested lists into a single-level list"""
    if l and type(l[0]) == list:
        rv = []
        for e in l:
            if type(e) == list:
                rv.extend(e)
            else:
                rv.append(e)
        return rv
    else:
        return l