'generate an attribute to be include to a node or edge.
copied from the declared attributes, thus any attribute has to be declared first'

def makeAttributeInstance(self, attClass, id=None, value=None, start=None, end=None, startopen=False, endopen=False):

    if (attClass in self.attClass_choices):
        if (id in self[attClass].keys()):
            att = {'id': id}
            att['value'] = (value if value else self[attClass][id]['defaultValue'])
            if (((self[attClass][id]['mode'] == 'dynamic') and start) or end):
                if start:
                    att['start'] = start
                if startopen:
                    att['startopen'] = startopen
                if end:
                    att['end'] = end
                if endopen:
                    att['endopen'] = endopen
            return att
        else:
            raise Exception(('wrong    attribute    id    (%s),    declare    the    attribute    first    with    declareAttribute' % (id,)))
    else:
        raise Exception(((('wrong    attClass    :    ' + str(attClass)) + '    Should    be    in    ') + str(self.type_choices)))
