def has_self_cycles(graph):
    """
    Determine if nodes in a graph contain self-cycles.

    Args:
        graph (nx.Graph): graph to test.
    Returns:
        (boolean): whether any node in the graph has an edge connecting to
            itself.
    """
    edges = graph.edges()
    for node in graph.nodes():
        if (node, node) in edges:
            return True
    return False