def METHOD_NAME(size: int) -> bytes:
    """
    Serialize an integer using Bitcoin's compact size unsigned integer serialization.
    :param size: The int to serialize
    :returns: The int serialized as a compact size unsigned integer
    """
    r = b""
    if size < 253:
        r = struct.pack("B", size)
    elif size < 0x10000:
        r = struct.pack("<BH", 253, size)
    elif size < 0x100000000:
        r = struct.pack("<BI", 254, size)
    else:
        r = struct.pack("<BQ", 255, size)
    return r