def per_instance(*args, **kwargs):
  # For methods, the cache should be per-instance, so we take the id of the self/cls argument
  # instead of relying on `==` since different instances may evaluate as `==`.  Additionally, we
  # pair the id with the instance to ensure the instance is not GC'd since `id` allows for re-use
  # of ids under GC.
  instance = args[0]
  unique_retained_instance = (id(instance), instance)

  instance_and_rest = (unique_retained_instance,) + args[1:]
  return equal_args(*instance_and_rest, **kwargs)
Ban an entity in a room.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/util/memo.py/per_instance--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_muc.py/MUCClientProtocolTest.test_ban