code: def collection(path, *stats):
    
  
    def initMethod(self):
      """Init method for the underlying stat object's class."""
      init(self, path)
  
    attributes = {'__init__': initMethod}
    for stat in stats:
      attributes[stat.getName()] = stat
    newClass = type('Stats:%s' % path, (object,), attributes)
    instance = newClass()
    for stat in stats:
      default = stat._getInit() # Consider this method package-protected. # pylint: disable=W0212
      if default:
        setattr(instance, stat.getName(), default)
    return instance
docs: Creates a named stats collection object.