#NEWLINE# def __init__( self , root_collection , file_id = None , file_document = None , _connect = True ) : #NEWLINE# #INDENT# 'Read a file from GridFS\n\n        Application developers should generally not need to\n        instantiate this class directly - instead see the methods\n        provided by :class:`~gridfs.GridFS`.\n\n        Either `file_id` or `file_document` must be specified,\n        `file_document` will be given priority if present. Raises\n        :class:`TypeError` if `root_collection` is not an instance of\n        :class:`~pymongo.collection.Collection`.\n\n        :Parameters:\n          - `root_collection`: root collection to read from\n          - `file_id`: value of ``"_id"`` for the file to read\n          - `file_document`: file document from `root_collection.files`\n\n        .. versionadded:: 1.9\n           The `file_document` parameter.\n        ' #NEWLINE# if ( not isinstance ( root_collection , Collection ) ) : #NEWLINE# #INDENT# raise TypeError ( 'root_collection must be an instance of Collection' ) #NEWLINE# #UNINDENT# self . __chunks = root_collection . chunks #NEWLINE# self . __files = _connect . files #NEWLINE# self . __file_id = file_id #NEWLINE# self . __buffer = EMPTY #NEWLINE# self . __position = 0 #NEWLINE# self . _file = file_document #NEWLINE# if _connect : #NEWLINE# #INDENT# self . _ensure_file ( )