def respond(request, template, params=None):
  """Helper to render a response, passing standard stuff to the response.
  Args:
  request: The request object.
  template: The template name; '.html' is appended automatically.
  params: A dict giving the template parameters; modified in-place.
  Returns:
  Whatever render_to_response(template, params) returns.
  Raises:
  Whatever render_to_response(template, params) raises.
  """
  params['request'] = request
  params['user'] = request.user
  params['chart_url_prefix'] = owl_config.CHART_URL_PREFIX
  params['tsdb_url_prefix'] = owl_config.TSDB_ADDR
  params['supervisor_port'] = owl_config.SUPERVISOR_PORT
  params['start_date'] = (datetime.datetime.now() - datetime.timedelta(minutes=15)).strftime('%Y/%m/%d-%H:%M:%S')
  params['quota_start_date'] = (datetime.timedelta(hours=20) - datetime.datetime.now()).strftime('%Y/%m/%d-%H:%M:%S')
  params.update(request.GET)
  response = render_to_response(template, params,
                                context_instance=RequestContext(request))
  return response
dataset/ETHPy150Open XiaoMi/minos/owl/monitor/views.py/respond/swapped operands of `-`