def _retry(self, context, backoff):
<EOL>if not hasattr(context, '<STR_LIT:count>'):<EOL><INDENT>context.count = <NUM_LIT:0><EOL><DEDENT>if self._should_retry(context):<EOL><INDENT>backoff_interval = backoff(context)<EOL>context.count += <NUM_LIT:1><EOL>if self.retry_to_secondary:<EOL><INDENT>self._set_next_host_location(context)<EOL><DEDENT>if hasattr(context.request.body, '<STR_LIT>'):<EOL><INDENT>if context.body_position is None:<EOL><INDENT>return None<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>context.request.body.seek(context.body_position, SEEK_SET)<EOL><DEDENT>except UnsupportedOperation:<EOL><INDENT>return None<EOL><DEDENT><DEDENT><DEDENT>return backoff_interval<EOL><DEDENT>return None<EOL>
A function which determines whether and how to retry.

:param ~..models.RetryContext context: 
    The retry context. This contains the request, response, and other data 
    which can be used to determine whether or not to retry.
:param function() backoff:
    A function which returns the backoff time if a retry is to be performed.
:return: 
    An integer indicating how long to wait before retrying the request, 
    or None to indicate no retry should be performed.
:rtype: int or None