class_docstr: Model id helper.
  
  This helper is used to help `parl.Model` generate a new model id
  or register a given model id in a thread-safe way.
class_docstr_tok: ["Model","id","helper",".","This","helper","is","used","to","help","`","parl.Model","`","generate","a","new","model","id","or","register","a","given","model","id","in","a","thread-safe","way","."]
docstr: Generate a unique model_id in a thread-safe way.
  
  Returns:
      String of model id.
docstr_tok: ["Generate","a","unique","model_id","in","a","thread-safe","way",".","Returns",":","String","of","model","id","."]
code: def generate_model_id(self):
      """Generate a unique model_id in a thread-safe way.
  
      Returns:
          String of model id.
      """
      self.lock.acquire()
      model_id = "parl_model_{}".format(self.index)
      while model_id in self._registered_ids:
          self.index += 1
          model_id = "parl_model_{}".format(self.index)
      self._registered_ids.add(model_id)
      self.index += 1
      self.lock.release()
      return model_id
  
imports: import threading
label_desc: Use image node_id 2 for calling the ModelHelper obj's underlying member method code with example usage: obj.generate_model_id() and returns: model_id