@Predicate
def ExistingDirectory(val):
    """A switch-type validator that ensures that the given argument is an existing directory"""
    p = local.path(val)
    if not p.is_dir():
        raise ValueError("%r is not a directory" % (val,))
    return p
dataset/ETHPy150Open tomerfiliba/plumbum/plumbum/cli/switches.py/ExistingDirectory/original