import ast


def _is_simple_enough(node: ast.AST) -> bool:
    """Returns whether a node is simple enough to be substituted into an f-string."""
    if isinstance(node, ast.Name):
        return True
    elif isinstance(node, ast.Attribute):
        return _is_simple_enough(node.value)
    else:
        return False