Default values are defined here.

def handle_args():
    """
    Default values are defined here.
    """

    default_database_name = dbconfig.testdb_corpus_url.database
    parser = argparse.ArgumentParser(
        prog=os.path.basename(__file__),
        # formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        formatter_class=MyFormatter,
        description=textwrap.dedent("""\
        Dump the raw VOEvents as XML files, collected into bzip2'd tarballs.

        If start or end times are specified, then the range is start-inclusive
        end-exclusive, i.e.

            start <= author_datetime < end

        NB when writing compressed tarballs in Python, the entire file is
        composed in memory before writing to file. This means that setting
        `nsplit` too large will result in very high memory usage! The default
        value of 5000 seems to peak at <250MB of RAM (though this varies
        according to the size of the VOEvent packets, and assumes
        `prefetch=False`). Some quick tests suggest typical RAM usage
            ~= 40MB + 30MB*(nsplit/1000) .
        """),

    )
    parser.add_argument('tarfile_pathstem',
                        help='Path to tarball to create, e.g. `foobar`. '
                             'Suffix ``.tar.bz2`` will be appended.'
                        )

    parser.add_argument('-d', '--dbname', nargs='?',
                        default=str(default_database_name),
                        help='Database name')

    parser.add_argument('-n', '--nsplit',
                        type=int,
                        default=5000,
                        help=
                        "Output multiple files, `NSPLIT` packets per tarball."
                        "Naming convention is `<stem>.001.tar.bz2, <stem>.002.tar.bz2, ...`"
                        )
    parser.add_argument('-s', '--start',
                        type=iso8601.parse_date,
                        default=None,
                        help="Filter events by author_date>=`START`")
    parser.add_argument('-e', '--end',
                        type=iso8601.parse_date,
                        default=datetime.datetime.now(tz=pytz.UTC),
                        help=
                        "Filter events by author_date<`END`")
    parser.add_argument('-p', '--prefetch', action='store_true', default=False,
                        help=
                        "Bulk-fetch XML packets from DB (~3x faster, but "
                        "uses considerably more RAM, depending on value of "
                        "`nsplit`.)"
                        )
    parser.add_argument('-a', '--all', action='store_true', default=False,
                        help=
                        "Ignore any datetime filters, dump **all** VOEvents."
                        "(This option is provided to allow dumping of VOEvents"
                        "with author_datetime=Null, which are otherwise ignored.)"
                        )
    return parser.parse_args()