def __setitem__(
        self, __name: Union[str, serial_utils.Lens], __value: Any
    ) -> None:
        """
        Allow setitem to work on Lenses instead of just strings. Uses `Lens.set`
        if a lens is given.
        """

        if isinstance(__name, str):
            return super().__setitem__(__name, __value)

        # Chop off __app__ or __record__ prefix if there.
        __name = select_schema.Select.dequalify(__name)

        # Chop off "app" prefix if there.
        if (
            isinstance(__name.path[0], serial_utils.GetItemOrAttribute)
            and __name.path[0].get_item_or_attribute() == "app"
        ):
            __name = serial_utils.Lens(path=__name.path[1:])

        # Does not mutate so need to use dict.update .
        temp = __name.set(self, __value)
        self.update(temp)

        Allow setitem to work on Lenses instead of just strings. Uses `Lens.set`
        if a lens is given.
        
src/core/trulens/apps/virtual.py