All Samples(90637) | Call(88276) | Derive(2345) | Import(16)
type(object) -> the object's type type(name, bases, dict) -> a new type
src/n/i/NiPy-OLD-HEAD/examples/neurospin/neurospy/Contrast.py NiPy-OLD(Download)
def __add__(self, con):
if type(con) == type(self):
res = Contrast()
for key in self.keys():
if con.has_key(key):
res[key] = array(self[key]) + array(con[key])
return res
def __sub__(self, con):
if type(con) == type(self):
def __mul__(self, con):
if type(con) == type(self):
res = Contrast()
for key in self.keys():
if con.has_key(key):
src/p/s/psycopg2-2.4.6/examples/encoding.py psycopg2(Download)
curs.execute("SELECT %s::TEXT AS foo", ('àèìòù',))
x = curs.fetchone()[0]
print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù'.encode('utf-8'),))
x = curs.fetchone()[0]
print " ->", x, type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
print " ->", x, type(x)
curs.execute("SELECT %s::TEXT AS foo", ('àèìòù',))
x = curs.fetchone()[0]
print " ->", x.encode('utf-8'), ":", type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
src/t/h/Theano-0.6.0rc3/theano/tensor/signal/downsample.py Theano(Download)
def __eq__(self, other):
return type(self) == type(other) and self.ds == other.ds and self.ignore_border == other.ignore_border
def __hash__(self):
return hash(type(self)) ^ hash(self.ds) ^ hash(self.ignore_border)
def __eq__(self, other):
return type(self) == type(other) and self.ds == other.ds and self.ignore_border == other.ignore_border
def __hash__(self):
return hash(type(self)) ^ hash(self.ds) ^ hash(self.ignore_border)
src/p/s/psycopg2da-2.0.9/examples/encoding.py psycopg2da(Download)
curs.execute("SELECT %s::TEXT AS foo", ('àèìòù',))
x = curs.fetchone()[0]
print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù'.encode('utf-8'),))
x = curs.fetchone()[0]
print " ->", x, type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
print " ->", x, type(x)
curs.execute("SELECT %s::TEXT AS foo", ('àèìòù',))
x = curs.fetchone()[0]
print " ->", x.encode('utf-8'), ":", type(x)
curs.execute("SELECT %s::TEXT AS foo", (u'àèìòù',))
x = curs.fetchone()[0]
src/s/h/shedskin-HEAD/examples/pylot/Color.py shedskin(Download)
def __init__(self, r, g, b):
#{
assert type(r) == float or type(r) == int
assert type(g) == float or type(g) == int
assert type(b) == float or type(b) == int
src/e/v/events-1.0/events_examples/events.py events(Download)
function()
else:
if type(d) == type([]):
function(*d)
elif type(d) == type({}):
function(**d)
else:
function(d)
else:
if type(data) == type([]):
src/p/y/PyOpenGL-3.0.2/OpenGL/platform/baseplatform.py PyOpenGL(Download)
else:
base = _NullFunctionPointer
cls = type( functionName, (base,), {
'__doc__': doc,
'deprecated': deprecated,
cls.__module__ = module
return cls(
functionName, dll, resultType, argTypes, argNames, extension=extension, doc=doc,
)
def GetCurrentContext( self ):
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/odb_sqlite.py clearsilver(Download)
def escape(self,str):
if str is None:
return None
elif type(str) == type(""):
return string.replace(str,"'","''")
elif type(str) == type(1):
return str
else:
raise "unknown column data type: %s" % type(str)
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/hdfhelp.py clearsilver(Download)
if (value is not None):
if col_options.get("no_export",0): continue
if type(value) in [ type(0), type(0L) ]:
hdf_dataset.setValue(prefix + "." + col_name,"%d" % value)
elif type(value) == type(1.0):
src/s/c/scipy-HEAD/scipy/weave/examples/functional.py scipy(Download)
def c_list_map(func,seq):
""" Uses CXX C code to implement a simple map-like function.
It does not provide any error checking.
"""
assert(type(func) in [FunctionType,MethodType,type(len)])
def c_list_map2(func,seq):
""" Uses Python API more than CXX to implement a simple map-like function.
It does not provide any error checking.
"""
assert(type(func) in [FunctionType,MethodType,type(len)])
Previous 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next