def node_name(node):
    """
        Convenience function: Returns node.id, or node.name, or None
    """
    return hasattr(node, 'id') and node.id or hasattr(node, 'name') and node.name
Convenience function: Returns node.id, or node.name, or None