<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_user_agent(self):
 """Returns the user-agent string for this client info."""


        # Note: the order here is important as the internal metrics system
        # expects these items to be in specific locations.
        ua = ""

        if self.user_agent is not None:
            ua += "{user_agent} "

        ua += "gl-python/{python_version} "

        if self.grpc_version is not None:
            ua += "grpc/{grpc_version} "

        ua += "gax/{api_core_version} "

        if self.gapic_version is not None:
            ua += "gapic/{gapic_version} "

        if self.client_library_version is not None:
            ua += "gccl/{client_library_version} "

        return ua.format(**self.__dict__).strip()