def to_tag_list(journal):
 tag_counts = get_tags_count(journal)
 result = u''
 if (not tag_counts):
  return u'[No tags found in journal.]'
 elif (min(tag_counts)[0] == 0):
  tag_counts = filter((lambda x: (x[0] > 1)), tag_counts)
  result += u'[Removed tags that appear only once.]\n'
 result += u'\n'.join((u'{0:20} : {1}'.format(tag, n) for (n, tag) in sorted(tag_counts, reverse=True)))
 return result

def to_tag_list ( journal ) : tag_counts = get_tags_count ( journal ) result = u'' if ( not tag_counts ) : return u'[No tags found in journal.]' elif ( min ( tag_counts ) [ 0 ] == 0 ) : tag_counts = filter ( ( lambda x : ( x [ 0 ] > 1 ) ) , tag_counts ) result += u'[Removed tags that appear only once.]\n' result += u'\n' . join ( ( u'{0:20} : {1}' . format ( tag , n ) for ( n , tag ) in sorted ( tag_counts , reverse = True ) ) ) return result
prints a list of all tags and the number of occurrences .