class_docstr: The ``{before,after}_epoch``, ``{before,after}_run``, ``trigger_{epoch,step}``
  methods of the given callback will be enabled only when ``global_step % every_k_steps == 0`
  or ``epoch_num % every_k_epochs == 0``. The other methods are unaffected.
  
  Note that this can only makes a callback **less** frequent than itself.
  If you have a callback that by default runs every epoch by its :meth:`trigger()` method,
  use :class:`PeriodicTrigger` to schedule it more frequent than itself.
code: def predicate(self):
      if (
          self._step_k is not None
          and self.global_step % self._step_k == 0
      ):
          return True
      if (
          self._epoch_k is not None
          and self.epoch_num % self._epoch_k == 0
      ):
          return True
      if self._epoch_k is not None:
          if (
              self.local_step == self.trainer.steps_per_epoch - 1
              and self.epoch_num == self.trainer.max_epoch
          ):
              return True
      return False
  
imports: from .base import Callback, ProxyCallback
label_desc: Use image node_id 2 for calling the PeriodicCallback obj's underlying member method code with example usage: obj.predicate() and returns: False, True, True, True