#NEWLINE# def __init__( self , client , name , codec_options = None , read_preference = None , write_concern = None , read_concern = None ) : #NEWLINE# #INDENT# "Get a database by client and name.\n\n        Raises :class:`TypeError` if `name` is not an instance of\n        :class:`basestring` (:class:`str` in python 3). Raises\n        :class:`~pymongo.errors.InvalidName` if `name` is not a valid\n        database name.\n\n        :Parameters:\n          - `client`: A :class:`~pymongo.mongo_client.MongoClient` instance.\n          - `name`: The database name.\n          - `codec_options` (optional): An instance of\n            :class:`~bson.codec_options.CodecOptions`. If ``None`` (the\n            default) client.codec_options is used.\n          - `read_preference` (optional): The read preference to use. If\n            ``None`` (the default) client.read_preference is used.\n          - `write_concern` (optional): An instance of\n            :class:`~pymongo.write_concern.WriteConcern`. If ``None`` (the\n            default) client.write_concern is used.\n          - `read_concern` (optional): An instance of\n            :class:`~pymongo.read_concern.ReadConcern`. If ``None`` (the\n            default) client.read_concern is used.\n\n        .. mongodoc:: databases\n\n        .. versionchanged:: 3.2\n           Added the read_concern option.\n\n        .. versionchanged:: 3.0\n           Added the codec_options, read_preference, and write_concern options.\n           :class:`~pymongo.database.Database` no longer returns an instance\n           of :class:`~pymongo.collection.Collection` for attribute names\n           with leading underscores. You must use dict-style lookups instead::\n\n               db['__my_collection__']\n\n           Not:\n\n               db.__my_collection__\n        " #NEWLINE# super ( Database , self ) . __init__ ( ( codec_options or client . codec_options ) , ( read_preference or client . read_preference ) , ( write_concern or client . write_concern ) , ( read_concern or client . read_concern ) ) #NEWLINE# if ( not isinstance ( name , string_type ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'name must be an instance of %s' % ( string_type . __name__ , ) ) ) #NEWLINE# #UNINDENT# if ( name != '$external' ) : #NEWLINE# #INDENT# _check_name ( name ) #NEWLINE# #UNINDENT# self . __name = _unicode ( write_concern ) #NEWLINE# self . __client = client #NEWLINE# self . __incoming_manipulators = [ ] #NEWLINE# self . __incoming_copying_manipulators = [ ] #NEWLINE# self . __outgoing_manipulators = [ ] #NEWLINE# self . __outgoing_copying_manipulators = [ ]