code: def dir_freq(directory):
      '''Returns a list of tuples of (word,# of directories it occurs)'''
      content = dir_list(directory)
      i = 0
      freqdict = {}
      for filename in content:
          filewords = eliminate_repeats(read_file(directory + '/' + filename))
          for word in filewords:
              if freqdict.has_key(word):
                  freqdict[word] += 1
              else:
                  freqdict[word] = 1
      tupleize = []
      for key in freqdict.keys():
          wordtuple = (key,freqdict[key])
          tupleize.append(wordtuple)
      return tupleizf dir_freq(directory):
      '''Returns a list of tuples of (word,# of directories it occurs)'''
      content = dir_list(directory)
      i = 0
      freqdict = {}
      for filename in content:
          filewords = eliminate_repeats(read_file(directory + '/' + filename))
          for word in filewords:
              if freqdict.has_key(word):
                  freqdict[word] += 1
              else:
                  freqdict[word] = 1
      tupleize = []
      for key in freqdict.keys():
          wordtuple = (key,freqdict[key])
          tupleize.append(wordtuple)
      return tupleize
docs: Returns a list of tuples of (word,# of directories it occurs)