def user_agent():
data = {<EOL>"<STR_LIT>": {"<STR_LIT:name>": "<STR_LIT>", "<STR_LIT:version>": pipenv.patched.notpip.__version__},<EOL>"<STR_LIT>": platform.python_version(),<EOL>"<STR_LIT>": {<EOL>"<STR_LIT:name>": platform.python_implementation(),<EOL>},<EOL>}<EOL>if data["<STR_LIT>"]["<STR_LIT:name>"] == '<STR_LIT>':<EOL><INDENT>data["<STR_LIT>"]["<STR_LIT:version>"] = platform.python_version()<EOL><DEDENT>elif data["<STR_LIT>"]["<STR_LIT:name>"] == '<STR_LIT>':<EOL><INDENT>if sys.pypy_version_info.releaselevel == '<STR_LIT>':<EOL><INDENT>pypy_version_info = sys.pypy_version_info[:<NUM_LIT:3>]<EOL><DEDENT>else:<EOL><INDENT>pypy_version_info = sys.pypy_version_info<EOL><DEDENT>data["<STR_LIT>"]["<STR_LIT:version>"] = "<STR_LIT:.>".join(<EOL>[str(x) for x in pypy_version_info]<EOL>)<EOL><DEDENT>elif data["<STR_LIT>"]["<STR_LIT:name>"] == '<STR_LIT>':<EOL><INDENT>data["<STR_LIT>"]["<STR_LIT:version>"] = platform.python_version()<EOL><DEDENT>elif data["<STR_LIT>"]["<STR_LIT:name>"] == '<STR_LIT>':<EOL><INDENT>data["<STR_LIT>"]["<STR_LIT:version>"] = platform.python_version()<EOL><DEDENT>if sys.platform.startswith("<STR_LIT>"):<EOL><INDENT>from pipenv.patched.notpip._vendor import distro<EOL>distro_infos = dict(filter(<EOL>lambda x: x[<NUM_LIT:1>],<EOL>zip(["<STR_LIT:name>", "<STR_LIT:version>", "<STR_LIT:id>"], distro.linux_distribution()),<EOL>))<EOL>libc = dict(filter(<EOL>lambda x: x[<NUM_LIT:1>],<EOL>zip(["<STR_LIT>", "<STR_LIT:version>"], libc_ver()),<EOL>))<EOL>if libc:<EOL><INDENT>distro_infos["<STR_LIT>"] = libc<EOL><DEDENT>if distro_infos:<EOL><INDENT>data["<STR_LIT>"] = distro_infos<EOL><DEDENT><DEDENT>if sys.platform.startswith("<STR_LIT>") and platform.mac_ver()[<NUM_LIT:0>]:<EOL><INDENT>data["<STR_LIT>"] = {"<STR_LIT:name>": "<STR_LIT>", "<STR_LIT:version>": platform.mac_ver()[<NUM_LIT:0>]}<EOL><DEDENT>if platform.system():<EOL><INDENT>data.setdefault("<STR_LIT>", {})["<STR_LIT:name>"] = platform.system()<EOL><DEDENT>if platform.release():<EOL><INDENT>data.setdefault("<STR_LIT>", {})["<STR_LIT>"] = platform.release()<EOL><DEDENT>if platform.machine():<EOL><INDENT>data["<STR_LIT>"] = platform.machine()<EOL><DEDENT>if HAS_TLS:<EOL><INDENT>data["<STR_LIT>"] = ssl.OPENSSL_VERSION<EOL><DEDENT>setuptools_version = get_installed_version("<STR_LIT>")<EOL>if setuptools_version is not None:<EOL><INDENT>data["<STR_LIT>"] = setuptools_version<EOL><DEDENT>return "<STR_LIT>".format(<EOL>data=data,<EOL>json=json.dumps(data, separators=("<STR_LIT:U+002C>", "<STR_LIT::>"), sort_keys=True),<EOL>)<EOL>
Return a string representing the user agent.