def insert_atomic_inputs(self, atomic_inputs, events_list=None):
    '''Insert inputs into events_list in the same relative order as the
    original events list. This method is needed because set union as used in
    delta debugging does not make sense for event sequences (events are ordered)'''
    # Note: events_list should never be None (I think), since it does not make
    # sense to insert inputs into the original sequence that are already present
    if events_list is None:
      raise ValueError("Shouldn't be adding inputs to the original trace")

    inputs = self._expand_atomics(atomic_inputs)

    if not all(e in self._event2idx for e in inputs):
      raise ValueError("Not all inputs present in original events list %s" %
                       [e for e in input if e not in self._event2idx])
    if not all(e in self._event2idx for e in events_list):
      raise ValueError("Not all events in original events list %s" %
                       [e for e in events_list if e not in self._event2idx])

    result = []
    for _, successor in enumerate(events_list):
      orig_successor_idx = self._event2idx[successor]
      while len(inputs) > 0 and self._event2idx[inputs[0]] > orig_successor_idx:
        # If the current successor did in fact come after the next input in the
        # original trace, insert next input here
        input = inputs.pop(0)
        result.append(input)
      result.append(successor)

    # Any remaining inputs should be appended at the end -- they had no
    # successors
    result += inputs
    # Deal with newly added host migrations
    result = self._straighten_inserted_migrations(result)
    return EventDagView(self, result)
dataset/ETHPy150Open ucb-sts/sts/sts/event_dag.py/EventDag.insert_atomic_inputs/swapped operands of `>`