You can just play with symbol levels :
And configure levels like this :
Starting by the minimum level value, QGIS will draw one symbol layer after another. So, here, it will begin with the blue one 0 (attribute two), then the red one 1 (bottom symbol layer of the attribute one) and finally the green symbol layer 2.
Correct me if I am wrong but IMHO this question was asked several times already. Here are some evidences:
Styling polygon layer as dissolved with QGIS Geometry generator
Label sums of surfaces grouped by common attribute values
Showing only outer boundaries of polygons / features in QGIS
Use the following expression boundary(buffer(collect($geometry), 0)) ...
Set a rule based label with Filter is_layer_visible ('layer1') an the label settings for layer 1 (see screenshot 1). Copy and paste this rule and adapt is (see screenshot 2). When you now toggle visibility of layer1 and layer2, the label on layer3 will adapt and show the layer for the layer(s) that is (are) visible.
The Layer class of arcpy.mapping does not have a property named showLables [sic] but it does have one named showLabels. I would change the code that you have presented to be:
for lyr in lyrList:
lyr = arcpy.mapping.ListLayers(mxd, lyr, df)
lyr.showLabels = False # spelling of property ...
Functions with layer defined by context
The function count is an aggregate function that should be used when the layer could be defined by the context where the expression is evaluated (if you use this formula in a labelling rule the layer will be defined).
As you are evaluating this expression in a text box within a layout, there is no layer defined by ...
I presume you're using an atlas layer for your layout and that score is a field from that layer.
The expression will result in 0% in the textbox when the atlas hasn't been activated.
If you activate the atlas in the layout window (click the world map icon button as circled in red below) it should show you the correct percentage per feature.
A solution using a case
WHEN i = 'other' THEN i_o
END as i
You can mostly do the same without any SQL using QGIS expressions for labeling if using Desktop GIS like QGIS but I do not know your usage context (web or desktop, software used,...)
You may try to merge the labels to only get one line with all the labels attached to the same line by using a dedicated virtual layer e.g below screenshot. Not a complete answer, but one solution to solve your issue maybe?!