def MyGrep(hash_list, index_name, iname):
    """
    hash_list: (list<subdict>)
        subdict: (dict)
            header -> value
    index_name: (str) key in subdict that maps to index names
    iname: (str) the index name we want.

    Returns:
        list<dict> minimized such that only dicts with wanted index name
            are in it.
    """
    new_list = []
    for h in hash_list:
        if h[index_name] == iname:
            new_list.append(h)
    return new_list