def _build_response(self):
responses = []<EOL>self.event_urls = []<EOL>for index, event in enumerate(self.events):<EOL><INDENT>self.py3.threshold_get_color(index + <NUM_LIT:1>, "<STR_LIT>")<EOL>self.py3.threshold_get_color(index + <NUM_LIT:1>, "<STR_LIT:time>")<EOL>event_dict = {}<EOL>event_dict["<STR_LIT>"] = event.get("<STR_LIT>")<EOL>event_dict["<STR_LIT:location>"] = event.get("<STR_LIT:location>")<EOL>event_dict["<STR_LIT:description>"] = event.get("<STR_LIT:description>")<EOL>self.event_urls.append(event["<STR_LIT>"])<EOL>if event["<STR_LIT:start>"].get("<STR_LIT:date>") is not None:<EOL><INDENT>start_dt = self._gstr_to_date(event["<STR_LIT:start>"].get("<STR_LIT:date>"))<EOL>end_dt = self._gstr_to_date(event["<STR_LIT:end>"].get("<STR_LIT:date>"))<EOL><DEDENT>else:<EOL><INDENT>start_dt = self._gstr_to_datetime(event["<STR_LIT:start>"].get("<STR_LIT>"))<EOL>end_dt = self._gstr_to_datetime(event["<STR_LIT:end>"].get("<STR_LIT>"))<EOL><DEDENT>if end_dt < datetime.datetime.now(tzlocal()):<EOL><INDENT>continue<EOL><DEDENT>event_dict["<STR_LIT>"] = self._datetime_to_str(start_dt, self.format_time)<EOL>event_dict["<STR_LIT>"] = self._datetime_to_str(end_dt, self.format_time)<EOL>event_dict["<STR_LIT>"] = self._datetime_to_str(start_dt, self.format_date)<EOL>event_dict["<STR_LIT>"] = self._datetime_to_str(end_dt, self.format_date)<EOL>time_delta = self._delta_time(start_dt)<EOL>if time_delta["<STR_LIT>"] < <NUM_LIT:0>:<EOL><INDENT>time_delta = self._delta_time(end_dt)<EOL>is_current = True<EOL><DEDENT>else:<EOL><INDENT>is_current = False<EOL><DEDENT>event_dict["<STR_LIT>"] = self._format_timedelta(<EOL>index, time_delta, is_current<EOL>)<EOL>if self.warn_threshold > <NUM_LIT:0>:<EOL><INDENT>self._check_warn_threshold(time_delta, event_dict)<EOL><DEDENT>event_formatted = self.py3.safe_format(<EOL>self.format_event,<EOL>{<EOL>"<STR_LIT>": self.button_states[index],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>"<STR_LIT:location>": event_dict["<STR_LIT:location>"],<EOL>"<STR_LIT:description>": event_dict["<STR_LIT:description>"],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>"<STR_LIT>": event_dict["<STR_LIT>"],<EOL>},<EOL>)<EOL>self.py3.composite_update(event_formatted, {"<STR_LIT:index>": index})<EOL>responses.append(event_formatted)<EOL>self.no_update = False<EOL><DEDENT>format_separator = self.py3.safe_format(self.format_separator)<EOL>self.py3.composite_update(format_separator, {"<STR_LIT:index>": "<STR_LIT>"})<EOL>responses = self.py3.composite_join(format_separator, responses)<EOL>return {"<STR_LIT>": responses}<EOL>
Builds the composite reponse to be output by the module by looping
through all events and formatting the necessary strings.

Returns: A composite containing the individual response for each event.