Helper class to find the index of the closest matching value in an array/list/…, used to locate the pointing of an event based on the trigger time. This searches using pythons bisect module. Duplicated values will result in the first value being returned.
Explanations can be found here: https://stackoverflow.com/questions/9706041/finding-index-of-an-item-closest-to-the-value-in-a-list-thats-not-entirely-sort
Since we only need the searching part, the code has been cut down slightly.
Given a value, that is comparable to the associated
valueslist, return the index of the closest matching entry relative to the unordered list, that was given at construction.