def _f_gen(self, c):
lf_idx = self.candidate_classes.index(c.__class__)<EOL>labels = lambda c: [(c.id, lf.__name__, lf(c)) for lf in self.lfs[lf_idx]]<EOL>for cid, lf_key, label in labels(c):<EOL><INDENT>if isinstance(label, int):<EOL><INDENT>yield cid, lf_key, label<EOL><DEDENT>elif label is None:<EOL><INDENT>yield cid, lf_key, <NUM_LIT:0><EOL><DEDENT>elif label in c.values:<EOL><INDENT>if c.cardinality > <NUM_LIT:2>:<EOL><INDENT>yield cid, lf_key, c.values.index(label) + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>val = <NUM_LIT:1> if c.values.index(label) == <NUM_LIT:0> else -<NUM_LIT:1><EOL>yield cid, lf_key, val<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>
Convert lfs into a generator of id, name, and labels.

        In particular, catch verbose values and convert to integer ones.