<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def check_file(filepath):
    '''
        - Checks if the parent directories for this path exist.
        - Checks that the file exists.
        - Donates the file to the web server user.

        TODO: This is Debian / Ubuntu specific.
    '''
    check_path(filepath)
    if not os.path.exists(filepath):
        print("WARNING: File does not exist. Creating it: %s" % filepath)
        open(filepath, 'a').close()
    try:
        print("Setting access rights for %s for www-data user" % (filepath))
        uid = pwd.getpwnam("www-data").pw_uid
        gid = grp.getgrnam("www-data").gr_gid
        os.chown(filepath, uid, gid)
        os.chmod(filepath, 0o660)  # rw-rw---
    except Exception:
        print("WARNING: Could not adjust file system permissions for %s. Make sure your web server can write into it." % filepath)