class_docstr: Progress bar to register as callback in an optimizer
class_docstr_tok: ["Progress","bar","to","register","as","callback","in","an","optimizer"]
code: def __call__(
      self, optimizer: base.Optimizer, *args: tp.Any, **kwargs: tp.Any
  ) -> None:
      if self._progress_bar is None:
          # pylint: disable=import-outside-toplevel
          try:
              from tqdm import (
                  tqdm,
              )  # Inline import to avoid additional dependency
          except ImportError as e:
              raise ImportError(
                  f"{self.__class__.__name__} requires tqdm which is not installed by default "
                  "(pip install tqdm)"
              ) from e
          self._progress_bar = tqdm()
          self._progress_bar.total = optimizer.budget
          self._progress_bar.update(self._current)
      self._progress_bar.update(1)
      self._current += 1
  
imports: import json
  import time
  import warnings
  import inspect
  import datetime
  import logging
  from pathlib import Path
  import numpy
  import nevergrad.common.typing
  from nevergrad.common import errors
  from nevergrad.parametrization import parameter
  from nevergrad.parametrization import helpers
  from .None import base
label_desc: Use image node_id 2 for calling the ProgressBar obj's underlying member method code with example usage: obj.__call__(optimizer) without return types