def _cull(potential, matches, verbose=<NUM_LIT:0>):
for match in matches: <EOL><INDENT>if _samefile(potential[<NUM_LIT:0>], match[<NUM_LIT:0>]):<EOL><INDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>" % potential)<EOL><DEDENT>return None<EOL><DEDENT><DEDENT>if not stat.S_ISREG(os.stat(potential[<NUM_LIT:0>]).st_mode):<EOL><INDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>" % potential)<EOL><DEDENT><DEDENT>elif not os.access(potential[<NUM_LIT:0>], os.X_OK):<EOL><INDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>" % potential)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>matches.append(potential)<EOL>return potential<EOL><DEDENT>return None<EOL>
Cull inappropriate matches. Possible reasons:
        - a duplicate of a previous match
        - not a disk file
        - not executable (non-Windows)
    If 'potential' is approved it is returned and added to 'matches'.
    Otherwise, None is returned.