code: def make(cls, **kwargs):
      
      cls_attrs = {f.name: f for f in attr.fields(cls)}
  
      unknown = {k: v for k, v in kwargs.items() if k not in cls_attrs}
      if len(unknown) > 0:
          _LOGGER.warning(
              "Got unknowns for %s: %s - please create an issue!", cls.__name__, unknown
          )
  
      missing = [k for k in cls_attrs if k not in kwargs]
  
      data = {k: v for k, v in kwargs.items() if k in cls_attrs}
  
      # initialize missing values to avoid passing default=None
      # for the attrs attribute definitions
      for m in missing:
          default = cls_attrs[m].default
          if isinstance(default, attr.Factory):
              if not default.takes_self:
                  data[m] = default.factory()
              else:
                  raise NotImplementedError
          else:
              _LOGGER.debug("Missing key %s with no default for %s", m, cls.__name__)
              data[m] = None
  
      # initialize and store raw data for debug purposes
      inst = cls(**data)
      setattr(inst, "raw", kwargs)
  
      return inst
docs: Create a container.
  
      Reports extra keys as well as missing ones.
      Thanks to habnabit for the idea!