code: def randomise_branch_lengths(
              self,
              i=(1, 1),
              l=(1, 1),
              distribution_func=random.gammavariate,
              inplace=False,
      ):
          
  
          if not inplace:
              t = self.copy()
          else:
              t = self
  
          for n in t._tree.preorder_node_iter():
              if n.is_internal():
                  n.edge.length = max(0, distribution_func(*i))
              else:
                  n.edge.length = max(0, distribution_func(*l))
          t._dirty = True
          return t
docs: Replaces branch lengths with values drawn from the specified
          distribution_func. Parameters of the distribution are given in the
          tuples i and l, for interior and leaf nodes respectively.