def _create(cls, val, name, attr):
    """ Create instance from the class that will be set in the metaclass.
            The `value` and `name` atrributes have counterparts with `_` to
            allow these names to be overriten and still be available.
            This function also set all the instance attributes.
        """
    error = hasattr(cls, name)
    self = cls(name)
    if error or not isinstance(self, cls):
        cls_ = type(self)
        parent = 'parent ' if cls != type(self) else ''
        raise RuntimeError('Name %r already on %sclass %r' % (name, parent,
            cls_.__name__))
    self._value = self.value = val
    self._name = self.name = name
    for k, v in attr.items():
        setattr(self, k, v)
    return self
