code: def get_resource_with_auto_refresh(session, download_url):
      """
      Attempts download of audio with a token refresh if necessary.
      """
      try:
          result = session.get(download_url)
  
      except TokenExpiredError as e:
          session = refresh_token(session)
          result = session.get(download_url)
  
      except Exception as e:
          result = None
  
          print(
              f"Skipping file {download_url} due to exception below\n\n"
          )
          print(e)
  
      return result.content
  
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 9 for calling a global function with example usage: get_resource_with_auto_refresh(session, download_url) and returns: result