@utils.check_messages('pointless-statement', 'pointless-string-statement', 'expression-not-assigned')
def visit_expr(self, node):
    'Check for various kind of statements without effect'
    expr = node.value
    if (isinstance(expr, astroid.Const) and isinstance(expr.value, str)):
        scope = expr.scope()
        if isinstance(scope, (astroid.ClassDef, astroid.Module, astroid.FunctionDef)):
            if (isinstance(scope, astroid.FunctionDef) and (scope.name != '__init__')):
                pass
            else:
                sibling = expr.previous_sibling()
                if ((sibling is not None) and (sibling.scope() is scope) and isinstance(sibling, (astroid.Assign, astroid.AnnAssign))):
                    return
        self.add_message('pointless-string-statement', node=node)
        return
    if (isinstance(expr, (astroid.Yield, astroid.Await, astroid.Ellipsis, astroid.Call)) or (isinstance(node.parent, astroid.TryExcept) and (node.parent.body == [node])) or (isinstance(expr, astroid.Const) and (expr.value is Ellipsis))):
        return
    if any(expr.nodes_of_class(astroid.Call)):
        self.add_message('expression-not-assigned', node=node, args=expr.as_string())
    else:
        self.add_message('pointless-statement', node=node)
Check for various kind of statements without effect
@utils.check_messages('pointless-statement', 'pointless-string-statement', 'expression-not-assigned')
def visit_expr(self, node):
    
    expr = node.value
    if (isinstance(expr, astroid.Const) and isinstance(expr.value, str)):
        scope = expr.scope()
        if isinstance(scope, (astroid.ClassDef, astroid.Module, astroid.FunctionDef)):
            if (isinstance(scope, astroid.FunctionDef) and (scope.name != '__init__')):
                pass
            else:
                sibling = expr.previous_sibling()
                if ((sibling is not None) and (sibling.scope() is scope) and isinstance(sibling, (astroid.Assign, astroid.AnnAssign))):
                    return
        self.add_message('pointless-string-statement', node=node)
        return
    if (isinstance(expr, (astroid.Yield, astroid.Await, astroid.Ellipsis, astroid.Call)) or (isinstance(node.parent, astroid.TryExcept) and (node.parent.body == [node])) or (isinstance(expr, astroid.Const) and (expr.value is Ellipsis))):
        return
    if any(expr.nodes_of_class(astroid.Call)):
        self.add_message('expression-not-assigned', node=node, args=expr.as_string())
    else:
        self.add_message('pointless-statement', node=node)