#NEWLINE# def create_collection( self , name , codec_options = None , read_preference = None , write_concern = None , read_concern = None , **kwargs ) : #NEWLINE# #INDENT# 'Create a new :class:`~pymongo.collection.Collection` in this\n        database.\n\n        Normally collection creation is automatic. This method should\n        only be used to specify options on\n        creation. :class:`~pymongo.errors.CollectionInvalid` will be\n        raised if the collection already exists.\n\n        Options should be passed as keyword arguments to this method. Supported\n        options vary with MongoDB release. Some examples include:\n\n          - "size": desired initial size for the collection (in\n            bytes). For capped collections this size is the max\n            size of the collection.\n          - "capped": if True, this is a capped collection\n          - "max": maximum number of objects if capped (optional)\n\n        See the MongoDB documentation for a full list of supported options by\n        server version.\n\n        :Parameters:\n          - `name`: the name of the collection to create\n          - `codec_options` (optional): An instance of\n            :class:`~bson.codec_options.CodecOptions`. If ``None`` (the\n            default) the :attr:`codec_options` of this :class:`Database` is\n            used.\n          - `read_preference` (optional): The read preference to use. If\n            ``None`` (the default) the :attr:`read_preference` of this\n            :class:`Database` is used.\n          - `write_concern` (optional): An instance of\n            :class:`~pymongo.write_concern.WriteConcern`. If ``None`` (the\n            default) the :attr:`write_concern` of this :class:`Database` is\n            used.\n          - `read_concern` (optional): An instance of\n            :class:`~pymongo.read_concern.ReadConcern`. If ``None`` (the\n            default) the :attr:`read_concern` of this :class:`Database` is\n            used.\n          - `**kwargs` (optional): additional keyword arguments will\n            be passed as options for the create collection command\n\n        .. versionchanged:: 3.0\n           Added the codec_options, read_preference, and write_concern options.\n\n        .. versionchanged:: 2.2\n           Removed deprecated argument: options\n        ' #NEWLINE# if ( name in self . collection_names ( ) ) : #NEWLINE# #INDENT# raise CollectionInvalid ( ( 'collection %s already exists' % name ) ) #NEWLINE# #UNINDENT# return Collection ( self , name , True , codec_options , codec_options , write_concern , read_concern , ** kwargs )