def _get_pairs_of_neighbours(graph, node):
    """ For a given node, return all possible pairs of neighbours.
    Returns a list of tuple pairs. Each tuple has the smallest element 
    first. The list is also sorted.
    """
    neighbours = list(graph.edge[node].keys())
    
    pairs = []
    
    n = len(neighbours)
    for i1 in range(0, n):
        for i2 in range(i1+1, n):
            n1, n2 = neighbours[i1], neighbours[i2]
            if n1 > n2:
                n1, n2 = n2, n1
            pairs.append((n1, n2))
    
    pairs.sort()
    return pairs