def METHOD_NAME(opts):
    topo = None
    shape = None
    for o,a in opts:
        if o in('--topo'):
            topo = a
        elif o in('--shape'):
            shape = a
    if None == topo:
        sys.exit('FATAL: must specify --topo=[torus|fattree|dragonfly|dragonfly2]')
    if None == shape:
        sys.exit('FATAL: must specify --shape')
    return topo, shape