code: def should_retry(exception):
      if isinstance(exception, exceptions.PlotlyRequestError):
          if isinstance(exception.status_code, int) and (
              500 <= exception.status_code < 600
              or exception.status_code == 429
          ):
              # Retry on 5XX and 429 (image export throttling) errors.
              return True
          elif "Uh oh, an error occurred" in exception.message:
              return True
  
      return False
  
file_path: plotly.py/packages/python/chart-studio/chart_studio/api/v2/utils.py
imports: from __future__ import absolute_import
  import requests
  import json
  from requests.exceptions import RequestException
  from retrying import retry
  import _plotly_utils.exceptions
  from chart_studio import config, exceptions
  from chart_studio.api.utils import basic_auth
  from _plotly_utils.utils import PlotlyJSONEncoder
label_desc: Use image node_id 5 for calling a global function with example usage: should_retry(exception) and returns: False, True, True