from typing import Any
from typing import Optional


def get_node_anchor(node: Any) -> Optional[str]:
    """
    Returns a node's Anchor/Alias name or None wheh there isn't one.
    """
    if (
            not hasattr(node, "anchor")
            or node.anchor is None
            or node.anchor.value is None
            or not node.anchor.value
    ):
        return None
    return str(node.anchor.value)