def _index_of(elements, value):
    """Get index of value in iterable. Defaults to -1 if not found"""

    for index, item in enumerate(elements):
        if item == value:
            return index
    return -1