code: def _checkretry(self, mydelay, condition, tries_remaining, data):
          
  
          result = mydelay
  
          if self.condition & condition and tries_remaining > 0:
  
              # hook data with tries_remaining and mydelay
              if self.hook is not None:
                  self.hook(data, condition, tries_remaining, mydelay)
              # wait mydelay seconds
              sleep(mydelay)
              result *= self.backoff  # increment mydelay with this backoff
  
          elif condition is Retries.ON_ERROR:
              raise data  # raise data if no retries and on_error
  
          else:  # else Nonify mydelay to prevent callee function to stop
              result = None
  
          return result
docs: Check if input parameters allow to retries function execution.
  
          :param float mydelay: waiting delay between two execution.
          :param int condition: condition to check with this condition.
          :param int tries_remaining: tries remaining.
          :param data: data to hook.