code: def validate_anneal_schedule(self, anneal_schedule):
          if 'anneal_schedule' not in self.parameters:
              raise RuntimeError("anneal_schedule is not an accepted parameter for this sampler")
          properties = self.properties
          try:
              min_anneal_time, max_anneal_time = properties['annealing_time_range']
              max_anneal_schedule_points = properties['max_anneal_schedule_points']
          except KeyError:
              raise RuntimeError("annealing_time_range and max_anneal_schedule_points are not properties of this solver")
          if not isinstance(anneal_schedule, list):
              raise TypeError("anneal_schedule should be a list")
          elif len(anneal_schedule) < 2 or len(anneal_schedule) > max_anneal_schedule_points:
              msg = ("anneal_schedule must contain between 2 and {} points (contains {})"
                     ).format(max_anneal_schedule_points, len(anneal_schedule))
              raise ValueError(msg)
          try:
              t_list, s_list = zip(*anneal_schedule)
          except ValueError:
              raise ValueError("anneal_schedule should be a list of 2-tuples")
          if not all(tail_t < lead_t for tail_t, lead_t in zip(t_list, t_list[1:])):
              raise ValueError("Time t must increase for all points in the schedule")
          if t_list[-1] > max_anneal_time:
              raise ValueError("schedule cannot be longer than the maximum anneal time of {}".format(max_anneal_time))
          start_s, end_s = s_list[0], s_list[-1]
          if end_s != 1:
              raise ValueError("In the final point, anneal fraction s must equal 1.")
          if start_s == 1:
              pass
          elif start_s == 0:
              if not all(tail_s <= lead_s for tail_s, lead_s in zip(s_list, s_list[1:])):
                  raise ValueError("For forward anneals, anneal fraction s must monotonically increase")
          else:
              msg = ("In the first point, anneal fraction s must equal 0 for forward annealing or "
                     "1 for reverse annealing")
              raise ValueError(msg)
          max_slope = 1.0 / min_anneal_time
          for (t0, s0), (t1, s1) in zip(anneal_schedule, anneal_schedule[1:]):
              if abs((s0 - s1) / (t0 - t1)) > max_slope:
                  raise ValueError("the maximum slope cannot exceed {}".format(max_slope))