def _setup_node(self, node):
        """ An internal function performs some safety checks, sets attribute,
        and set_identifiers """
        try:
            if type(node._attr_name) is not str:
                raise AttributeError
        except __HOLE__ as e:
            raise AttributeError('Dynamically inserted nodes must have a _attr_name'
                                 ' attribute as a string. Please add it. ')

        if hasattr(self, node._attr_name):
            raise AttributeError( 'Attribute name {0} overlaps with a Form '
                                 'attribute. Please rename.'
                .format(node._attr_name))

        node.set_identifiers(self.name)
        setattr(self, node._attr_name, node)
dataset/ETHPy150Open icook/yota/src/yota/__init__.py/Form._setup_node