code: def retry(*dargs, **dkw):
      """
      Decorator function that instantiates the Retrying object
      @param *dargs: positional arguments passed to Retrying object
      @param **dkw: keyword arguments passed to the Retrying object
      """
      # support both @retry and @retry() as valid syntax
      if len(dargs) == 1 and callable(dargs[0]):
  
          def wrap_simple(f):
              @six.wraps(f)
              def wrapped_f(*args, **kw):
                  return Retrying().call(f, *args, **kw)
  
              return wrapped_f
  
          return wrap_simple(dargs[0])
  
      else:
  
          def wrap(f):
              @six.wraps(f)
              def wrapped_f(*args, **kw):
                  return Retrying(*dargs, **dkw).call(f, *args, **kw)
  
              return wrapped_f
  
          return wrap
  
imports: import random
  import six
  import sys
  import time
  import traceback
label_desc: Use image node_id 2 for calling a global function with example usage: retry() and returns: wrap_simple, wrap, wrapped_f, wrapped_f, Retrying, Retrying