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: Register given model id in a thread-safe way.
  
  Raises:
      AssertionError: if the model id is already used.
docstr_tok: ["Register","given","model","id","in","a","thread-safe","way",".","Raises",":","AssertionError",":","if","the","model","id","is","already","used","."]
code: def register_model_id(self, model_id):
      """Register given model id in a thread-safe way.
  
      Raises:
          AssertionError: if the model id is already used.
      """
      model_id_used = False
      self.lock.acquire()
      if model_id in self._registered_ids:
          model_id_used = True
      else:
          self._registered_ids.add(model_id)
      self.lock.release()
  
      assert (
          not model_id_used
      ), "model id `{}` has been used before, please try another model_id.".format(
          model_id
      )
  
imports: import threading
label_desc: Use image node_id 3 for calling the ModelHelper obj's underlying member method code with example usage: obj.register_model_id(model_id) without return types