code: def update(self, new_pos):
      pos = self.pos
      end_non_missing = self.end - self.n_missing
      sample_indices = self.sample_indices
      sample_weight = self.sample_weight
      w = 1.0
  
      if (new_pos - pos) <= (end_non_missing - new_pos):
          for p in range(pos, new_pos):
              i = sample_indices[p]
              if sample_weight is not None:
                  w = sample_weight[i]
              for k in range(self.n_outputs):
                  c = int(self.y[i, k])
                  self.sum_left[k, c] += w
              self.weighted_n_left += w
  
      else:
          self.reverse_reset()
          for p in range(end_non_missing - 1, new_pos - 1, -1):
              i = sample_indices[p]
              if sample_weight is not None:
                  w = sample_weight[i]
              for k in range(self.n_outputs):
                  c = int(self.y[i, k])
                  self.sum_left[k, c] -= w
              self.weighted_n_left -= w
      self.weighted_n_right = (
          self.weighted_n_node_samples - self.weighted_n_left
      )
      for k in range(self.n_outputs):
          for c in range(ivy.to_scalar(self.n_classes[k])):
              self.sum_right[k, c] = (
                  self.sum_total[k, c] - self.sum_left[k, c]
              )
      self.pos = new_pos
      return 0
  
imports: from abc import ABC, abstractmethod
  import ivy
label_desc: Use image node_id 8 for calling the ClassificationCriterion obj's underlying member method code with example usage: obj.update(new_pos) and returns: int