def _index(array, item, key=None):
for i, el in enumerate(array):<EOL><INDENT>resolved_el = key(el) if key else el<EOL>if resolved_el == item:<EOL><INDENT>return i<EOL><DEDENT><DEDENT>return -<NUM_LIT:1><EOL>
Array search function.

Written, because ``.index()`` method for array doesn't have `key` parameter
and raises `ValueError`, if the item is not found.

Args:
    array (list): List of items, which will be searched.
    item (whatever): Item, which will be matched to elements in `array`.
    key (function, default None): Function, which will be used for lookup
                                  into each element in `array`.

Return:
    Index of `item` in `array`, if the `item` is in `array`, else `-1`.