'Create a new instance of :class:`GridFSBucket`.
Raises :exc:`TypeError` if `database` is not an instance of
:class:`~pymongo.database.Database`.
Raises :exc:`~pymongo.errors.ConfigurationError` if `write_concern`
is not acknowledged.
:Parameters:
- `database`: database to use.
- `bucket_name` (optional): The name of the bucket. Defaults to \'fs\'.
- `chunk_size_bytes` (optional): The chunk size in bytes. Defaults
to 255KB.
- `write_concern` (optional): The
:class:`~pymongo.write_concern.WriteConcern` to use. If ``None``
(the default) db.write_concern is used.
- `read_preference` (optional): The read preference to use. If
``None`` (the default) db.read_preference is used.
.. versionadded:: 3.1
.. mongodoc:: gridfs'

def __init__(self, db, bucket_name='fs', chunk_size_bytes=DEFAULT_CHUNK_SIZE, write_concern=None, read_preference=None):

    if (not isinstance(db, Database)):
        raise TypeError('database    must    be    an    instance    of    Database')
    wtc = (write_concern if (write_concern is not None) else db.write_concern)
    if (not wtc.acknowledged):
        raise ConfigurationError('write    concern    must    be    acknowledged')
    self._db = db
    self._bucket_name = bucket_name
    self._collection = db[bucket_name]
    self._chunks = self._collection.chunks.with_options(write_concern=write_concern, read_preference=read_preference)
    self._files = self._collection.files.with_options(write_concern=write_concern, read_preference=read_preference)
    self._chunk_size_bytes = chunk_size_bytes
