original_docstring: add to the lineage array the provided context reference (or a reference to the context object is one is given instead)
docstring: add to the lineage array the provided context reference (or a reference to the context object is one is given instead)
docstring_tokens: add to the lineage array the provided context reference ( or a reference to the context object is one is given instead )
code: def _add_lineage(self, obj_lineage: 'CdmObject', validate: Optional[bool] = True) -> Union['CdmAttributeContextReference', None]:
          """add to the lineage array the provided context reference (or a reference to the context object is one is given instead)"""
          # sort out which is the ref and which is the object.
          # attCtxRef object are special in that they don't support an inline definition but they do hold a pointer to the
          # actual context object in the explicit reference member
          if obj_lineage.object_type == CdmObjectType.ATTRIBUTE_CONTEXT_REF:
              ref_lineage = obj_lineage
              obj_lineage = ref_lineage.explicit_reference
          elif obj_lineage.object_type == CdmObjectType.ATTRIBUTE_CONTEXT_DEF:
              acLin = obj_lineage
              ref_lineage = self.ctx.corpus.make_object(CdmObjectType.ATTRIBUTE_CONTEXT_REF, acLin.at_corpus_path, True)
              ref_lineage.explicit_reference = acLin
          else:
              # programming error
              return None
          if self.lineage is None:
              # not allocated by default
              self.lineage = CdmCollection(self.ctx, self, CdmObjectType.ATTRIBUTE_CONTEXT_REF)  # type: CdmCollection[CdmAttributeContextReference]
          if ref_lineage.explicit_reference.id == self.id:
              # why do that?
              return None
          self.lineage.append(ref_lineage)
  
          # debugging. get the parent of the context tree and validate that this node is in that tree (Ported from C# written by Jeff)
          # if (validate == true)
          # {
          #     CdmAttributeContext trace = refLineage.ExplicitReference as CdmAttributeContext;
          #     while (trace.Parent != null)
          #         trace = trace.Parent.ExplicitReference as CdmAttributeContext;
          #     trace.ValidateLineage(null);
          # }
  
          return ref_lineage
code_tokens: def _add_lineage ( self , obj_lineage : 'CdmObject' , validate : Optional [ bool ] = True ) -> Union [ 'CdmAttributeContextReference' , None ] : if obj_lineage . object_type == CdmObjectType . ATTRIBUTE_CONTEXT_REF : ref_lineage = obj_lineage obj_lineage = ref_lineage . explicit_reference elif obj_lineage . object_type == CdmObjectType . ATTRIBUTE_CONTEXT_DEF : acLin = obj_lineage ref_lineage = self . ctx . corpus . make_object ( CdmObjectType . ATTRIBUTE_CONTEXT_REF , acLin . at_corpus_path , True ) ref_lineage . explicit_reference = acLin else : return None if self . lineage is None : self . lineage = CdmCollection ( self . ctx , self , CdmObjectType . ATTRIBUTE_CONTEXT_REF ) if ref_lineage . explicit_reference . id == self . id : return None self . lineage . append ( ref_lineage ) return ref_lineage
short_docstring: add to the lineage array the provided context reference (or a reference to the context object is one is given instead)
short_docstring_tokens: add to the lineage array the provided context reference ( or a reference to the context object is one is given instead )
comment: """add to the lineage array the provided context reference (or a reference to the context object is one is given instead)"""$SEP$# sort out which is the ref and which is the object.$SEP$# attCtxRef object are special in that they don't support an inline definition but they do hold a pointer to the$SEP$# actual context object in the explicit reference member$SEP$# programming error$SEP$# not allocated by default$SEP$# type: CdmCollection[CdmAttributeContextReference]$SEP$# why do that?$SEP$# debugging. get the parent of the context tree and validate that this node is in that tree (Ported from C# written by Jeff)$SEP$# if (validate == true)$SEP$# {$SEP$#     CdmAttributeContext trace = refLineage.ExplicitReference as CdmAttributeContext;$SEP$#     while (trace.Parent != null)$SEP$#         trace = trace.Parent.ExplicitReference as CdmAttributeContext;$SEP$#     trace.ValidateLineage(null);$SEP$# }