def is_edge_monochromatic(graph, colour=None):
    """True/False whether graph is edge monochromatic. If colour is specified will
    only return True if monochromatic for given colour
    Return:
    boolean
    """
    def get_edge_colour(graph, u, v):
        return graph.get_edge_data(u, v)['colour']
    edge_iterator = iter(graph.edges)
    seen_colour = get_edge_colour(graph, *next(edge_iterator))
    if seen_colour != colour:
        return False
    for u, v in edge_iterator:
        if get_edge_colour(graph, u, v) != colour:
            return False
    return True