<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_file(self, needle, candidates):
 """Find the first directory containing a given candidate file."""

        for candidate in candidates:
            fullpath = os.path.join(candidate, needle)
            if os.path.isfile(fullpath):
                return fullpath
        raise PathError("Unable to locate file %s; tried %s" % (needle, candidates))