def iterReferences( parentReference=None, recursive=False, namespaces=False,
                    refNodes=False, references=True, recurseType='depth'):
    import general
    
    validRecurseTypes = ('breadth', 'width')
    if recurseType not in validRecurseTypes:
        ValueError('%s was not an acceptable value for recurseType - must be one of %s' % (recurseType, ', '.join(validRecurseTypes)))

    if parentReference is None:
        refs = cmds.file(q=1, reference=1)
    else:
        refs = cmds.file(parentReference, q=1, reference=1)
        
    #print "reference", parentReference
    while refs:
        #if recursive and recurseType == 'breadth':
        ref = refs.pop(0)
        row = []

        refNode = cmds.file( ref, q=1, referenceNode=1)
        refNode = general.PyNode( refNode )

        if namespaces:
            row.append( refNode.namespace() + cmds.file( ref, q=1, namespace=1)  )
        if refNodes:
            row.append( refNode )
        if references:
            row.append( FileReference(refNode) )
        if len(row) == 1:
            row = row[0]
        else:
            row = tuple(row)
        yield row
        if recursive:
            if recurseType == 'depth':
                for x in iterReferences(parentReference=ref,
                                        recursive=True,
                                        namespaces=namespaces,
                                        refNodes=refNodes,
                                        references=references):
                    #print "yield sub"
                    yield x
            elif recurseType == 'breadth':
                refs.extend(cmds.file(ref, q=1, reference=1))
        #print "for done"
    #print "done"
Initializes this class.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/core/system.py/iterReferences--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/masterd/instance.py/DiskImport.__init__