def _RegisterBoundsValidatorIfNeeded(parser, name, flag_values):
 if ((parser.lower_bound is not None) or (parser.upper_bound is not None)):
  def Checker(value):
   if ((value is not None) and parser.IsOutsideBounds(value)):
    message = ('%s is not %s' % (value, parser.syntactic_help))
    raise gflags_validators.Error(message)
   return True
  RegisterValidator(name, Checker, flag_values=flag_values)

def _RegisterBoundsValidatorIfNeeded ( parser , name , flag_values ) : if ( ( parser . lower_bound is not None ) or ( parser . upper_bound is not None ) ) : def Checker ( value ) : if ( ( value is not None ) and parser . IsOutsideBounds ( value ) ) : message = ( '%s is not %s' % ( value , parser . syntactic_help ) ) raise gflags_validators . Error ( message ) return True RegisterValidator ( name , Checker , flag_values = flag_values )
enforce lower and upper bounds for numeric flags .