def _as_attributes(self, *fields: str, use_in_train=False, use_in_eval=False):
        """
        Internal method used to transform plain object fields to
        ExperienceAttribute(s).

        This is needed to ensure that static type checkers will not consider
        those fields as being of type "ExperienceAttribute", as this may be
        detrimental on the user experience.
        """
        for field in fields:
            v = super().__getattribute__(field)
            if isinstance(v, ExperienceAttribute):
                if v.use_in_train != use_in_train:
                    raise RuntimeError(
                        f"Experience attribute {field} redefined with "
                        f"incongruent use_in_train field. Was "
                        f"{v.use_in_train}, overridden with {use_in_train}."
                    )

                if v.use_in_eval != use_in_eval:
                    raise RuntimeError(
                        f"Experience attribute {field} redefined with "
                        f"incongruent use_in_eval field. Was "
                        f"{v.use_in_eval}, overridden with {use_in_train}."
                    )
            else:
                setattr(
                    self,
                    field,
                    ExperienceAttribute(
                        value=v, use_in_train=use_in_train, use_in_eval=use_in_eval
                    ),
                )

        Internal method used to transform plain object fields to
        ExperienceAttribute(s).

        This is needed to ensure that static type checkers will not consider
        those fields as being of type "ExperienceAttribute", as this may be
        detrimental on the user experience.
        
avalanche/benchmarks/scenarios/generic_scenario.py