<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_events(resource_root, query_str=None):
 """ Search for events. @param query_str: Query string. @return: A list of ApiEvent. """

  params = None
  if query_str:
    params = dict(query=query_str)
  return call(resource_root.get, EVENTS_PATH, ApiEventQueryResult,
      params=params)