<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def summary(args):
 """ %prog summary coordsfile provide summary on id% and cov%, for both query and reference """

    from jcvi.formats.blast import AlignStats

    p = OptionParser(summary.__doc__)
    p.add_option("-s", dest="single", default=False, action="store_true",
            help="provide stats per reference seq")

    opts, args = p.parse_args(args)

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

    coordsfile, = args
    alignstats = get_stats(coordsfile)
    alignstats.print_stats()