Did I find the right examples for you? yes no

All Samples(12)  |  Call(0)  |  Derive(0)  |  Import(12)

        def memoize(iden, time=0, make_key=make_key):
    try:
        from pylons import tmpl_context as c
        iden = c.instance.key + '.' + iden if c.instance else iden
    except:
        pass

    def memoize_fn(fn):
        from adhocracy.lib.cache.util import NoneResult

        def new_fn(*a, **kw):
            try:
                cache = app_globals.cache
            except TypeError:
                # Probably in tests
                cache = None
            if not cache:
                res = fn(*a, **kw)
            else:
                key = make_key(iden, a, kw)
                res = cache.get(key)
                if res is None:
                    res = fn(*a, **kw)
                    # print "Cache miss", key + iden
                    if res is None:
                        res = NoneResult
                    # print "Cache set:", key + iden
                    cache.set(key, res, time=time)
                    tag_fn(key, a, kw)
                # else:
                #     print "Cache hit", key + iden
                if res is NoneResult:
                    res = None
            return res
        return new_fn
    return memoize_fn
        


src/d/i/digsby-HEAD/digsby/src/plugins/nowplaying/nowplaying.py   digsby(Download)
from common import profile, pref
 
from util import import_module, RepeatTimer, memoize, Storage as S, odict, iproperty
from util.lrucache import LRU
from util.threads import threaded

src/j/a/JapaneseStudy-HEAD/anki/plugins/morphman3/morph/main.py   JapaneseStudy(Download)
import time
 
from anki.utils import splitFields, joinFields, stripHTML, intTime, fieldChecksum
from morphemes import MorphDb, AnkiDeck, getMorphemes
from util import printf, mw, memoize, cfg, cfg1, partial, errorMsg, infoMsg

src/d/i/digsby-HEAD/digsby/src/gui/uberwidgets/umenu.py   digsby(Download)
import config
 
from util import traceguard, memoize, Storage as S, InstanceTracker
from util.primitives.funcs import Delegate
 

src/d/i/digsby-HEAD/digsby/src/gui/imwin/styles/msgstyles.py   digsby(Download)
from common import pref
from path import path
from util import traceguard, memoize
from traceback import print_exc
from logging import getLogger; log = getLogger('msgstyles')

src/d/i/digsby-HEAD/digsby/src/gui/native/win/winutil.py   digsby(Download)
from ctypes.wintypes import UINT, HWND, DWORD
from util.ffi import Struct
from util import memoize
 
def _win_id_gen():

src/t/w/tw2.core-2.2.1.1/tw2/core/templating.py   tw2.core(Download)
import os
from . import core
 
from .util import memoize, relpath
 

src/t/w/tw2.core-HEAD/tw2/core/templating.py   tw2.core(Download)
import os
from . import core
 
from .util import memoize, relpath
 

src/d/j/django-resourcetags-1.1/django_resourcetags/handlers.py   django-resourcetags(Download)
 
from django.conf import settings
from .util import load_module_attr, memoize
 
__all__ = ['get_handler']

src/a/d/adhocracy-2.4.1/parts/omelette/adhocracy/lib/cache/__init__.py   adhocracy(Download)
import logging
 
import adhocracy.model as model
 
from util import memoize

src/a/d/adhocracy-2.4.1/src/adhocracy/lib/cache/__init__.py   adhocracy(Download)
import logging
 
import adhocracy.model as model
 
from util import memoize

  1 | 2  Next