text: 
  from typing import TextIO, List, Any
  from io import StringIO
  
  def count_birds(observations_file: TextIO) -> List[List[Any]]:
      """Return a set of the bird species listed in observations_file,
      which has one bird species per line.
  
      >>> infile = StringIO('bird 1\\nbird 2\\nbird 1\\n')
      >>> count_birds(infile)
      [['bird 1', 2], ['bird 2', 1]]
      """
      bird_counts = []
      for line in observations_file:
          bird = line.strip()
          found = False
          #Find bird in the list of bird counts.
          for entry in bird_counts:
              if entry[0] == bird:
                  entry[1] = entry[1] + 1
                  found = True
          if not found:
              bird_counts.append([bird, 1])
  
      return bird_counts
  
  if __name__== '__main__':
      with open('observations.txt') as observations_file:
          bird_counts = count_birds(observations_file)
  
          #Print each bird and the number of times it was seen
          for entry in bird_counts:
              print(entry[0], entry[1])