splitter.py 362 Bytes
'Split sessions for multisession files'


def split_sessions(pars):
    'Return a list of sessions.'
    sessions = []
    current = []
    for par in pars:
        if current and ('BIULETYN' in par.u):
            sessions.append(current)
            current = []
        current.append(par)
    if current:
        sessions.append(current)
    return sessions