<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_users(self, db, mongo_version):
 """Add given user, and extra x509 user if necessary."""

        if self.x509_extra_user:
            # Build dict of kwargs to pass to add_user.
            auth_dict = {
                'name': DEFAULT_SUBJECT,
                'roles': self._user_roles(db.client)
            }
            db.add_user(**auth_dict)
            # Fix kwargs to MongoClient.
            self.kwargs['ssl_certfile'] = DEFAULT_CLIENT_CERT

        # Add secondary user given from request.

        secondary_login = {
            'name': self.login,
            'roles': self._user_roles(db.client)
        }
        if self.password:
            secondary_login['password'] = self.password
        if mongo_version >= (3, 7, 2):
            # Use SCRAM_SHA-1 so that pymongo < 3.7 can authenticate.
            secondary_login['mechanisms'] = ['SCRAM-SHA-1']
        db.add_user(**secondary_login)