edk2toollib/uefi/authenticated_variables_structure_support.py
def SortBySignatureDataValue(self, deduplicate: bool = True):
        """
        Sort self's SignatureData_List by SignatureData values (ignores SigOwner) & optionally deduplicate

        When deduplicate is true, remove duplicate SignatureData values from self and return them in an
        EfiSignatureList.  This EfiSignatureList of duplicates is itself not deduplicated.

        When deduplicate is false, returns an empty EfiSignatureList (has 0 Data elements)
        """

        # initialize the duplicate list, an EFI_SIGNATURE_LIST with no signature data entries
        dupes = EfiSignatureList(typeguid=self.SignatureType)
        dupes.SignatureListSize = EfiSignatureList.STATIC_STRUCT_SIZE
        dupes.SignatureHeaderSize = self.SignatureHeaderSize
        dupes.SignatureHeader = self.SignatureHeader
        dupes.SignatureSize = 0
        dupes.SignatureData_List = []

        # if nothing to sort, return the empty dupe list
        if(self.SignatureData_List is None
           or len(self.SignatureData_List) == 1):
            return dupes

        self.SignatureData_List.sort(key=attrgetter('SignatureData'))

        if(deduplicate is False):
            return dupes  # return empty dupe list without performing deduplicate

        # perform deduplicate on self
        last = len(self.SignatureData_List) - 1  # index of the last item
        for i in range(last - 1, -1, -1):
            if self.SignatureData_List[last].SignatureData == self.SignatureData_List[i].SignatureData:
                dupes.SignatureData_List.insert(0, self.SignatureData_List[last])
                dupes.SignatureListSize += self.SignatureSize
                del self.SignatureData_List[last]
                self.SignatureListSize -= self.SignatureSize
                last = i
            else:
                last = i

        # only initialize dupes.SignatureSize if duplicate elements are present
        if(len(dupes.SignatureData_List) > 0):
            dupes.SignatureSize = self.SignatureSize

        return dupes

        Sort self's SignatureData_List by SignatureData values (ignores SigOwner) & optionally deduplicate

        When deduplicate is true, remove duplicate SignatureData values from self and return them in an
        EfiSignatureList.  This EfiSignatureList of duplicates is itself not deduplicated.

        When deduplicate is false, returns an empty EfiSignatureList (has 0 Data elements)
        
Sort self's SignatureData_List by SignatureData values (ignores SigOwner) & optionally deduplicate
When deduplicate is true, remove duplicate SignatureData values from self and return them in an
EfiSignatureList.  This EfiSignatureList of duplicates is itself not deduplicated.

When deduplicate is false, returns an empty EfiSignatureList (has 0 Data elements)
Sort self ' s SignatureData_List by SignatureData values ( ignores SigOwner ) & optionally deduplicate When deduplicate is true remove duplicate SignatureData values from self and return them in an EfiSignatureList . This EfiSignatureList of duplicates is itself not deduplicated . When deduplicate is false returns an empty EfiSignatureList ( has 0 Data elements )
def SortBySignatureDataValue(self, deduplicate: bool = True):
        dupes = EfiSignatureList(typeguid=self.SignatureType)
        dupes.SignatureListSize = EfiSignatureList.STATIC_STRUCT_SIZE
        dupes.SignatureHeaderSize = self.SignatureHeaderSize
        dupes.SignatureHeader = self.SignatureHeader
        dupes.SignatureSize = 0
        dupes.SignatureData_List = []
        if(self.SignatureData_List is None
           or len(self.SignatureData_List) == 1):
            return dupes
        self.SignatureData_List.sort(key=attrgetter('SignatureData'))
        if(deduplicate is False):
            return dupes  
        last = len(self.SignatureData_List) - 1  
        for i in range(last - 1, -1, -1):
            if self.SignatureData_List[last].SignatureData == self.SignatureData_List[i].SignatureData:
                dupes.SignatureData_List.insert(0, self.SignatureData_List[last])
                dupes.SignatureListSize += self.SignatureSize
                del self.SignatureData_List[last]
                self.SignatureListSize -= self.SignatureSize
                last = i
            else:
                last = i
        if(len(dupes.SignatureData_List) > 0):
            dupes.SignatureSize = self.SignatureSize
        return dupes
def SortBySignatureDataValue ( self , deduplicate : bool = True ) : dupes = EfiSignatureList ( typeguid = self . SignatureType ) dupes . SignatureListSize = EfiSignatureList . STATIC_STRUCT_SIZE dupes . SignatureHeaderSize = self . SignatureHeaderSize dupes . SignatureHeader = self . SignatureHeader dupes . SignatureSize = 0 dupes . SignatureData_List = [ ] if ( self . SignatureData_List is None or len ( self . SignatureData_List ) == 1 ) : return dupes self . SignatureData_List . sort ( key = attrgetter ( 'SignatureData' ) ) if ( deduplicate is False ) : return dupes last = len ( self . SignatureData_List ) - 1 for i in range ( last - 1 , - 1 , - 1 ) : if self . SignatureData_List [ last ] . SignatureData == self . SignatureData_List [ i ] . SignatureData : dupes . SignatureData_List . insert ( 0 , self . SignatureData_List [ last ] ) dupes . SignatureListSize += self . SignatureSize del self . SignatureData_List [ last ] self . SignatureListSize -= self . SignatureSize last = i else : last = i if ( len ( dupes . SignatureData_List ) > 0 ) : dupes . SignatureSize = self . SignatureSize return dupes
Sort self's SignatureData_List by SignatureData values (ignores SigOwner) & optionally deduplicate
When deduplicate is true, remove duplicate SignatureData values from self and return them in an
EfiSignatureList.
Sort self ' s SignatureData_List by SignatureData values ( ignores SigOwner ) & optionally deduplicate When deduplicate is true remove duplicate SignatureData values from self and return them in an EfiSignatureList .
"""
        Sort self's SignatureData_List by SignatureData values (ignores SigOwner) & optionally deduplicate

        When deduplicate is true, remove duplicate SignatureData values from self and return them in an
        EfiSignatureList.  This EfiSignatureList of duplicates is itself not deduplicated.

        When deduplicate is false, returns an empty EfiSignatureList (has 0 Data elements)
        """ # initialize the duplicate list, an EFI_SIGNATURE_LIST with no signature data entries # if nothing to sort, return the empty dupe list # return empty dupe list without performing deduplicate # perform deduplicate on self # index of the last item # only initialize dupes.SignatureSize if duplicate elements are present
self
deduplicate
bool