Understanding pseudocode for co-democratic learning
Let's try to make some sense of what is going on here:

In the first 3 lines as you say, we build $n$ models, being $m$ a single model.

The second loop starts iterating over the unlabelled sample set $U$. For each unlabelled sample $x$, we iterate over the possible labels (e.g $\{0,1\}$ for binary classification, or $dog\space vs.\space cat$, etc...) from the set $C$ and we call it $j$. 

$M$ thus is the set of models $m$, that predict that sample $x$ is of the class $j$ 

After that, if the number of models $|M|$ (where $0\leq |M|\leq n$) that agree that label is $j$ are more than half of the models available ($|M|&gt;n/2$) and the weighted mean ($w$ is the confidence intervals 
of the models) of the models that agree on this prediction is higher than the models that disagree (line 7) → then the sample $x$ is included in $L$ with label $j$ (line 8).