

def parse_ps_output(output):
    'Parse the output of `ravtest ps` and return a list of\n    (project, application, running) tuples.\n    '
    result = []
    project = app = info = None
    for line in output.splitlines():
        line = line.strip()
        if ((not line) and app):
            result.append((project, app, info))
            app = None
            continue
        if line.startswith('== '):
            project = line[(line.find(':') + 3):(- 1)]
        elif line.startswith('=== '):
            app = line[(line.find(':') + 3):(- 1)]
            info = {
                
            }
        if (not app):
            continue
        if ('VMs' in line):
            info['vms'] = int(line.split()[0])
    return result

dataset/ETHPy150Open ravello/testmill/lib/testmill/test/__init__.py parse_ps_output/original