84 result_iovs = [[]
for i
in iovs]
85 active_states, ended_states = [
set()
for i
in iovs], [
set()
for i
in iovs]
87 def bind_to_run(run_iov, active_states):
89 Given a run_iov and a set of active iovs, emit iovs which are bound
92 for active_state
in sorted(active_states):
93 iov = active_state._replace(
94 since=
max(run_iov.since+1, active_state.since),
95 until=
min(run_iov.until, active_state.until))
97 if iov.since != iov.until:
101 for position, index, beginning, iov
in iov_yielder(run_iovs, *iovs):
108 for active, ended
in zip(active_states, ended_states):
109 active.difference_update(ended)
114 for i, chan_active_states
in enumerate(active_states):
115 result_iovs[i].
extend(bind_to_run(iov, chan_active_states))
121 action = active_states[index]
if beginning
else ended_states[index]