def main():

    # Setup argument parsing
    parser = argparse.ArgumentParser(
        description='PyPI Current Package Version Checker',
        epilog='Licensed "Apache 2.0"')

    parser.add_argument(
        '-f',
        '--format',
        choices=['requirements', 'bare'],
        default='requirements',
        help='<Optional> Output format',
        required=False
    )

    parser.add_argument(
        '-l',
        '--layout',
        choices=['vertical', 'horizontal'],
        default='vertical',
        help='<Optional> Output layout',
        required=False
    )

    parser.add_argument(
        '-p',
        '--packages',
        nargs='+',
        help='<Required> Space-delimited list of packages',
        required=True
    )

    # Parse arguments
    args = parser.parse_args()

    # Setup pypi object
    pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')

    # Setup the newline if the results layout should be vertical
    # Also add a space delimiter appropriately
    if args.layout == 'vertical':
        delimiter = ''
        endline = '\n'
    else:
        delimiter = ' '
        endline = ''

    # Print the results to stdout
    for pkg_name in args.packages:
        pkg_version = get_package_version(pypi, pkg_name)
        if args.format == 'requirements':
            print(pkg_name + '==' + pkg_version + delimiter, end=endline)
        else:
            print(pkg_version + delimiter, end=endline)
Computes the test statistic.
dataset/ETHPy150Open openstack/openstack-ansible/scripts/get-pypi-pkg-version.py/main--crossover with--dataset/ETHPy150Open AllenDowney/CompStats/hypothesis.py/DiceChiTest.TestStatistic