code: def repl_init(self, config):
          
          self.update_server_map(config)
          # init_server - server which can init replica set
          init_server = [member['host'] for member in config['members']
                         if not (member.get('arbiterOnly', False)
                                 or member.get('priority', 1) == 0)][0]
  
          servers = [member['host'] for member in config['members']]
          if not self.wait_while_reachable(servers):
              logger.error("all servers must be reachable")
              self.cleanup()
              return False
          try:
              result = self.connection(init_server).admin.command("replSetInitiate", config)
              logger.debug("replica init result: {result}".format(**locals()))
          except pymongo.errors.PyMongoError:
              raise
          if int(result.get('ok', 0)) == 1:
              # Wait while members come up
              return self.waiting_member_state()
          else:
              self.cleanup()
              return False
docs: create replica set by config
          return True if replica set created successfuly, else False