def to_name_key_dict(data, name_key):
    """
    Iterates a list of dictionaries where each dictionary has a `name_key`
    value that is used to return a single dictionary indexed by those
    values.

    Returns:
        dict: Dictionary keyed by `name_key` values having the information
            contained in the original input list `data`.
    """
    return dict((row[name_key], row) for row in data)