code: def is_resource_limited(e: freesound.FreesoundException):
      """
      Test if the reason for a freesound exception was either rate limit
      or daily limit.
  
      If it was for either reason, sleep for an appropriate delay and return
      to try again.
  
      Args:
          e: Freesound Exception object
  
      Returns:
          A boolean which describes whether the error was due to some
          api limit issue, or if it was some other reason.
  
          If false is returned, then the user should carefully check the cause
          and log it.
      """
      detail = e.detail["detail"]
  
      if "2000" in detail:
          # This is the request limit, hold off for 1 hour and try again
          print(f"Hit daily limit, sleeping for 20 minutes.")
          time.sleep(60 * 20)
          return True
  
      elif "60" in detail:
          # This is the request limit per minute, hold off for 1 minute and try again
          print(f"Hit rate limit, sleeping for 1 minute.")
          time.sleep(60)
          return True
  
      else:
          return False
  
file_path: NeMo/scripts/freesound_download_resample/freesound_download.py
imports: import argparse
  import os
  import pickle
  import time
label_desc: Use image node_id 6 for calling a global function with example usage: is_resource_limited(e) and returns: True, True, False