Did I find the right examples for you? yes no

All Samples(1341)  |  Call(1107)  |  Derive(31)  |  Import(203)
Mapping class that references values weakly.

Entries in the dictionary will be discarded when no strong
reference to the value exists anymore

src/h/u/hunch-sample-app-HEAD/django/dispatch/saferef.py   hunch-sample-app(Download)
    """
 
    _allInstances = weakref.WeakValueDictionary()
 
    def __new__( cls, target, onDelete=None, *arguments,**named ):

src/m/d/md-HEAD/docs/examples/stm_shelf.py   md(Download)
    def __init__(self, path, check_read=True, check_write=True):
	super(shelf, self).__init__(path, check_read, check_write)
	self.pcursors = weakref.WeakValueDictionary()
	self.store = None
	self.open()

src/b/a/baepython_sdk-HEAD/examples/weibotest/0/mako/template.py   baepython_sdk(Download)
 
     """
    _modules = weakref.WeakValueDictionary()
 
    def __init__(self, 

src/m/d/md.py-0.2/docs/examples/stm_shelf.py   md.py(Download)
    def __init__(self, path, check_read=True, check_write=True):
	super(shelf, self).__init__(path, check_read, check_write)
	self.pcursors = weakref.WeakValueDictionary()
	self.store = None
	self.open()

src/d/r/dropbox-2.0.0/example/datastore_app/tasks.py   dropbox(Download)
from collections import OrderedDict  # Requires Python 2.7.
from threading import Lock
from weakref import WeakValueDictionary
 
from flask import Flask, request, session, redirect, url_for, abort, render_template_string
 
# Locking per access token.
locks = WeakValueDictionary()
meta_lock = Lock()
 

src/p/y/pyuv-0.10.11/examples/echo-server-poll.py   pyuv(Download)
        self.poll_watcher = pyuv.Poll(self.loop, self.sock.fileno())
        self.async = pyuv.Async(self.loop, self.async_cb)
        self.conns = weakref.WeakValueDictionary()
        self.signal_watchers = set()
 

src/s/y/sylphis3d-HEAD/runtime/base/core/mthread.py   sylphis3d(Download)
 
channelLockStats    = {}
channels            = weakref.WeakValueDictionary({})
channelID           = 1
 
            return self.__dict__[k]
 
threads = weakref.WeakValueDictionary({})
taskID = 1
sleepers = []
 
semaphoreLockStats       = {}
semaphores               = weakref.WeakValueDictionary({})
semaphoreID              = 1
semaphoreLockCheck       = 1

src/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/lib/sqlalchemy/util/_collections.py   LuoYunCloud(Download)
    def __init__(self, elements):
        self._storage = weakref.WeakValueDictionary(
            (idx, element) for idx, element in enumerate(elements)
        )
 

src/m/a/matplotlib-1.3.1/lib/matplotlib/transforms.py   matplotlib(Download)
from numpy.linalg import inv
 
from weakref import WeakValueDictionary
import warnings
try:
        # parents are deleted, references from the children won't keep
        # them alive.
        self._parents = WeakValueDictionary()
 
        # TransformNodes start out as invalid until their values are
    def __setstate__(self, data_dict):
        self.__dict__ = data_dict
        # turn the normal dictionary back into a WeakValueDictionary
        self._parents = WeakValueDictionary(self._parents)
 

src/s/k/skink-HEAD/skink/lib/sqlalchemy/orm/identity.py   skink(Download)
        ref_count = len(self)
        dirty = [s.obj() for s in self.all_states() if s.check_modified()]
        keepers = weakref.WeakValueDictionary(self)
        dict.clear(self)
        dict.update(self, keepers)

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