original_docstring: Tries each provider uri in provider_uris until the command succeeds
docstring: Tries each provider uri in provider_uris until the command succeeds
docstring_tokens: Tries each provider uri in provider_uris until the command succeeds
code: def add_provider_uri_fallback_loop(python_callable, provider_uris):
      """Tries each provider uri in provider_uris until the command succeeds"""
  
      def python_callable_with_fallback(**kwargs):
          for index, provider_uri in enumerate(provider_uris):
              kwargs['provider_uri'] = provider_uri
              try:
                  python_callable(**kwargs)
                  break
              except Exception as e:
                  if index < (len(provider_uris) - 1):
                      logging.exception('An exception occurred. Trying another uri')
                  else:
                      raise e
  
      return python_callable_with_fallback
code_tokens: def add_provider_uri_fallback_loop ( python_callable , provider_uris ) : def python_callable_with_fallback ( ** kwargs ) : for index , provider_uri in enumerate ( provider_uris ) : kwargs [ 'provider_uri' ] = provider_uri try : python_callable ( ** kwargs ) break except Exception as e : if index < ( len ( provider_uris ) - 1 ) : logging . exception ( 'An exception occurred. Trying another uri' ) else : raise e return python_callable_with_fallback
short_docstring: Tries each provider uri in provider_uris until the command succeeds
short_docstring_tokens: Tries each provider uri in provider_uris until the command succeeds
comment: """Tries each provider uri in provider_uris until the command succeeds"""