def checkBaseSet(val, arcrole, ELR, relsSet):
    # check hypercube-dimension relationships
     
    if arcrole in arcroleChecks:
        arcroleCheck = arcroleChecks[arcrole]
        notFromQname = notToQname = notFromErrCode = notToErrCode = None
        if len(arcroleCheck) == 3:
            fromQname, toQname, fromErrCode = arcroleCheck
            toErrCode = fromErrCode
        elif len(arcroleCheck) == 4: 
            fromQname, toQname, fromErrCode, toErrCode = arcroleCheck
        elif len(arcroleCheck) == 8:
            fromQname, toQname, fromErrCode, toErrCode, notFromQname, notToQname, notFromErrCode, notToErrCode = arcroleCheck
        else:
            raise Exception("Invalid arcroleCheck " + str(arcroleCheck))
        level = "INFO" if fromErrCode.endswith(":info") else "ERROR"
        for modelRel in relsSet.modelRelationships:
            fromMdlObj = modelRel.fromModelObject
            toMdlObj = modelRel.toModelObject
            if fromQname:
                if (fromMdlObj is None or 
                    # if not in subs group, only warn if the namespace has a loaded schema, otherwise no complaint
                    (not val.modelXbrl.isInSubstitutionGroup(fromMdlObj.elementQname, fromQname) and
                     fromMdlObj.elementQname.namespaceURI in val.modelXbrl.namespaceDocs)):
                    val.modelXbrl.log(level, fromErrCode,
                        _("Relationship from %(xlinkFrom)s to %(xlinkTo)s should have an %(element)s source"),
                        modelObject=modelRel, xlinkFrom=modelRel.fromLabel, xlinkTo=modelRel.toLabel, element=fromQname)
                elif notFromQname and val.modelXbrl.isInSubstitutionGroup(fromMdlObj.elementQname, notFromQname):
                    val.modelXbrl.log(level, notFromErrCode,
                        _("Relationship from %(xlinkFrom)s to %(xlinkTo)s should not have an %(element)s source"),
                        modelObject=modelRel, xlinkFrom=modelRel.fromLabel, xlinkTo=modelRel.toLabel, element=fromQname)
            if toQname:
                if (toMdlObj is None or 
                    (not val.modelXbrl.isInSubstitutionGroup(toMdlObj.elementQname, toQname) and
                     toMdlObj.elementQname.namespaceURI in val.modelXbrl.namespaceDocs)):
                    val.modelXbrl.log(level, toErrCode,
                        _("Relationship from %(xlinkFrom)s to %(xlinkTo)s should have an %(element)s target"),
                        modelObject=modelRel, xlinkFrom=modelRel.fromLabel, xlinkTo=modelRel.toLabel, element=toQname)
                elif notToQname and val.modelXbrl.isInSubstitutionGroup(fromMdlObj.elementQname, notToQname):
                    val.modelXbrl.log(level, notFromErrCode,
                        _("Relationship from %(xlinkFrom)s to %(xlinkTo)s should not have an %(element)s target"),
                        modelObject=modelRel, xlinkFrom=modelRel.fromLabel, xlinkTo=modelRel.toLabel, element=fromQname)
    if arcrole == XbrlConst.functionImplementation:
        for relFrom, rels in relsSet.fromModelObjects().items():
            if len(rels) > 1:
                val.modelXbrl.error("xbrlcfie:tooManyCFIRelationships",
                    _("Function-implementation relationship from signature %(name)s has more than one implementation target"),
                     modelObject=[relFrom] + rels, name=relFrom.name)
        for relTo, rels in relsSet.toModelObjects().items():
            if len(rels) > 1:
                val.modelXbrl.error("xbrlcfie:tooManyCFIRelationships",
                    _("Function implementation %(xlinkLabel)s must be the target of only one function-implementation relationship"),
                    modelObject=[relTo] + rels, xlinkLabel=relTo.xlinkLabel)
    elif arcrole == XbrlConst.assertionUnsatisfiedSeverity:
        for relFrom, rels in relsSet.fromModelObjects().items():
            if len(rels) > 1:
                val.modelXbrl.error("seve:multipleSeveritiesForAssertionError",
                    _("Assertion-unsatisfied-severity relationship from %(xlinkLabel)s has more than one severity target"),
                     modelObject=[relFrom] + rels, xlinkLabel=relFrom.xlinkLabel)
dataset/ETHPy150Open Arelle/Arelle/arelle/ValidateFormula.py/checkBaseSet/original