def cbuuid_to_uuid(cbuuid):
data = cbuuid.data().bytes()<EOL>template = '<STR_LIT>' if len(data) <= <NUM_LIT:4> else '<STR_LIT>'<EOL>value = template.format(hexlify(data.tobytes()[:<NUM_LIT:16>]).decode('<STR_LIT:ascii>'))<EOL>return uuid.UUID(hex=value)<EOL>
Convert Objective-C CBUUID type to native Python UUID type.