def _contentful_user_agent(self):
header = {}<EOL>from . import __version__<EOL>header['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:version>': __version__<EOL>}<EOL>header['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': self.application_name,<EOL>'<STR_LIT:version>': self.application_version<EOL>}<EOL>header['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': self.integration_name,<EOL>'<STR_LIT:version>': self.integration_version<EOL>}<EOL>header['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:version>': platform.python_version()<EOL>}<EOL>os_name = platform.system()<EOL>if os_name == '<STR_LIT>':<EOL><INDENT>os_name = '<STR_LIT>'<EOL><DEDENT>elif not os_name or os_name == '<STR_LIT>':<EOL><INDENT>os_name = None<EOL><DEDENT>elif os_name and os_name not in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>os_name = '<STR_LIT>'<EOL><DEDENT>header['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': os_name,<EOL>'<STR_LIT:version>': platform.release()<EOL>}<EOL>def format_header(key, values):<EOL><INDENT>header = "<STR_LIT>".format(key, values['<STR_LIT:name>'])<EOL>if values['<STR_LIT:version>'] is not None:<EOL><INDENT>header = "<STR_LIT>".format(header, values['<STR_LIT:version>'])<EOL><DEDENT>return "<STR_LIT>".format(header)<EOL><DEDENT>result = []<EOL>for k, values in header.items():<EOL><INDENT>if not values['<STR_LIT:name>']:<EOL><INDENT>continue<EOL><DEDENT>result.append(format_header(k, values))<EOL><DEDENT>return '<STR_LIT:U+0020>'.join(result)<EOL>
Sets the X-Contentful-User-Agent header.