code: def AIMAFile(components, mode='r'):
      "Open a file based at the AIMA root directory."
      import utils
      dir = os.path.dirname(utils.__file__)
      return open(apply(os.path.join, [dir] + components), modef AIMAFile(components, mode='r'):
      "Open a file based at the AIMA root directory."
      import utils
      dir = os.path.dirname(utils.__file__)
      return open(apply(os.path.join, [dir] + components), mode)
docs: Open a file based at the AIMA root directory.