Did I find the right examples for you? yes no

All Samples(2946)  |  Call(2798)  |  Derive(0)  |  Import(148)
Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate.

        def getmembers(object, predicate=None):
    """Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate."""
    results = []
    for key in dir(object):
        try:
            value = getattr(object, key)
        except AttributeError:
            continue
        if not predicate or predicate(value):
            results.append((key, value))
    results.sort()
    return results
        


src/g/p/GPy-0.4.9/GPy/testing/examples_tests.py   GPy(Download)
        print "MODULE", module_examples
        print "Before"
        print inspect.getmembers(module_examples, predicate=inspect.isfunction)
        functions = [ func for func in inspect.getmembers(module_examples, predicate=inspect.isfunction) if func[0].startswith('_') is False ][::-1]
        print "After"

src/g/p/GPy-HEAD/GPy/testing/examples_tests.py   GPy(Download)
        print "MODULE", module_examples
        print "Before"
        print inspect.getmembers(module_examples, predicate=inspect.isfunction)
        functions = [ func for func in inspect.getmembers(module_examples, predicate=inspect.isfunction) if func[0].startswith('_') is False ][::-1]
        print "After"

src/c/i/circuits-3.0.0.dev/examples/web/wiki/macros/__init__.py   circuits(Download)
 
import os
from inspect import getmembers, getmodule, isfunction
 
from creoleparser import parse_args
 
        p = lambda x: isfunction(x) and getmodule(x) is m
        for name, function in getmembers(m, p):
            name = name.replace("_", "-")
            try:

src/r/e/reportlab-3.1.8/src/reportlab/graphics/samples/runall.py   reportlab(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=type):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/m/w/mwlib.ext-0.13.2/upstream-src/src/reportlab/graphics/samples/runall.py   mwlib.ext(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/d/i/digest-HEAD/lib/reportlab/graphics/samples/runall.py   digest(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/i/e/iellos-HEAD/lib/reportlab/graphics/samples/runall.py   iellos(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/r/e/ReportLab-HEAD/src/reportlab/graphics/samples/runall.py   ReportLab(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/d/j/django-admin-report-HEAD/example/lib/reportlab/graphics/samples/runall.py   django-admin-report(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

src/m/a/mangareader-to-ebook-HEAD/reportlab/graphics/samples/runall.py   mangareader-to-ebook(Download)
def moduleClasses(mod):
    def P(obj, m=mod.__name__, CT=types.ClassType):
        return (type(obj)==CT and obj.__module__==m)
    try:
        return inspect.getmembers(mod, P)[0][1]

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