async def corofunc(**local_args):
            nonlocal called
            assert local_args == args
            called += 1
def lock_temp(self, key):
    self.lock(key)
    try:
      yield
    finally:
      self.unlock(key)