Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(0)  |  Derive(0)  |  Import(10)
Only apply fn if condition is true 

        def condition(cond, fn):
    """ Only apply fn if condition is true """
    def conditioned_fn(x):
        if cond(x):
            return fn(x)
        else:
            return x
    return conditioned_fn
        


src/s/y/sympy-HEAD/sympy/strategies/branch/tools.py   sympy(Download)
from __future__ import print_function, division
 
from .core import (exhaust, multiplex, debug, notempty, condition, chain,
        onaction, sfilter, yieldify, do_one, identity)
from .traverse import top_down

src/s/y/sympy-0.7.5/sympy/strategies/branch/tools.py   sympy(Download)
from __future__ import print_function, division
 
from .core import (exhaust, multiplex, debug, notempty, condition, chain,
        onaction, sfilter, yieldify, do_one, identity)
from .traverse import top_down

src/s/y/sympy-HEAD/sympy/strategies/branch/__init__.py   sympy(Download)
from . import traverse
from .core import (condition, debug, multiplex, exhaust, notempty,
        chain, onaction, sfilter, yieldify, do_one, identity)
from .tools import canon
 

src/s/y/sympy-0.7.5/sympy/strategies/branch/__init__.py   sympy(Download)
from . import traverse
from .core import (condition, debug, multiplex, exhaust, notempty,
        chain, onaction, sfilter, yieldify, do_one, identity)
from .tools import canon
 

src/s/t/strategies-0.1.2/strategies/branch/__init__.py   strategies(Download)
from core import (condition, debug, multiplex, exhaust, notempty,
        chain, onaction, sfilter, yieldify, do_one, identity)
 

src/s/y/sympy-HEAD/sympy/strategies/__init__.py   sympy(Download)
from .rl import rm_id, unpack, flatten, sort, glom, distribute, rebuild
from .util import new
from .core import (condition, debug, chain, null_safe, do_one, exhaust,
        minimize, tryit)
from .tools import canon, typed

src/s/y/sympy-0.7.5/sympy/strategies/__init__.py   sympy(Download)
from .rl import rm_id, unpack, flatten, sort, glom, distribute, rebuild
from .util import new
from .core import (condition, debug, chain, null_safe, do_one, exhaust,
        minimize, tryit)
from .tools import canon, typed

src/s/t/strategies-0.1.2/strategies/__init__.py   strategies(Download)
"""
 
from core import condition, debug, chain, do_one, exhaust, minimize
import branch