<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query_timeseries(self, query, from_time=None, to_time=None, by_post=False):
 """ Query time series. @param query: Query string. @param from_time: Start of the period to query (optional). @param to_time: End of the period to query (default = now). @return: A list of ApiTimeSeriesResponse. """

    return timeseries.query_timeseries(self, query, from_time, to_time, by_post=by_post)