All Samples(1198) | Call(1092) | Derive(0) | Import(106)
Return true if the object is a user-defined function.
Function objects provide these attributes:
__doc__ documentation string
__name__ name with which this function was defined
func_code code object containing compiled function bytecode
func_defaults tuple of any default values for arguments
func_doc (same as __doc__)
func_globals global namespace in which this function was defined
func_name (same as __name__)
def isfunction(object):
"""Return true if the object is a user-defined function.
Function objects provide these attributes:
__doc__ documentation string
__name__ name with which this function was defined
func_code code object containing compiled function bytecode
func_defaults tuple of any default values for arguments
func_doc (same as __doc__)
func_globals global namespace in which this function was defined
func_name (same as __name__)"""
return isinstance(object, types.FunctionType)
import types
# For purposes of monkeypatching inspect to fix a bug in it.
from inspect import getsourcefile, getfile, getmodule,\
ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode
# IPython's own modules
if ismethod(object):
object = object.__func__
if isfunction(object):
object = object.__code__
if istraceback(object):
object = object.tb_frame
src/z/a/zamboni-lib-HEAD/lib/python/logilab/astng/builder.py zamboni-lib(Download)
import sys
from os.path import splitext, basename, dirname, exists, abspath
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
isbuiltin
from inspect import isdatadescriptor
continue
if ismethod(member):
member = member.im_func
if isfunction(member):
# verify this is not an imported function
if member.func_code.co_filename != getattr(self._module, '__file__', None):
attach_dummy_node(node, name, member)
src/t/o/topographica-HEAD/releases/0.9.7/topographica/topo/misc/asizeof.py topographica(Download)
from __future__ import generators #PYCHOK for yield in Python 2.2
from inspect import isbuiltin, isclass, iscode, isframe, \
isfunction, ismethod, ismodule, stack
from math import log
from os import linesep
elif isbuiltin(obj): # function or method
v.set(both=False, # code only
kind=_kind_ignored)
elif isfunction(obj):
v.set(refs=_func_refs,
both=False) # code only
elif ismethod(obj):
src/t/o/topographica-HEAD/topographica/topo/misc/asizeof.py topographica(Download)
from __future__ import generators #PYCHOK for yield in Python 2.2
from inspect import isbuiltin, isclass, iscode, isframe, \
isfunction, ismethod, ismodule, stack
from math import log
from os import linesep
elif isbuiltin(obj): # function or method
v.set(both=False, # code only
kind=_kind_ignored)
elif isfunction(obj):
v.set(refs=_func_refs,
both=False) # code only
elif ismethod(obj):
src/t/o/topographica-0.9.7/topo/misc/asizeof.py topographica(Download)
from __future__ import generators #PYCHOK for yield in Python 2.2
from inspect import isbuiltin, isclass, iscode, isframe, \
isfunction, ismethod, ismodule, stack
from math import log
from os import linesep
elif isbuiltin(obj): # function or method
v.set(both=False, # code only
kind=_kind_ignored)
elif isfunction(obj):
v.set(refs=_func_refs,
both=False) # code only
elif ismethod(obj):
src/p/y/Pympler-0.1/pympler/asizeof/asizeof.py Pympler(Download)
from __future__ import generators #PYCHOK for yield in Python 2.2
from inspect import isbuiltin, isclass, iscode, isframe, \
isfunction, ismethod, ismodule, stack
from math import log
from os import linesep
elif isbuiltin(obj): # function or method
v.set(both=False, # code only
kind=_kind_ignored)
elif isfunction(obj):
v.set(refs=_func_refs,
both=False) # code only
elif ismethod(obj):
src/c/l/clonedigger-HEAD/trunk/clonedigger/logilab/astng/builder.py clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
isbuiltin
from inspect import isdatadescriptor
continue
if ismethod(member):
member = member.im_func
if isfunction(member):
# verify this is not an imported function
if member.func_code.co_filename != modfile:
attach_dummy_node(node, name, member)
src/c/l/clonedigger-HEAD/pretty_printing/clonedigger/logilab/astng/builder.py clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
isbuiltin
from inspect import isdatadescriptor
continue
if ismethod(member):
member = member.im_func
if isfunction(member):
# verify this is not an imported function
if member.func_code.co_filename != modfile:
attach_dummy_node(node, name, member)
src/c/l/clonedigger-HEAD/for_evalution/clonedigger/logilab/astng/builder.py clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
isbuiltin
from inspect import isdatadescriptor
continue
if ismethod(member):
member = member.im_func
if isfunction(member):
# verify this is not an imported function
if member.func_code.co_filename != modfile:
attach_dummy_node(node, name, member)
src/c/l/clonedigger-HEAD/clonedigger/logilab/astng/builder.py clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
isbuiltin
from inspect import isdatadescriptor
continue
if ismethod(member):
member = member.im_func
if isfunction(member):
# verify this is not an imported function
if member.func_code.co_filename != modfile:
attach_dummy_node(node, name, member)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next