code: def update(self, pbar):
          'Updates the widget with the current SI prefixed speed.'
  
          if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6: # =~ 0
              scaled = power = 0
          else:
              speed = pbar.currval / pbar.seconds_elapsed
              power = int(math.log(speed, 1000))
              scaled = speed / 1000.**power
  
          return self._format % (scaled, self.prefixes[power], self.unitf update(self, pbar):
          'Updates the widget with the current SI prefixed speed.'
  
          if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6: # =~ 0
              scaled = power = 0
          else:
              speed = pbar.currval / pbar.seconds_elapsed
              power = int(math.log(speed, 1000))
              scaled = speed / 1000.**power
  
          return self._format % (scaled, self.prefixes[power], self.unit)
docs: Updates the widget with the current SI prefixed speed.