<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_last_version(self, filename):
 """Get a file from GridFS by ``"filename"``. Returns the most recently uploaded file in GridFS with the name `filename` as an instance of :class:`~gridfs.grid_file.GridOut`. Raises :class:`~gridfs.errors.NoFile` if no such file exists. An index on ``{filename: 1, uploadDate: -1}`` will automatically be created when this method is called the first time. :Parameters: - `filename`: ``"filename"`` of the file to get .. versionadded:: 1.6 """

        def ok(doc):
            if doc is None:
                raise NoFile("TxMongo: no file in gridfs with filename {0}".format(repr(filename)))

            return GridOut(self.__collection, doc)

        return self.__files.find_one({"filename": filename},
                                     filter = filter.sort(DESCENDING("uploadDate"))).addCallback(ok)