All Samples(107) | Call(3) | Derive(4) | Import(100)
float(x) -> floating point number Convert a string or number to a floating point number, if possible.
src/a/l/alexandria-HEAD/src/alexandria/sessions/db/models.py alexandria(Download)
DESERIALIZERS = [
('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)),
src/p/y/PyXB-base-1.1.0/pyxb/binding/datatypes.py PyXB(Download)
class decimal (basis.simpleTypeDefinition, types.FloatType):
"""decimal.
U{http://www.w3.org/TR/xmlschema-2/#decimal}
@todo: The Python base type for this is wrong. Consider
U{http://code.google.com/p/mpmath/}.
class float (basis.simpleTypeDefinition, types.FloatType):
"""float.
U{http://www.w3.org/TR/xmlschema-2/#float}"""
_XsdBaseType = anySimpleType
_ExpandedName = pyxb.namespace.XMLSchema.createExpandedName('float')
@classmethod
def XsdLiteral (cls, value):
return '%s' % (value,)
_PrimitiveDatatypes.append(float)
class double (basis.simpleTypeDefinition, types.FloatType):
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
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'],)))
else:
# Discard any bogosity passed in by the caller
kw.pop('microsecond', None)
src/z/o/zope.app.twisted-3.5.0/src/twisted/spread/jelly.py zope.app.twisted(Download)
from types import TupleType from types import ListType from types import LongType from types import FloatType from types import FunctionType from types import MethodType from types import ModuleType
src/z/e/zenoss-HEAD/trunk/Products/PluggableAuthService/UserPropertySheet.py zenoss(Download)
$Id: UserPropertySheet.py 70450 2006-09-30 19:01:58Z rafrombrc $ """ from types import IntType from types import FloatType from types import LongType from types import TupleType from types import ListType
src/b/a/bases-HEAD/trunk/bases/thirdparty/jecode.py bases(Download)
return r
from types import NoneType, IntType, LongType, FloatType, DictType, ListType
from types import TupleType, StringType, UnicodeType, BooleanType
# Encode integers
src/z/e/zenoss-HEAD/Products/PluggableAuthService/UserPropertySheet.py zenoss(Download)
$Id: UserPropertySheet.py 70450 2006-09-30 19:01:58Z rafrombrc $ """ from types import IntType from types import FloatType from types import LongType from types import TupleType from types import ListType
src/b/a/bases-HEAD/bases/thirdparty/jecode.py bases(Download)
return r
from types import NoneType, IntType, LongType, FloatType, DictType, ListType
from types import TupleType, StringType, UnicodeType, BooleanType
# Encode integers
src/g/h/gherkin-3/gherkin.py gherkin(Download)
""" from types import IntType, TupleType, StringType, FloatType, LongType, ListType, DictType, NoneType, BooleanType, UnicodeType, ComplexType SetType = type(set()) from struct import pack, unpack from cStringIO import StringIO
src/b/a/bases-HEAD/trunk/bases/thirdparty/rencode.py bases(Download)
raise ValueError
return r
from types import StringType, IntType, LongType, DictType, ListType, TupleType, FloatType, NoneType
def encode_int(x, r):
if 0 <= x < INT_POS_FIXED_COUNT:
src/t/y/typedbytes-HEAD/typedbytes.py typedbytes(Download)
def pack(self, *args):
return pack(self.fmt, *args)
from types import BooleanType, IntType, LongType, FloatType
from types import UnicodeType, StringType, TupleType, ListType, DictType
from datetime import datetime, date
from decimal import Decimal
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next