@staticmethod<EOL><INDENT>def _apply_credentials(auto_refresh=True, credentials=None,<EOL>headers=None):<DEDENT>
token = credentials.get_credentials().access_token<EOL>if auto_refresh is True:<EOL><INDENT>if token is None:<EOL><INDENT>token = credentials.refresh(<EOL>access_token=None, timeout=<NUM_LIT:10>)<EOL><DEDENT>elif credentials.jwt_is_expired():<EOL><INDENT>token = credentials.refresh(timeout=<NUM_LIT:10>)<EOL><DEDENT><DEDENT>headers.update(<EOL>{'<STR_LIT>': "<STR_LIT>".format(token)}<EOL>)<EOL>
Update Authorization header.

        Update request headers with latest `access_token`. Perform token
        `refresh` if token is ``None``.

        Args:
            auto_refresh (bool): Perform token refresh if access_token is ``None`` or expired. Defaults to ``True``.
            credentials (class): Read-only credentials.
            headers (class): Requests `CaseInsensitiveDict`.