def upcoming_contests(platforms, time):
  """Gets all the upcoming contests based on time and platforms"""
  contests_data = get_contests_data()
  platform_filter = get_platform_filter(platforms)

  upcoming_challenges = [contest for contest in contests_data["pending"] if contest["host_name"] in platform_filter 
    and time_difference(contest["start"]).days <= time]

  return upcoming_challenges
dataset/ETHPy150Open architv/chcli/challenges/cli.py/upcoming_contests/original