<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _can_retry(self, batch, error):
 """ We can retry a send if the error is transient and the number of attempts taken is fewer than the maximum allowed """

        return (batch.attempts < self.config['retries']
                and getattr(error, 'retriable', False))