class_docstr: Object that handles update schedule and configurations.
  
  Args:
      replay_buffer (ReplayBuffer): Replay buffer
      update_func (callable): Callable that accepts one of these:
          (1) a list of transition dicts (if episodic_update=False)
          (2) a list of lists of transition dicts (if episodic_update=True)
      replay_start_size (int): if the replay buffer's size is less than
          replay_start_size, skip update
      batchsize (int): Minibatch size
      update_interval (int): Model update interval in step
      n_times_update (int): Number of repetition of update
      episodic_update (bool): Use full episodes for update if set True
      episodic_update_len (int or None): Subsequences of this length are used
          for update if set int and episodic_update=True
code: def update_if_necessary(self, iteration):
      if len(self.replay_buffer) < self.replay_start_size:
          return
  
      if (
          self.episodic_update
          and self.replay_buffer.n_episodes < self.batchsize
      ):
          return
  
      if iteration % self.update_interval != 0:
          return
  
      for _ in range(self.n_times_update):
          if self.episodic_update:
              episodes = self.replay_buffer.sample_episodes(
                  self.batchsize, self.episodic_update_len
              )
              self.update_func(episodes)
          else:
              transitions = self.replay_buffer.sample(self.batchsize)
              self.update_func(transitions)
  
imports: from abc import ABCMeta
  from abc import abstractmethod
  from abc import abstractproperty
  import itertools
  import numpy
  from chainerrl.misc.batch_states import batch_states
label_desc: Use image node_id 2 for calling the ReplayUpdater obj's underlying member method code with example usage: obj.update_if_necessary(iteration) without return types