import ast


def is_nontrivial_with_statement(node: ast.AST) -> bool:
    """
    Returns true if the given node is a `with` (or `async with`) statement
    containing any code inside (anything which is not a single `pass` statement).
    """
    if not isinstance(node, (ast.With, ast.AsyncWith)):
        return False
    body = node.body
    return len(node.body) != 1 or not isinstance(body[0], ast.Pass)