def _cull(potential, matches, verbose=0):
 for match in matches:
  if _samefile(potential[0], match[0]):
   if verbose:
    sys.stderr.write(('duplicate: %s (%s)\n' % potential))
   return None
 else:
  if (not stat.S_ISREG(os.stat(potential[0]).st_mode)):
   if verbose:
    sys.stderr.write(('not a regular file: %s (%s)\n' % potential))
  elif ((sys.platform != 'win32') and (not os.access(potential[0], os.X_OK))):
   if verbose:
    sys.stderr.write(('no executable access: %s (%s)\n' % potential))
  else:
   matches.append(potential)
   return potential

def _cull ( potential , matches , verbose = 0 ) : for match in matches : if _samefile ( potential [ 0 ] , match [ 0 ] ) : if verbose : sys . stderr . write ( ( 'duplicate: %s (%s)\n' % potential ) ) return None else : if ( not stat . S_ISREG ( os . stat ( potential [ 0 ] ) . st_mode ) ) : if verbose : sys . stderr . write ( ( 'not a regular file: %s (%s)\n' % potential ) ) elif ( ( sys . platform != 'win32' ) and ( not os . access ( potential [ 0 ] , os . X_OK ) ) ) : if verbose : sys . stderr . write ( ( 'no executable access: %s (%s)\n' % potential ) ) else : matches . append ( potential ) return potential
cull inappropriate matches .