class_docstr: The base class for progress bars in Lightning. It is a :class:`~lightning.pytorch.callbacks.Callback` that keeps
  track of the batch progress in the :class:`~lightning.pytorch.trainer.trainer.Trainer`. You should implement your
  highly custom progress bars with this as the base class.
  
  Example::
  
      class LitProgressBar(ProgressBar):
  
          def __init__(self):
              super().__init__()  # don't forget this :)
              self.enable = True
  
          def disable(self):
              self.enable = False
  
          def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
              super().on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx)  # don't forget this :)
              percent = (batch_idx / self.total_train_batches) * 100
              sys.stdout.flush()
              sys.stdout.write(f'{percent:.01f} percent complete \r')
  
      bar = LitProgressBar()
      trainer = Trainer(callbacks=[bar])
class_docstr_tok: ["The","base","class","for","progress","bars","in","Lightning",".","It","is","a",":","class",":","`","~lightning.pytorch.callbacks.Callback","`","that","keeps","track","of","the","batch","progress","in","the",":","class",":","`","~lightning.pytorch.trainer.trainer.Trainer","`",".","You","should","implement","your","highly","custom","progress","bars","with","this","as","the","base","class",".","Example",":",":","class","LitProgressBar","(","ProgressBar",")",":","def","__init__","(","self",")",":","super","(",")",".__init__","(",")","#","do","n't","forget","this",":",")","self.enable","=","True","def","disable","(","self",")",":","self.enable","=","False","def","on_train_batch_end","(","self",",","trainer",",","pl_module",",","outputs",",","batch",",","batch_idx",")",":","super","(",")",".on_train_batch_end","(","trainer",",","pl_module",",","outputs",",","batch",",","batch_idx",")","#","do","n't","forget","this",":",")","percent","=","(","batch_idx","\/","self.total_train_batches",")","*","100","sys.stdout.flush","(",")","sys.stdout.write","(","f","'","{","percent",":",".01f","}","percent","complete","\\r","'",")","bar","=","LitProgressBar","(",")","trainer","=","Trainer","(","callbacks=","[","bar","]",")"]
docstr: The total number of validation batches, which may change from epoch to epoch for all val dataloaders.
  
  Use this to set the total number of iterations in the progress bar. Can return ``inf`` if the predict dataloader
  is of infinite size.
docstr_tok: ["The","total","number","of","validation","batches",",","which","may","change","from","epoch","to","epoch","for","all","val","dataloaders",".","Use","this","to","set","the","total","number","of","iterations","in","the","progress","bar",".","Can","return","``","inf","``","if","the","predict","dataloader","is","of","infinite","size","."]
code: def total_val_batches(self) -> Union[int, float]:
      """The total number of validation batches, which may change from epoch to epoch for all val dataloaders.
  
      Use this to set the total number of iterations in the progress bar. Can return ``inf`` if the predict dataloader
      is of infinite size.
  
      """
      if not self.trainer.fit_loop.epoch_loop._should_check_val_epoch():
          return 0
      return (
          sum(self.trainer.num_val_batches)
          if isinstance(self.trainer.num_val_batches, list)
          else self.trainer.num_val_batches
      )
  
imports: from typing import Any, Dict, Optional, Union
  from typing_extensions import override
  import lightning.pytorch
  from lightning.pytorch.callbacks import Callback
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 12 for calling the ProgressBar obj's underlying member method code with example usage: obj.total_val_batches() and returns: unknown, int