All Samples(544) | Call(9) | Derive(3) | Import(532)
int(x[, base]) -> integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.
src/a/l/alexandria-HEAD/src/alexandria/sessions/db/models.py alexandria(Download)
('Boolean', lambda v: v == 'True'),
('Dict', lambda v: simplejson.loads(v)),
('Float', lambda v: types.FloatType(v)),
('Int', lambda v: types.IntType(v)),
('List', lambda v: simplejson.loads(v)),
('Long', lambda v: types.LongType(v)),
('None', lambda v: None),
src/p/y/PyXB-base-1.1.0/pyxb/binding/datatypes.py PyXB(Download)
class boolean (basis.simpleTypeDefinition, types.IntType):
"""boolean.
U{http://www.w3.org/TR/xmlschema-2/#boolean}"""
_XsdBaseType = anySimpleType
_ExpandedName = pyxb.namespace.XMLSchema.createExpandedName('boolean')
fractional_seconds = 0.0
if match_map.get('fracsec', None) is not None:
fractional_seconds = types.FloatType('0%s' % (match_map['fracsec'],))
usec = types.IntType(1000000 * fractional_seconds)
if negative_duration:
kw['microseconds'] = - usec
else:
v = match_map.get(fn, 0)
if v is None:
v = 0
data[fn] = types.IntType(v)
if fn in cls.__PythonFields:
if negative_duration:
kw[fn] = - data[fn]
rem_time = data['seconds']
use_seconds = rem_time
if (0 != (rem_time % 1)):
data['microseconds'] = types.IntType(1000000 * (rem_time % 1))
rem_time = rem_time // 1
if 60 <= rem_time:
data['seconds'] = rem_time % 60
kw = { }
for (k, v) in match_map.iteritems():
if (k in cls.__Fields) and (v is not None):
kw[k] = types.IntType(v)
if '-' == match_map.get('negYear', None):
kw['year'] = - kw['year']
if match_map.get('fracsec', None) is not None:
kw['microsecond'] = types.IntType(1000000 * types.FloatType('0%s' % (match_map['fracsec'],)))
class int (basis.simpleTypeDefinition, types.IntType):
_XsdBaseType = long
_ExpandedName = pyxb.namespace.XMLSchema.createExpandedName('int')
@classmethod
def XsdLiteral (cls, value):
return '%s' % (value,)
src/s/p/springnote.py-with-oauth-HEAD/springnote.py springnote.py-with-oauth(Download)
check_parameters = {
'sort' : lambda x: x in ['identifier', 'title', 'relation_is_par_of', 'date_modified', 'date_created'],
'order' : lambda x: x in ['desc', 'asc'],
'offset' : lambda x: types.IntType(x),
'count' : lambda x: types.IntType(x),
'parent_id': lambda x: types.IntType(x),
'q' : lambda x: types.UnicodeType(x),