def main(arguments): prune = False if arguments.url: tree = Tree().get(url=arguments.url, schema="newick", preserve_underscores=True) elif arguments.path: tree = Tree().get(path=arguments.path, schema="newick", preserve_underscores=True) else: raise ValueError( "No input argument found. Please specify either --url or --path") if arguments.rename is not None: tree, prune_list = rename_tree(tree, arguments.rename) tree = collapse_polytomies(tree, arguments.limit) if prune: PareTree_wrapper(tree, prune_list, arguments.output) else: tree.write(path=arguments.output, schema="newick")