code: def steps_to_run(current_step, steps_per_epoch, steps_per_loop):
      """Calculates steps to run on device."""
      if steps_per_loop <= 0:
          raise ValueError("steps_per_loop should be positive integer.")
      if steps_per_loop == 1:
          return steps_per_loop
      remainder_in_epoch = current_step % steps_per_epoch
      if remainder_in_epoch != 0:
          return min(
              steps_per_epoch - remainder_in_epoch, steps_per_loop
          )
      else:
          return steps_per_loop
  
file_path: autodist/examples/benchmark/utils/bert_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  import sys
  import tensorflow
  import time
  from absl import logging
label_desc: Use image node_id 3 for calling a global function with example usage: steps_to_run(current_step, steps_per_epoch, steps_per_loop) and returns: steps_per_loop, min, steps_per_loop