All Samples(113125) | Call(111014) | Derive(2085) | Import(26)
type(object) -> the object's type type(name, bases, dict) -> a new type
src/u/n/unixpiger-HEAD/monitor/api/python/Demo/parser/example.py unixpiger(Download)
"""
if vars is None:
vars = {}
if type(pattern) is ListType: # 'variables' are ['varname']
vars[pattern[0]] = data
return 1, vars
if type(pattern) is not TupleType:
src/e/v/events-1.0/events_examples/events.py events(Download)
def called(self, data=None):
for function, d in self.listeners.items():
if data is None:
if d is None:
function()
else:
if type(d) == type([]):
function(*d)
elif type(d) == type({}):
function(**d)
else:
function(d)
else:
if type(data) == type([]):
else:
if type(data) == type([]):
function(*data)
elif type(data) == type({}):
function(**data)
else:
function(data)
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):
if int(value) == value:
src/g/d/gdata-python-client-HEAD/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py gdata-python-client(Download)
def _validate_timeout(self, timeout):
if timeout == None:
timeout = datetime.datetime.now() +\
datetime.timedelta(seconds=DEFAULT_TIMEOUT)
if type(timeout) == type(1):
timeout = datetime.datetime.now() + \
datetime.timedelta(seconds = timeout)
if type(timeout) != datetime.datetime:
src/i/r/ironruby-HEAD/Languages/IronPython/Samples/Direct3D/tutorial.py ironruby(Download)
def Vectorize(v):
if type(v)==list:
v = DirectX.Vector3(v[0], v[1], v[2])
return v
src/i/r/ironruby-HEAD/Languages/IronPython/Samples/Direct3D/GravityDemo.py ironruby(Download)
def OnFrame(self, elapsed):
l = None
pos = DirectX.Vector3(0, 0, 0)
if type(self.Others)==list:
l = len(self.Others)
src/p/y/PyOpenGL-3.0.1/OpenGL/platform/baseplatform.py PyOpenGL(Download)
base = _DeprecatedFunctionPointer
else:
base = _NullFunctionPointer
cls = type( functionName, (base,), {
'__doc__': doc,
'deprecated': deprecated,
} )
return cls(
functionName, dll, resultType, argTypes, argNames, extension=extension, doc=doc,
src/x/b/xbmc-HEAD/xbmc/lib/libPython/Python/Demo/parser/example.py xbmc(Download)
"""
if vars is None:
vars = {}
if type(pattern) is ListType: # 'variables' are ['varname']
vars[pattern[0]] = data
return 1, vars
if type(pattern) is not TupleType:
src/p/y/python-cookbook-HEAD/cb2_examples/cb2_20_15_sol_3.py python-cookbook(Download)
except TypeError:
return
for k, v in d.items():
if type(v) is types.FunctionType:
newv = _make_constants(v, builtin_only, stoplist, verbose)
setattr(mc, k, newv)
elif type(v) in (type, types.ClassType):
bind_all(v, builtin_only, stoplist, verbose)
@_make_constants
def make_constants(builtin_only=False, stoplist=[], verbose=False):
""" Call this metadecorator to obtain a decorator which optimizes
global references by constant binding on a specific function.
"""
if type(builtin_only) == type(types.FunctionType):
Previous 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 Next