def parse_ggKbase_tables(tables, id_type):
g2info = {}<EOL>for table in tables:<EOL><INDENT>for line in open(table):<EOL><INDENT>line = line.strip().split('<STR_LIT:\t>')<EOL>if line[<NUM_LIT:0>].startswith('<STR_LIT:name>'):<EOL><INDENT>header = line<EOL>header[<NUM_LIT:4>] = '<STR_LIT>'<EOL>header[<NUM_LIT:12>] = '<STR_LIT>'<EOL>header[<NUM_LIT>] = '<STR_LIT>'<EOL>continue<EOL><DEDENT>name, code, info = line[<NUM_LIT:0>], line[<NUM_LIT:1>], line<EOL>info = [to_int(i) for i in info]<EOL>if id_type is False: <EOL><INDENT>if '<STR_LIT>' in code or '<STR_LIT>' in code:<EOL><INDENT>code = name<EOL><DEDENT>if (name != code) and (name and code in g2info):<EOL><INDENT>print('<STR_LIT>', file=sys.stderr)<EOL>print('<STR_LIT>' % (name, code), file=sys.stderr)<EOL>exit()<EOL><DEDENT>if name not in g2info:<EOL><INDENT>g2info[name] = {item:stat for item, stat in zip(header, info)}<EOL><DEDENT>if code not in g2info:<EOL><INDENT>g2info[code] = {item:stat for item, stat in zip(header, info)}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if id_type == '<STR_LIT:name>':<EOL><INDENT>ID = name<EOL><DEDENT>elif id_type == '<STR_LIT:code>':<EOL><INDENT>ID = code<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>', file=sys.stderr)<EOL>exit()<EOL><DEDENT>ID = ID.replace('<STR_LIT:U+0020>', '<STR_LIT>')<EOL>g2info[ID] = {item:stat for item, stat in zip(header, info)}<EOL>if g2info[ID]['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>g2info[ID]['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT><DEDENT>return g2info<EOL>
convert ggKbase genome info tables to dictionary