def _call_api(self, http_method, url, **kwargs):
log.debug("<STR_LIT>".format(http_method.__name__.upper(), url, kwargs))<EOL>if self.ratelimit is not None:<EOL><INDENT>response = self._ratelimit(http_method=http_method, url=url, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>response = http_method(url, **kwargs)<EOL><DEDENT>if response.status_code == <NUM_LIT>:<EOL><INDENT>while '<STR_LIT>' in response.headers and int(response.headers['<STR_LIT>']) > <NUM_LIT:0>:<EOL><INDENT>retry_after_seconds = int(response.headers['<STR_LIT>'])<EOL>log.warning(<EOL>"<STR_LIT>" % retry_after_seconds<EOL>)<EOL>while retry_after_seconds > <NUM_LIT:0>:<EOL><INDENT>retry_after_seconds -= <NUM_LIT:1><EOL>self.check_ratelimit_budget(<NUM_LIT:1>)<EOL>log.debug("<STR_LIT>" % retry_after_seconds)<EOL>sleep(<NUM_LIT:1>)<EOL><DEDENT>response = http_method(url, **kwargs)<EOL><DEDENT><DEDENT>self._check_response(response)<EOL>self._update_callsafety(response)<EOL>return response<EOL>
Execute a call to the Zendesk API. Handles rate limiting, checking the response
from Zendesk and deserialization of the Zendesk response. All
communication with Zendesk should go through this method.

:param http_method: The requests method to call (eg post, put, get).
:param url: The url to pass to to the requests method.
:param kwargs: Any additional kwargs to pass on to requests.