'Remove user `name` from this :class:`Database`.
User `name` will no longer have permissions to access this
:class:`Database`.
:Parameters:
- `name`: the name of the user to remove'

def remove_user(self, name):

    try:
        cmd = SON([('dropUser', name)])
        if (self.write_concern.acknowledged and self.write_concern.document):
            cmd['writeConcern'] = self.write_concern.document
        self.command(cmd)
    except OperationFailure as exc:
        if (exc.code in common.COMMAND_NOT_FOUND_CODES):
            coll = self._collection_default_options('system.users')
            coll.delete_one({'user': name})
            return
        raise
