code: def test_bio_phylo_to_times(tree):
      leaf_times, coal_times = bio_phylo_to_times(tree)
      assert len(coal_times) + 1 == len(leaf_times)
  
      # Check positivity.
      times = torch.cat([coal_times, leaf_times])
      signs = torch.cat(
          [-torch.ones_like(coal_times), torch.ones_like(leaf_times)]
      )
      times, index = times.sort(0)
      signs = signs[index]
      lineages = signs.flip([0]).cumsum(0).flip([0])
      assert (lineages >= 0).all()
  
imports: import io
  import re
  import pytest
  import torch
  import pyro
  from pyro.distributions import CoalescentTimes, CoalescentTimesWithRate
  from pyro.distributions.coalescent import CoalescentRateLikelihood, CoalescentTimesConstraint, _sample_coalescent_times, bio_phylo_to_times
  from pyro.distributions.util import broadcast_shape
  from tests.common import assert_close
label_desc: Use image node_id 11 for calling a global function with example usage: test_bio_phylo_to_times(tree) without return types