

@contextlib.contextmanager
def resource_context(self):
    resource = self._free_resources.get()
    if (resource is _NotAResource):
        resource = resource._factory()
    try:
        (yield resource)
    finally:
        self._free_resources.put(resource)

dataset/ETHPy150Open bloomberg/phabricator-tools/py/phl/phlsys_multiprocessing.py MultiResource.resource_context/VarMisuse@36/44 `self`->`resource`