code: def update(self, train_op, train_ops_count=1):
      data_status = train_op.train_dflow.data_status
  
      self.acc_value = train_op.acc_value
      self.loss_value = train_op.loss_value
      self.val_acc = train_op.val_acc
      self.val_loss = train_op.val_loss
      self.current_iter = data_status.current_iter
  
      # Update best validation accuracy
      if self.val_acc is not None and self.val_acc > self.best_accuracy:
          self.best_accuracy = self.val_acc
  
      # Update global values
      self.global_loss += self.loss_value
  
      if self.acc_value and self.global_acc:
          self.global_acc += self.acc_value / train_ops_count
      else:
          self.global_acc = None
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import os
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.training import optimizer
  import tflearn
  from ..None import callbacks
  from ..config import init_training_mode
  from ..utils import to_list, id_generator, check_dir_name, standarize_dict, get_dict_first_element, make_batches, slice_array, check_scope_path, check_restore_tensor
  from ..None import data_flow
  from ..None import variables
  from ..None import utils
  from .summarizer import summaries, summarize, summarize_gradients, summarize_variables, summarize_activations
label_desc: Use image node_id 2 for calling the TrainingState obj's underlying member method code with example usage: obj.update(train_op, train_ops_count) without return types