<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _graphite_url(self, query, raw_data=False, graphite_url=None):
 """Build Graphite URL."""

        query = escape.url_escape(query)
        graphite_url = graphite_url or self.reactor.options.get('public_graphite_url')

        url = "{base}/render/?target={query}&from=-{from_time}&until=-{until}".format(
            base=graphite_url, query=query,
            from_time=self.from_time.as_graphite(),
            until=self.until.as_graphite(),
        )
        if raw_data:
            url = "{}&format=raw".format(url)
        return url