def to_table(components, topo_info):
inputs, outputs = defaultdict(list), defaultdict(list)<EOL>for ctype, component in components.items():<EOL><INDENT>if ctype == '<STR_LIT>':<EOL><INDENT>for component_name, component_info in component.items():<EOL><INDENT>for input_stream in component_info['<STR_LIT>']:<EOL><INDENT>input_name = input_stream['<STR_LIT>']<EOL>inputs[component_name].append(input_name)<EOL>outputs[input_name].append(component_name)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>info = []<EOL>spouts_instance = topo_info['<STR_LIT>']['<STR_LIT>']<EOL>bolts_instance = topo_info['<STR_LIT>']['<STR_LIT>']<EOL>for ctype, component in components.items():<EOL><INDENT>if ctype == "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>for component_name, component_info in component.items():<EOL><INDENT>row = [ctype[:-<NUM_LIT:1>], component_name]<EOL>if ctype == '<STR_LIT>':<EOL><INDENT>row.append(len(spouts_instance[component_name]))<EOL><DEDENT>else:<EOL><INDENT>row.append(len(bolts_instance[component_name]))<EOL><DEDENT>row.append('<STR_LIT:U+002C>'.join(inputs.get(component_name, ['<STR_LIT:->'])))<EOL>row.append('<STR_LIT:U+002C>'.join(outputs.get(component_name, ['<STR_LIT:->'])))<EOL>info.append(row)<EOL><DEDENT><DEDENT>header = ['<STR_LIT:type>', '<STR_LIT:name>', '<STR_LIT>', '<STR_LIT:input>', '<STR_LIT>']<EOL>return info, header<EOL>
normalize raw logical plan info to table