def strict_positive_int(integer_string, cutoff=None):
 ret = int(integer_string)
 if (ret <= 0):
  raise ValueError()
 if cutoff:
  ret = min(ret, cutoff)
 return ret

def strict_positive_int ( integer_string , cutoff = None ) : ret = int ( integer_string ) if ( ret <= 0 ) : raise ValueError ( ) if cutoff : ret = min ( ret , cutoff ) return ret
cast a string to a strictly positive integer .