#NEWLINE# def __init__( self , db , bucket_name = 'fs' , chunk_size_bytes = DEFAULT_CHUNK_SIZE , write_concern = None , read_preference = None ) : #NEWLINE# #INDENT# "Create a new instance of :class:`GridFSBucket`.\n\n        Raises :exc:`TypeError` if `database` is not an instance of\n        :class:`~pymongo.database.Database`.\n\n        Raises :exc:`~pymongo.errors.ConfigurationError` if `write_concern`\n        is not acknowledged.\n\n        :Parameters:\n          - `database`: database to use.\n          - `bucket_name` (optional): The name of the bucket. Defaults to 'fs'.\n          - `chunk_size_bytes` (optional): The chunk size in bytes. Defaults\n            to 255KB.\n          - `write_concern` (optional): The\n            :class:`~pymongo.write_concern.WriteConcern` to use. If ``None``\n            (the default) db.write_concern is used.\n          - `read_preference` (optional): The read preference to use. If\n            ``None`` (the default) db.read_preference is used.\n\n        .. versionadded:: 3.1\n\n        .. mongodoc:: gridfs\n        " #NEWLINE# if ( not isinstance ( db , Database ) ) : #NEWLINE# #INDENT# raise TypeError ( 'database must be an instance of Database' ) #NEWLINE# #UNINDENT# wtc = ( write_concern if ( write_concern is not None ) else db . write_concern ) #NEWLINE# if ( not chunk_size_bytes . acknowledged ) : #NEWLINE# #INDENT# raise ConfigurationError ( 'write concern must be acknowledged' ) #NEWLINE# #UNINDENT# self . _db = db #NEWLINE# self . _bucket_name = bucket_name #NEWLINE# self . _collection = db [ bucket_name ] #NEWLINE# self . _chunks = self . _collection . chunks . with_options ( write_concern = write_concern , read_preference = read_preference ) #NEWLINE# self . _files = self . _collection . files . with_options ( write_concern = write_concern , read_preference = read_preference ) #NEWLINE# self . _chunk_size_bytes = chunk_size_bytes