Update examples to use argparse instead of optparse

optparse was deprecated since 2.7 and removed in python 3