<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_endpoints_to_config(self, config, co_name, backend_name):
 """ Use the request path from the context to determine the target backend, then construct mappings from bindings to endpoints for the virtual IdP for the CO. The endpoint URLs have the form {base}/{backend}/{co_name}/{path} :type config: satosa.satosa_config.SATOSAConfig :type co_name: str :type backend_name: str :rtype: satosa.satosa_config.SATOSAConfig :param config: satosa proxy config :param co_name: CO name :param backend_name: The target backend name :return: config with mappings for CO IdP """


        for service, endpoint in self.endpoints.items():
            idp_endpoints = []
            for binding, path in endpoint.items():
                url = "{base}/{backend}/{co_name}/{path}".format(
                      base=self.base_url,
                      backend=backend_name,
                      co_name=quote_plus(co_name),
                      path=path)
                mapping = (url, binding)
                idp_endpoints.append(mapping)

            # Overwrite the IdP config with the CO specific mappings between
            # SAML binding and URL endpoints.
            config["service"]["idp"]["endpoints"][service] = idp_endpoints

        return config