edk2toollib/uefi/edk2/parsers/guid_parser.py
def reg_guid_from_c_format(cls, guidstring: str) -> str:
        """ convert a c formatted guidstring to a registry formatted guidstring

        Args:
          guidstring: str: c format guidstring

        Returns:
          Success: guidstring in registry format
          Failure: empty string ''
        """
        guidstring = guidstring.strip()
        if not cls.is_guid_in_c_format(guidstring):
            return ''

        guidValueString = guidstring.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
        guidValueList = guidValueString.split(",")
        if len(guidValueList) != 11:
            return ''
        try:
            return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
                int(guidValueList[0], 16),
                int(guidValueList[1], 16),
                int(guidValueList[2], 16),
                int(guidValueList[3], 16),
                int(guidValueList[4], 16),
                int(guidValueList[5], 16),
                int(guidValueList[6], 16),
                int(guidValueList[7], 16),
                int(guidValueList[8], 16),
                int(guidValueList[9], 16),
                int(guidValueList[10], 16)
            )
        except:
            return ''
 convert a c formatted guidstring to a registry formatted guidstring

        Args:
          guidstring: str: c format guidstring

        Returns:
          Success: guidstring in registry format
          Failure: empty string ''
        
convert a c formatted guidstring to a registry formatted guidstring
convert a c formatted guidstring to a registry formatted guidstring
def reg_guid_from_c_format(cls, guidstring: str) -> str:
        guidstring = guidstring.strip()
        if not cls.is_guid_in_c_format(guidstring):
            return ''
        guidValueString = guidstring.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
        guidValueList = guidValueString.split(",")
        if len(guidValueList) != 11:
            return ''
        try:
            return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
                int(guidValueList[0], 16),
                int(guidValueList[1], 16),
                int(guidValueList[2], 16),
                int(guidValueList[3], 16),
                int(guidValueList[4], 16),
                int(guidValueList[5], 16),
                int(guidValueList[6], 16),
                int(guidValueList[7], 16),
                int(guidValueList[8], 16),
                int(guidValueList[9], 16),
                int(guidValueList[10], 16)
            )
        except:
            return ''
def reg_guid_from_c_format ( cls , guidstring : str ) -> str : guidstring = guidstring . strip ( ) if not cls . is_guid_in_c_format ( guidstring ) : return '' guidValueString = guidstring . lower ( ) . replace ( "{" , "" ) . replace ( "}" , "" ) . replace ( " " , "" ) . replace ( ";" , "" ) guidValueList = guidValueString . split ( "," ) if len ( guidValueList ) != 11 : return '' try : return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % ( int ( guidValueList [ 0 ] , 16 ) , int ( guidValueList [ 1 ] , 16 ) , int ( guidValueList [ 2 ] , 16 ) , int ( guidValueList [ 3 ] , 16 ) , int ( guidValueList [ 4 ] , 16 ) , int ( guidValueList [ 5 ] , 16 ) , int ( guidValueList [ 6 ] , 16 ) , int ( guidValueList [ 7 ] , 16 ) , int ( guidValueList [ 8 ] , 16 ) , int ( guidValueList [ 9 ] , 16 ) , int ( guidValueList [ 10 ] , 16 ) ) except : return ''
convert a c formatted guidstring to a registry formatted guidstring
convert a c formatted guidstring to a registry formatted guidstring
""" convert a c formatted guidstring to a registry formatted guidstring

        Args:
          guidstring: str: c format guidstring

        Returns:
          Success: guidstring in registry format
          Failure: empty string ''
        """
guidstring in registry format
Failure: empty string ''
guidstring in registry format Failure : empty string ' '
Success
cls
guidstring
str
c format guidstring
c format guidstring