def _uid_or_str(node_or_entity):
    """ Helper function to support the transition from `Entitie`s to `Node`s.
    """
    return node_or_entity.uid if hasattr(node_or_entity, 'uid') else str(
        node_or_entity)
