code: 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)
      ])f 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)
      ]);
docs: 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.