#NEWLINE# def run( self ) : #NEWLINE# #INDENT# artist_count = defaultdict ( int ) #NEWLINE# for t in self . input ( ) : #NEWLINE# #INDENT# with t . open ( 'r' ) as in_file : #NEWLINE# #INDENT# for line in self : #NEWLINE# #INDENT# ( _ , artist , track ) = line . strip ( ) . split ( ) #NEWLINE# artist_count [ artist ] += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# with self . output ( ) . open ( 'w' ) as out_file : #NEWLINE# #INDENT# for ( artist , count ) in six . iteritems ( artist_count ) : #NEWLINE# #INDENT# out_file . write ( '{}\t{}\n' . format ( artist , count ) )