def to_table(result):
max_count = <NUM_LIT:20><EOL>table, count = [], <NUM_LIT:0><EOL>for role, envs_topos in result.items():<EOL><INDENT>for env, topos in envs_topos.items():<EOL><INDENT>for topo in topos:<EOL><INDENT>count += <NUM_LIT:1><EOL>if count > max_count:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>table.append([role, env, topo])<EOL><DEDENT><DEDENT><DEDENT><DEDENT>header = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>rest_count = <NUM_LIT:0> if count <= max_count else count - max_count<EOL>return table, header, rest_count<EOL>
normalize raw result to table