85 result_iovs = [[]
for i
in iovs]
86 active_states, ended_states = [
set()
for i
in iovs], [
set()
for i
in iovs]
88 def bind_to_run(run_iov, active_states):
90 Given a run_iov and a set of active iovs, emit iovs which are bound
93 for active_state
in sorted(active_states):
94 iov = active_state._replace(
95 since=
max(run_iov.since+1, active_state.since),
96 until=
min(run_iov.until, active_state.until))
98 if iov.since != iov.until:
102 for position, index, beginning, iov
in iov_yielder(run_iovs, *iovs):
109 for active, ended
in zip(active_states, ended_states):
110 active.difference_update(ended)
115 for i, chan_active_states
in enumerate(active_states):
116 result_iovs[i].
extend(bind_to_run(iov, chan_active_states))
122 action = active_states[index]
if beginning
else ended_states[index]