def _url(self, endpoint, path=None):
log.debug('<STR_LIT>'.format(<EOL>endpoint, path))<EOL>try:<EOL><INDENT>endpoint = ENDPOINTS[endpoint]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise APIError<EOL><DEDENT>url = '<STR_LIT>'.format(<EOL>base_url=self.base_url,<EOL>endpoint=endpoint,<EOL>)<EOL>if path is not None:<EOL><INDENT>url = '<STR_LIT>'.format(url, quote(path))<EOL><DEDENT>return url<EOL>
The complete URL we will end up querying. Depending on the
        endpoint we pass in  this will result in different URL's with
        different prefixes.

        :param endpoint: The PuppetDB API endpoint we want to query.
        :type endpoint: :obj:`string`
        :param path: An additional path if we don't wish to query the\
                bare endpoint.
        :type path: :obj:`string`

        :returns: A URL constructed from :func:`base_url` with the\
                apropraite API version/prefix and the rest of the path added\
                to it.
        :rtype: :obj:`string`