code: def config(self):
          
          try:
              admin = self.connection().admin
              config = admin.command('replSetGetConfig')['config']
          except pymongo.errors.OperationFailure:
              # replSetGetConfig was introduced in 2.7.5.
              config = self.connection().local.system.replset.find_one()
          return config
docs: return replica set config, use rs.conf() command