Did I find the right examples for you? yes no

All Samples(598)  |  Call(559)  |  Derive(0)  |  Import(39)
Return the text of the source code for an object.

The argument may be a module, class, method, function, traceback, frame,
or code object.  The source code is returned as a single string.  An
IOError is raised if the source code cannot be retrieved.

        def getsource(object):
    """Return the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    IOError is raised if the source code cannot be retrieved."""
    lines, lnum = getsourcelines(object)
    return string.join(lines, '')
        


src/m/u/Muntjac-1.1.2/muntjac/demo/sampler/Feature.py   Muntjac(Download)
    def getSource(self):
        if self._pythonSource is None:
            try:
                ex = self.getExample()
                self._pythonSource = inspect.getsource(inspect.getmodule(ex))

src/m/u/muntjac-HEAD/muntjac/demo/sampler/Feature.py   muntjac(Download)
    def getSource(self):
        if self._pythonSource is None:
            try:
                ex = self.getExample()
                self._pythonSource = inspect.getsource(inspect.getmodule(ex))

src/p/y/pyjaco-HEAD/examples/ui.py   pyjaco(Download)
    source = ""
    for f in funcs:
        source += inspect.getsource(f) + "\n"
    js = pyjaco.compile_string(source)
 

src/j/i/jinja24doc-1.1.0/jinja24doc.py   jinja24doc(Download)
from jinja2 import Environment, FileSystemLoader, Undefined
from traceback import format_exception
from inspect import getargspec, getdoc, getmembers, getsource, formatargspec, \
        isfunction, ismethod, isclass, ismodule, \
        ismethoddescriptor, isgetsetdescriptor
 
    try:
        source = getsource(module)
    except:
        source = ''

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/IPython/core/oinspect.py   antisocial(Download)
            obj = obj.__wrapped__
        try:
            src = inspect.getsource(obj)
        except TypeError:
            if hasattr(obj,'__class__'):
                src = inspect.getsource(obj.__class__)

src/p/d/pdoc-0.2.1/pdoc/__init__.py   pdoc(Download)
        vardocs = {}
        try:
            tree = ast.parse(inspect.getsource(self.module))
            vardocs = _var_docstrings(tree, self, cls=None)
        except:

src/p/d/pdoc-HEAD/pdoc/__init__.py   pdoc(Download)
        vardocs = {}
        try:
            tree = ast.parse(inspect.getsource(self.module))
            vardocs = _var_docstrings(tree, self, cls=None)
        except:

src/k/u/kuma-lib-HEAD/packages/ipython/IPython/OInspect.py   kuma-lib(Download)
    else:
        try:
            src = inspect.getsource(obj)
        except TypeError:
            if hasattr(obj,'__class__'):
                src = inspect.getsource(obj.__class__)

src/a/l/alto-0.4/alto/urlviz.py   alto(Download)
        'file': inspect.getsourcefile(view),
        'name': view.__name__,
        'source': inspect.getsource(view),
        'sourcelines': source_lines,
        'line_number': line_number,
    # Parse the source code of the function with ast to find the names of
    # all of its decorators.
    tree = ast.parse(inspect.getsource(func))
    for node in ast.iter_child_nodes(tree):
        for dnode in node.decorator_list:
        'name': decorator.__name__,
        'doc': inspect.getdoc(decorator),
        'source': inspect.getsource(decorator),
        'args': inspect_args(decorator),
    }

src/i/p/ipython-2.0.0/IPython/core/oinspect.py   ipython(Download)
            obj = obj.__wrapped__
        try:
            src = inspect.getsource(obj)
        except TypeError:
            if hasattr(obj,'__class__'):
                src = inspect.getsource(obj.__class__)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next