<s> """<STR_LIT>""" <EOL> import sys <EOL> import re <EOL> import collections <EOL> WORD_RE = re . compile ( '<STR_LIT>' ) <EOL> index = collections . defaultdict ( list ) <EOL> with open ( sys . argv [ <NUM_LIT:1> ] , encoding = '<STR_LIT:utf-8>' ) as fp : <EOL> for line_no , line in enumerate ( fp , <NUM_LIT:1> ) : <EOL> for match in WORD_RE . finditer ( line ) : <EOL> word = match . group ( ) <EOL> column_no = match . start ( ) + <NUM_LIT:1> <EOL> location = ( line_no , column_no ) <EOL> index [ word ] . append ( location ) <EOL> for word in sorted ( index , key = str . upper ) : <EOL> print ( word , index [ word ] ) </s>
