def GetProblemIoSetByName(problem, io_set_name):
  """Get a problem's index given its key and a problem list.

  Args:
    problem: Problem whose I/O set must be retrieved.
    io_set_name: String with the name of the I/O set to retrieve.

  Returns:
    The problem I/O set with the specified name, or None if no I/O set with that
    name is found.
  """
  io_set_index = problem['io_set_name_to_index'].get(io_set_name)
  if io_set_index is None:
    return None
  return problem['io_sets'][io_set_index]