<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def newick(args):
 """ %prog newick idslist Query a list of IDs to retrieve phylogeny. """

    p = OptionParser(newick.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    idsfile, = args
    mylist = [x.strip() for x in open(idsfile) if x.strip()]
    print(get_taxids(mylist))

    t = TaxIDTree(mylist)
    print(t)