class_docstr: Event handler that uploads respecting throttling.
  
  Uploads files every RATE_LIMIT_SECONDS, which changes as the size increases to deal
  with throttling.
class_docstr_tok: ["Event","handler","that","uploads","respecting","throttling",".","Uploads","files","every","RATE_LIMIT_SECONDS",",","which","changes","as","the","size","increases","to","deal","with","throttling","."]
code: def should_update(self) -> bool:
      if self._last_uploaded_time is not None:
          # Check rate limit by time elapsed
          time_elapsed = time.time() - self._last_uploaded_time
          # if more than 15 seconds has passed potentially upload it
          if time_elapsed < self.RATE_LIMIT_SECONDS:
              return False
  
          # Check rate limit by size increase
          if float(self._last_uploaded_size) > 0:
              size_increase = self.current_size / float(
                  self._last_uploaded_size
              )
              if size_increase < self.RATE_LIMIT_SIZE_INCREASE:
                  return False
          return time_elapsed > (
              self._min_wait_time
              or self.min_wait_for_size(self.current_size)
          )
  
      # if the file has never been uploaded, we'll upload it
      return True
  
imports: import abc
  import fnmatch
  import glob
  import logging
  import os
  import queue
  import time
  from typing import TYPE_CHECKING, Any, Mapping, MutableMapping, MutableSet, Optional
  from wandb import util
  from wandb.sdk.interface.interface import GlobStr
  from wandb.sdk.lib.paths import LogicalPath
label_desc: Use image node_id 4 for calling the PolicyLive obj's underlying member method code with example usage: obj.should_update() and returns: True, unknown, False, False