argv.py
def _isValid(argname, arg, validArgs=None, condition=None):
    """ Checks that 'arg' is in validArgs and satisfies the given condition. """
    if validArgs is not None:
        if arg not in validArgs:
            print("Invalid value for '%s': '%s' is not in the set %s."%(argname, arg, validArgs))
            return False
    if condition is not None:
        validator = eval("lambda v: %s"%(condition))  # pylint: disable=eval-used
        if validator(arg) is not True:
            print("Invalid value for '%s': '%s' does not satisfy '%s'."%(argname, arg, condition))
            return False
    return True
 Checks that 'arg' is in validArgs and satisfies the given condition. 
Checks that 'arg' is in validArgs and satisfies the given condition.
Checks that ' arg ' is in validArgs and satisfies the given condition .
def _isValid(argname, arg, validArgs=None, condition=None):
    if validArgs is not None:
        if arg not in validArgs:
            print("Invalid value for '%s': '%s' is not in the set %s."%(argname, arg, validArgs))
            return False
    if condition is not None:
        validator = eval("lambda v: %s"%(condition))  
        if validator(arg) is not True:
            print("Invalid value for '%s': '%s' does not satisfy '%s'."%(argname, arg, condition))
            return False
    return True
def _isValid ( argname , arg , validArgs = None , condition = None ) : if validArgs is not None : if arg not in validArgs : print ( "Invalid value for '%s': '%s' is not in the set %s." % ( argname , arg , validArgs ) ) return False if condition is not None : validator = eval ( "lambda v: %s" % ( condition ) ) if validator ( arg ) is not True : print ( "Invalid value for '%s': '%s' does not satisfy '%s'." % ( argname , arg , condition ) ) return False return True
Checks that 'arg' is in validArgs and satisfies the given condition.
Checks that ' arg ' is in validArgs and satisfies the given condition .
""" Checks that 'arg' is in validArgs and satisfies the given condition. """ # pylint: disable=eval-used
argname
arg
validArgs
condition