def get_index(fields, keys):
    """ Get indices of *keys*, each of which is in list *fields* """
    assert isinstance(keys, list)
    assert isinstance(fields, list)
    return [fields.index(k) for k in keys]