<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exclude_file(self, file):
 """True if file should be exclude based on name pattern."""

        for pattern in self.compiled_exclude_files:
            if (pattern.match(file)):
                return(True)
        return(False)