class_docstr: maximum-compatibility tqdm-based progressbars
class_docstr_tok: ["maximum-compatibility","tqdm-based","progressbars"]
docstr: Returns a wrapped `fn` which calls `callback()` on each call.
  `callback` is `self.update` by default.
docstr_tok: ["Returns","a","wrapped","`","fn","`","which","calls","`","callback","(",")","`","on","each","call",".","`","callback","`","is","`","self.update","`","by","default","."]
code: def wrap_fn(self, fn, callback=None):
      """
      Returns a wrapped `fn` which calls `callback()` on each call.
      `callback` is `self.update` by default.
      """
      if callback is None:
          callback = self.update
  
      def wrapped(*args, **kwargs):
          res = fn(*args, **kwargs)
          callback()
          return res
  
      return wrapped
  
file_path: dvc/dvc/progress.py
imports: import logging
  import sys
  from threading import RLock
  from typing import TYPE_CHECKING
  from tqdm import tqdm
  from dvc.env import DVC_IGNORE_ISATTY
  from dvc.utils import env2bool
label_desc: Use image node_id 5 for calling the Tqdm obj's underlying member method code with example usage: obj.wrap_fn(fn, callback) and returns: wrapped, res