class_docstr: Base Experience.
  
  Experiences have an index which track the experience's position
  inside the stream for evaluation purposes.
class_docstr_tok: ["Base","Experience",".","Experiences","have","an","index","which","track","the","experience","'s","position","inside","the","stream","for","evaluation","purposes","."]
docstr: 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.
docstr_tok: ["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","."]
code: 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,
                  ),
              )
  
imports: from abc import abstractmethod, ABC
  from contextlib import contextmanager
  from copy import copy
  from enum import Enum
  from types import GeneratorType
  from typing import Any, Dict, Generator, Iterator, List, Iterable, Optional, Sequence, Tuple, TypeVar, Union, Generic, overload
  from typing_extensions import final
  import numpy
  from avalanche.benchmarks.utils.dataset_utils import slice_alike_object_to_indices
label_desc: Use image node_id 10 for calling the CLExperience obj's underlying member method code with example usage: obj._as_attributes() without return types