code: def instance(cls, key, *args, **kwargs):
          
          klass = cls.entity_class(key)
          return klass(*args, **kwargs)
docs: Create an instance of the class associated with the `key` (xsi:type)
          and initialize it with the *args and **kwargs.
  
          Args:
              key: A class lookup key (see entity_class()).
  
          Returns:
              An instance of the class associated with the `key`.