

def undirectedRevCycle(val, fromELR, mbrConcept, turnbackRel, drsELR, drsRelsFrom, drsRelsTo, fromConceptELRs, ELRsVisited):
    for arcrole in (XbrlConst.domainMember, XbrlConst.dimensionDomain):
        '\n        for ELR in ELRsVisited if (not fromELR) else (fromELR,):\n            for rel in val.modelXbrl.relationshipSet(arcrole, ELR).toModelObject(mbrConcept):\n                if not rel.isIdenticalTo(turnbackRel):\n                    relFrom = rel.fromModelObject\n                    relELR = rel.linkrole\n                    if relFrom in fromConcepts and relELR == drsELR:\n                        return True\n                    if undirectedRevCycle(val, relELR, relFrom, turnbackRel, drsELR, fromConcepts, ELRsVisited):\n                        return True\n        '
        if drsRelsTo:
            mbrDomRels = drsRelsTo[mbrConcept]
        else:
            mbrDomRels = val.modelXbrl.relationshipSet(arcrole, None).toModelObject(mbrConcept)
        for rel in mbrDomRels:
            if (not rel.isIdenticalTo(turnbackRel)):
                relFrom = rel.fromModelObject
                relELR = rel.linkrole
                if ((relFrom in fromConceptELRs) and (relFrom in fromConceptELRs[relFrom])):
                    return [rel, False]
                cycleCausingConcept = undirectedRevCycle(val, relELR, relFrom, turnbackRel, drsELR, drsRelsFrom, drsRelsTo, fromConceptELRs, ELRsVisited)
                if (cycleCausingConcept is not None):
                    cycleCausingConcept.append(rel)
                    cycleCausingConcept.append(False)
                    return cycleCausingConcept
    return None

dataset/ETHPy150Open Arelle/Arelle/arelle/ValidateFilingDimensions.py undirectedRevCycle/VarMisuse@120/408 `relELR`->`relFrom`