src/transformers/trainer_utils.py
def derive_stage(self):
        """ derives the stage/caller name automatically """
        caller = inspect.currentframe().f_back.f_back.f_code.co_name
        if caller in self.stages:
            return self.stages[caller]
        else:
            raise ValueError(
                f"was called from {caller}, but only expect to be called from one of {self.stages.keys()}"
            )
 derives the stage/caller name automatically 
derives the stage/caller name automatically
derives the stage / caller name automatically
def derive_stage(self):
        caller = inspect.currentframe().f_back.f_back.f_code.co_name
        if caller in self.stages:
            return self.stages[caller]
        else:
            raise ValueError(
                f"was called from {caller}, but only expect to be called from one of {self.stages.keys()}"
            )
def derive_stage ( self ) : caller = inspect . currentframe ( ) . f_back . f_back . f_code . co_name if caller in self . stages : return self . stages [ caller ] else : raise ValueError ( f"was called from {caller}, but only expect to be called from one of {self.stages.keys()}" )
derives the stage/caller name automatically
derives the stage / caller name automatically
""" derives the stage/caller name automatically """
self