def _flatten(lst):
    if not isinstance(lst, (list, tuple)):
        return [lst]
    result = []
    for item in lst:
        result.extend(_flatten(item))
    return result
Flatten a nested list.
dataset/ETHPy150Open galaxyproject/pulsar/pulsar/util/pastescript/loadwsgi.py/_flatten