'Emit SET_LINENO if necessary.
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
Returns true if SET_LINENO was emitted.
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.'

def set_lineno(self, node, force=False):

    lineno = getattr(node, 'lineno', None)
    if ((lineno is not None) and ((lineno != self.last_lineno) or force)):
        self.emit('SET_LINENO', lineno)
        self.last_lineno = lineno
        return True
    return False
