def ValidateInteger(value, name='unused', exception=datastore_errors.BadValueError, empty_ok=False, zero_ok=False, negative_ok=False):
 if ((value is None) and empty_ok):
  return
 if (not isinstance(value, (int, long))):
  raise exception(('%s should be an integer; received %s (a %s).' % (name, value, typename(value))))
 if ((not value) and (not zero_ok)):
  raise exception(('%s must not be 0 (zero)' % name))
 if ((value < 0) and (not negative_ok)):
  raise exception(('%s must not be negative.' % name))

def ValidateInteger ( value , name = 'unused' , exception = datastore_errors . BadValueError , empty_ok = False , zero_ok = False , negative_ok = False ) : if ( ( value is None ) and empty_ok ) : return if ( not isinstance ( value , ( int , long ) ) ) : raise exception ( ( '%s should be an integer; received %s (a %s).' % ( name , value , typename ( value ) ) ) ) if ( ( not value ) and ( not zero_ok ) ) : raise exception ( ( '%s must not be 0 (zero)' % name ) ) if ( ( value < 0 ) and ( not negative_ok ) ) : raise exception ( ( '%s must not be negative.' % name ) )
raises an exception if value is not a valid integer .