import ast


def check_return(node):
    """
    Returns `False` if `ast.Return` only appears at the end of
    `ast.FunctionDef`.
    """       
    class Visitor(ast.NodeVisitor):
        
        def __init__(self):
            self.found = False
        
        def visit_Return(self, node):
            self.found = True
            
        def visit_FunctionDef(self, node):
            body = node.body
            
            # Traverse all of the function with the exception of
            # that one conditional break.
            
            if not body:
                return
            
            # In all but the last statements 'return' may not occur.
            for node in body[:-1]:
                self.visit(node)
                
            if not isinstance(body[-1], ast.Return):
                self.visit(body[-1])
        
            
    visitor = Visitor()
    visitor.visit(node)
    return visitor.found