Build an index from a list of items.
Usage
index(items)
items: list
The items to index.
dict
A dictionary mapping each item to its position.
>>> index(["a", "b", "c"]) {'a': 0, 'b': 1, 'c': 2}