parameters: (function, max_tries=5, retry_on=Exception)
docstring: Try to execute a function some number of times before raising Timeout.
  
      :arg function: A function that likely has some time dependency and you want
          to try executing it multiple times to wait for the time dependency to
          resolve
      :arg max_tries: The number of times to try the function before raising
          Timeout
      :arg retry_on: An exception or tuple of exceptions that should trigger a
          retry
docstring_summary: Try to execute a function some number of times before raising Timeout.
docstring_tokens: Try to execute a function some number of times before raising Timeout .
function: def retry(function, max_tries=5, retry_on=Exception):
      """Try to execute a function some number of times before raising Timeout.
  
      :arg function: A function that likely has some time dependency and you want
          to try executing it multiple times to wait for the time dependency to
          resolve
      :arg max_tries: The number of times to try the function before raising
          Timeout
      :arg retry_on: An exception or tuple of exceptions that should trigger a
          retry
  
      """
      for _ in range(max_tries):
          try:
              return function()
          except retry_on:
              sleep(1)
      else:
          raise Timeout()
function_tokens: def retry ( function , max_tries = 5 , retry_on = Exception ) : for _ in range ( max_tries ) : try : return function ( ) except retry_on : sleep ( 1 ) else : raise Timeout ( )