code: def create(
      cls, name, return_unused_kwargs=False, **kwargs
  ) -> Union[ModelBase, Tuple[ModelBase, Dict]]:
      model_class = cls.get_model_class(name)
      config, kwargs = model_class.config_class.from_dict(
          kwargs, return_unused_kwargs=True
      )
  
      # initialize the model
      signature = inspect.signature(model_class)
      init_kwargs = {
          k: v for k, v in kwargs.items() if k in signature.parameters
      }
      kwargs = {k: v for k, v in kwargs.items() if k not in init_kwargs}
      model = model_class(config=config, **init_kwargs)
  
      # set model state with remaining kwargs, and return any unused kwargs if desired
      if return_unused_kwargs:
          state = {k: v for k, v in kwargs.items() if hasattr(model, k)}
          model._load_state(state)
          return model, {
              k: v for k, v in kwargs.items() if k not in state
          }
      model._load_state(kwargs)
      return model
  
file_path: merlion/merlion/models/factory.py
imports: import copy
  import inspect
  import logging
  from typing import Dict, Tuple, Type, Union
  import dill
  from merlion.models.base import ModelBase
  from merlion.utils import dynamic_import
label_desc: Use image node_id 2 for calling the ModelFactory obj's underlying member method code with example usage: obj.create(cls, name, return_unused_kwargs) and returns: model, model,  unknown