import json


def _CreateTaskJSON(options):
  """Creates a JSON representation of the requested task."""
  task_params = {}
  task_params["username"] = options.requester
  task_params["benchmark"] = options.benchmark
  task_params["platform"] = "Linux"
  task_params["page_sets"] = "10k"
  task_params["repeat_runs"] = "3"
  task_params["run_in_parallel"] = str(options.parallel)
  task_params["benchmark_args"] = "--output-format=csv-pivot-table"
  task_params["browser_args_nopatch"] = (
      "--disable-setuid-sandbox --enable-threaded-compositing "
      "--enable-impl-side-painting")
  task_params["browser_args_withpatch"] = (
      "--disable-setuid-sandbox --enable-threaded-compositing "
      "--enable-impl-side-painting")

  trybot_params = {}
  trybot_params["issue"] = options.issue
  trybot_params["patchset"] = options.patchset
  trybot_params["task"] = task_params
  return json.dumps(trybot_params)