def _apply_user_agent(headers, user_agent):
if user_agent is not None:<EOL><INDENT>if '<STR_LIT>' in headers:<EOL><INDENT>headers['<STR_LIT>'] = (user_agent + '<STR_LIT:U+0020>' + headers['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>headers['<STR_LIT>'] = user_agent<EOL><DEDENT><DEDENT>return headers<EOL>
Adds a user-agent to the headers.

    Args:
        headers: dict, request headers to add / modify user
                 agent within.
        user_agent: str, the user agent to add.

    Returns:
        dict, the original headers passed in, but modified if the
        user agent is not None.