def __init__(self, v, aspectValues):
        self.modelXbrl = v.modelXbrl
        self.segDimVals = {}
        self.scenDimVals = {}
        self.qnameDims = {}
        self.entityIdentifierHash = self.entityIdentifier = None
        self.isStartEndPeriod = self.isInstantPeriod = self.isForeverPeriod = False
        
        for aspect, aspectValue in aspectValues.items():
            if aspect == Aspect.PERIOD_TYPE:
                if aspectValue == "forever":
                    self.isForeverPeriod = True
                elif aspectValue == "instant":
                    self.isInstantPeriod = True
                elif aspectValue == "duration":
                    self.isStartEndPeriod = True
            elif aspect == Aspect.START:
                self.isStartEndPeriod = True
                self.startDatetime = aspectValue
            elif aspect == Aspect.END:
                self.isStartEndPeriod = True
                self.endDatetime = aspectValue
            elif aspect == Aspect.INSTANT:
                self.isInstantPeriod = True
                self.endDatetime = self.instantDatetime = aspectValue
            elif isinstance(aspect, QName):
                try: # if a DimVal, then it has a suggested context element
                    contextElement = aspectValue.contextElement
                    aspectValue = (aspectValue.memberQname or aspectValue.typedMember)
                except __HOLE__: # probably is a QName, not a dim value or dim prototype
                    contextElement = v.modelXbrl.qnameDimensionContextElement.get(aspect)
                if v.modelXbrl.qnameDimensionDefaults.get(aspect) != aspectValue: # not a default
                    try:
                        dimConcept = v.modelXbrl.qnameConcepts[aspect]
                        dimValPrototype = DimValuePrototype(v, dimConcept, aspect, aspectValue, contextElement)
                        self.qnameDims[aspect] = dimValPrototype
                        if contextElement != "scenario": # could be segment, ambiguous, or no information
                            self.segDimVals[dimConcept] = dimValPrototype
                        else:
                            self.scenDimVals[dimConcept] = dimValPrototype
                    except KeyError:
                        pass
            elif isinstance(aspectValue, ModelObject):
                # these do not expect a string aspectValue, but the object model aspect value
                if aspect == Aspect.PERIOD: # period xml object
                    context = aspectValue.getparent()
                    for contextPeriodAttribute in ("isForeverPeriod", "isStartEndPeriod", "isInstantPeriod",
                                                   "startDatetime", "endDatetime", "instantDatetime",
                                                   "periodHash"):
                        setattr(self, contextPeriodAttribute, getattr(context, contextPeriodAttribute, None))
                elif aspect == Aspect.ENTITY_IDENTIFIER: # entitytIdentifier xml object
                    context = aspectValue.getparent().getparent()
                    for entityIdentAttribute in ("entityIdentifier", "entityIdentifierHash"):
                        setattr(self, entityIdentAttribute, getattr(context, entityIdentAttribute, None))
dataset/ETHPy150Open Arelle/Arelle/arelle/PrototypeInstanceObject.py/ContextPrototype.__init__