code: def validation_settings(
      dataset_size, batch_size, val_size, val_interval, keep_best_model
  ):
      """
      Auto-select reasonable validation settings
      """
      if val_size is not None and val_interval is not None:
          return (
              _integer_val_size(val_size, dataset_size),
              val_interval,
          )
  
          # Auto-select reasonable validation size
      if val_size == "auto":
          if dataset_size < 50 and not keep_best_model:
              val_size = 0
          else:
              val_size = max(5, int(0.05 * dataset_size))
              val_size = min(100, val_size)
      else:
          val_size = _integer_val_size(val_size, dataset_size)
  
          # Auto-select reasonable validation interval
      if val_interval is None:
          # sys.maxsize corresponds to never running validation
          # and is used when val_size is set to 0
          val_interval = (
              4 * int(math.ceil(val_size / batch_size)) or None
          )
      else:
          val_interval = int(val_interval)
  
      return int(val_size), val_interval
  
file_path: finetune/finetune/util/input_utils.py
imports: import math
  import tensorflow
  from finetune.util.timing import ProgressBar
label_desc: Use image node_id 2 for calling a global function with example usage: validation_settings(dataset_size, batch_size, val_size, val_interval, keep_best_model) and returns: int,  val_interval, _integer_val_size,  val_interval