def _weak_decorator(func):
    def decorator(cls, *args, **kwargs):
        result = func(cls, *args, **kwargs)
        if isinstance(result, weakref.ref):
            return result()
        instanceID = result._instanceID
        if getattr(result, 'reapable', False):
            namespace['entities'].get(
                result.__class__.__name__, {}
            ).pop(instanceID, None)
        else:
            namespace['entities'][result.__class__.__name__].update(
                {instanceID: result}
            )
        cls._instanceMap[instanceID] = weakref.ref(
            result, #making sure we clean up the map dict
            lambda x: cls._weak_callback(instanceID,x)
        )
        return cls._instanceMap[result._instanceID]()
    return decorator
Create a new tag for a given guest
dataset/ETHPy150Open OrbitzWorldwide/droned/romeo/lib/romeo/entity.py/_weak_decorator--crossover with--dataset/ETHPy150Open locaweb/simplestack/src/simplestack/server.py/tag_create