<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_delta_name(file):
 """Return if a file has a valid name A delta file name can be: - pre-all.py - pre-all.sql - delta_x.x.x_ddmmyyyy.pre.py - delta_x.x.x_ddmmyyyy.pre.sql - delta_x.x.x_ddmmyyyy.py - delta_x.x.x_ddmmyyyy.sql - delta_x.x.x_ddmmyyyy.post.py - delta_x.x.x_ddmmyyyy.post.sql - post-all.py - post-all.sql where x.x.x is the version number and _ddmmyyyy is an optional description, usually representing the date of the delta file """

        filename = basename(file)
        pattern = re.compile(Delta.FILENAME_PATTERN)
        if re.match(pattern, filename):
            return True
        return False