def add_model(self, model, force=False):
if isinstance(model, str):<EOL><INDENT>self._load_model(model)<EOL>return<EOL><DEDENT>try:<EOL><INDENT>model = model()<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>if model._yang_name not in [a[<NUM_LIT:0>] for a in SUPPORTED_MODELS] and not force:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>for k, v in model:<EOL><INDENT>self._elements[k] = v<EOL>setattr(self, k, v)<EOL><DEDENT>
Add a model.

The model will be asssigned to a class attribute with the YANG name of the model.

Args:
    model (PybindBase): Model to add.
    force (bool): If not set, verify the model is in SUPPORTED_MODELS

Examples:

    >>> import napalm_yang
    >>> config = napalm_yang.base.Root()
    >>> config.add_model(napalm_yang.models.openconfig_interfaces)
    >>> config.interfaces
    <pyangbind.lib.yangtypes.YANGBaseClass object at 0x10bef6680>