def __call__(self, iterable):
        'Use a ProgressBar to iterate through an iterable'

        try:
            self.maxval = len(iterable)
        except:
            if self.maxval is None:
                self.maxval = UnknownLength

        self.__iterable = iter(iterable)
        return self
Use a ProgressBar to iterate through an iterable
metadrive/render_pipeline/rplibs/progressbar/__init__.py