<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def filter_hashes_from_file(fname, f, **kw):
    '''
    Obtain good hashes from a .p4 file with the dict hashd and a
    function that returns good hashes. Any keywords will be
    sent to read_and_hash.

    Parameters:
    -----------

    fname -- filename of file.
    f     -- function that returns a list of good hashes.
    '''
    return np.concatenate([
        frame['data']['hash'][f(frame)]
        for frame in read_and_hash(fname, **kw)
    ]);