def to_dictionary(pw, print_list):
pairs = {}<EOL>for p in pw:<EOL><INDENT>a, b, pident = p<EOL>if a not in pairs:<EOL><INDENT>pairs[a] = {a: '<STR_LIT:->'}<EOL><DEDENT>if b not in pairs:<EOL><INDENT>pairs[b] = {b: '<STR_LIT:->'}<EOL><DEDENT>pairs[a][b] = pident<EOL>pairs[b][a] = pident<EOL>if print_list is True:<EOL><INDENT>A, B = a.split('<STR_LIT:>>')[<NUM_LIT:1>], b.split('<STR_LIT:>>')[<NUM_LIT:1>]<EOL>print('<STR_LIT:\t>'.join([str(i) for i in [A, B, pident]]), file=sys.stderr)<EOL>print('<STR_LIT:\t>'.join([str(i) for i in [B, A, pident]]), file=sys.stderr)<EOL><DEDENT><DEDENT>return pairs<EOL>
- convert list of comparisons to dictionary
- print list of pidents (if requested) to stderr