code: def create_s3_session():
      
      sess = requests.Session()
      retries = Retry(total=3,
                      backoff_factor=.5,
                      status_forcelist=[500, 502, 503, 504])
      sess.mount('https://', HTTPAdapter(max_retries=retries))
      return sess
docs: Creates a session with automatic retries on 5xx errors.