def filefind(self, names):
if type(names) is str:<EOL><INDENT>names = [names]<EOL><DEDENT>lower_names = []<EOL>for name in names:<EOL><INDENT>lower_names.append(name.lower())<EOL><DEDENT>names = lower_names<EOL>files = self.list_files()<EOL>found = []<EOL>for fullpath in files:<EOL><INDENT>filename = os.path.basename(fullpath)<EOL>if filename.lower() in names:<EOL><INDENT>logger.debug("<STR_LIT>", fullpath)<EOL>if not os.path.exists(fullpath):<EOL><INDENT>logger.warn("<STR_LIT>"<EOL>"<STR_LIT>", fullpath)<EOL>continue<EOL><DEDENT>found.append(fullpath)<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>return<EOL><DEDENT>if len(found) > <NUM_LIT:1>:<EOL><INDENT>found.sort(key=len)<EOL>logger.warn("<STR_LIT>"<EOL>"<STR_LIT>", '<STR_LIT:U+002CU+0020>'.join(found))<EOL><DEDENT>return found[<NUM_LIT:0>]<EOL>
Return first found file matching name (case-insensitive).

        Some packages have docs/HISTORY.txt and
        package/name/HISTORY.txt.  We make sure we only return the one
        in the docs directory if no other can be found.

        'names' can be a string or a list of strings; if you have both
        a CHANGES.txt and a docs/HISTORY.txt, you want the top level
        CHANGES.txt to be found first.