code: def termlogs(
      self, step=0, global_loss=None, global_acc=None, step_time=None
  ):
      termlogs = "Training Step: " + str(step) + " "
      if global_loss:
          termlogs += (
              " | total loss: \033[1m\033[32m"
              + "%.5f" % global_loss
              + "\033[0m\033[0m"
          )
      if global_acc and not self.display_type == "single":
          termlogs += " - avg acc: %.4f" % float(global_acc)
      if step_time:
          termlogs += " | time: %.3fs" % step_time
      termlogs += "\n"
      for i, data in enumerate(self.data):
          print_loss = ""
          print_acc = ""
          print_val_loss = ""
          print_val_acc = ""
          if data["loss"] is not None:
              print_loss = " | loss: " + "%.5f" % data["loss"]
          if data["acc"] is not None:
              print_acc = (
                  " - "
                  + data["metric_name"]
                  + ": "
                  + "%.4f" % data["acc"]
              )
          if data["val_loss"] is not None:
              print_val_loss = (
                  " | val_loss: " + "%.5f" % data["val_loss"]
              )
          if data["val_acc"] is not None:
              print_val_acc = (
                  " - val_"
                  + data["metric_name"]
                  + ": "
                  + "%.4f" % data["val_acc"]
              )
          # fix diplay, if step reached the whole epoch, display epoch - 1, as epoch has been updated
          print_epoch = data["epoch"]
          # Smoothing display, so we show display at step + 1 to show data_size/data_size at end
          print_step = (
              " -- iter: "
              + ("%0" + str(len(str(data["data_size"]))) + "d")
              % data["step"]
              + "/"
              + str(data["data_size"])
          )
          if data["step"] == 0:
              print_epoch = data["epoch"]
              # print_step = ""
              print_step = (
                  " -- iter: "
                  + ("%0" + str(len(str(data["data_size"]))) + "d") % 0
                  + "/"
                  + str(data["data_size"])
              )
          termlogs += (
              "\x1b[2K\r| "
              + data["name"]
              + " | epoch: "
              + "%03d" % print_epoch
              + print_loss
              + print_acc
              + print_val_loss
              + print_val_acc
              + print_step
              + "\n"
          )
  
      return termlogs
  
imports: from __future__ import division, print_function, absolute_import
  import time
  import sys
label_desc: Use image node_id 11 for calling the TermLogger obj's underlying member method code with example usage: obj.termlogs(step, global_loss, global_acc, step_time) and returns: termlogs