def short_contests(platforms):
  contests_data = get_contests_data()
  active_contests = contests_data["active"]
  upcoming_contests = contests_data["pending"]

  platform_filter = get_platform_filter(platforms)
  get_challenge_duration = lambda x : int(x.split(":")[0]) if "days" not in x else float("inf")
  short_contests = [contest for contest in active_contests
    if get_challenge_duration(contest["duration"]) <= 4 and contest["host_name"] in platform_filter]
  short_contests += [contest for contest in upcoming_contests
    if get_challenge_duration(contest["duration"]) <= 4 and contest["host_name"] in platform_filter]
  return short_contests
If view returned serializable dict, returns JsonResponse with this dict as content.
dataset/ETHPy150Open architv/chcli/challenges/cli.py/short_contests--crossover with--dataset/ETHPy150Open splunk/splunk-webframework/server/splunkdj/decorators/render.py/ajax_request