def get_depth(phylo_tree):
    """
        Returns the depth of a tree.
    """
    depth = 0
    for terminal_node in phylo_tree.get_terminals(order='preorder'):
        path_length = len(phylo_tree.get_path(target=terminal_node))
        if path_length > depth:
            depth = path_length

    return depth