<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_npolfile(flist,detector,filters):
 """ Search a list of files for one that matches the configuration of detector and filters used. """

    npolfile = None
    for f in flist:
        fdet = fits.getval(f, 'detector', memmap=False)
        if fdet == detector:
            filt1 = fits.getval(f, 'filter1', memmap=False)
            filt2 = fits.getval(f, 'filter2', memmap=False)
            fdate = fits.getval(f, 'date', memmap=False)
            if filt1 == 'ANY' or \
             (filt1 == filters[0] and filt2 == filters[1]):
                npolfile = f
    return npolfile