def get_events(phylo):
    """
    Infer gain/loss on individual branches of the tree.
    """
    phylo.disambiguate_labels()
    events = []
    event_nodes = phylo.get_event_nodes()
    for name in event_nodes:
        n = phylo.get_node(name)
        if n.ancestor.label == 1:
            events.extend(['loss_{}'.format(name)])
        else:
            events.extend(['gain_{}'.format(name)])
    orth_str = ','.join(events)
    return orth_str
