def out(self):
        for part in self.parts:
            if isinstance(part, Import):
                continue
            if part is None:
                continue
                
            elem = part.repr(self, "", {}, False)
            if elem:
                if isinstance(elem, PyAttributeGroup):
                    self.attrgrp.append(elem)
                else:
                    self.elems.append(elem)
        
        eldict = {}
        for elem in self.elems:
            eldict[elem.name] = elem

        #print eldict.keys()
        
        intro()
        for modul in self.add:
            print "from %s import *" % modul
        for _namespace, (mod, namn) in self.impo.items():
            if namn:
                print "import %s as %s" % (mod, namn)
        print        
        print "NAMESPACE = '%s'" % self.target_namespace
        print

        for defs in self.defs:
            print defs
            print
        
        exceptions = []
        block = []
        while self._do(eldict):
            print "#.................."
            (objekt, tups) = self.adjust(eldict, block)
            if not objekt:
                break
            ignore = [p.name for (p, _l, _s) in tups]
            done = output(objekt, self.target_namespace, eldict, ignore)
            if done:
                for (prop, lines, _) in tups:
                    exceptions.extend(lines)
                block = []
            else:
                block = block_items(objekt, block, eldict)

        if exceptions:
            print "#", 70*'+'
            for line in exceptions:
                print line
            print "#", 70*'+'
            print
        
        for attrgrp in self.attrgrp:
            print "AG_%s = [" % attrgrp.name
            for prop in attrgrp.properties[0]:
                if isinstance(prop.type, PyObj):
                    print "%s('%s', %s_, %s)," % (INDENT, prop.name, 
                                                prop.type.name, prop.required)
                else:
                    print "%s('%s', '%s', %s)," % (INDENT, prop.name, 
                                                    prop.type, prop.required)
            print "]"
            print
           
        self._element_from_string() 
        self._element_by_tag()
        print
        print "def factory(tag, **kwargs):"
        print "    return ELEMENT_BY_TAG[tag](**kwargs)"
        print
        
        
# -----------------------------------------------------------------------------
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/tools/parse_xsd2.py/Schema.out/original