Being pedantic: can you split this line into two:
    
    if is_lograithmic(edges):
        ...
    else:
        ...