def METHOD_NAME(item, solver):
    if hasattr(item, 'translate'):
        generator = item.translate(solver)
        if generator is None:
            raise NotImplementedError(f'{item}.translate() did not return a valid generator')
        assert solver is not None
        formulae = list(generator)
        if len(formulae) == 0:
            raise NotImplementedError(f'{item}.translate() yielded an empty list of expressions')
        yield from solver.annotate(formulae, solver.label(item))