<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_invalid_filenames(filenames, repository_root):
 """Find files that does not exist, are not in the repo or are directories. Args: filenames: list of filenames to check repository_root: the absolute path of the repository's root. Returns: A list of errors. """

    errors = []
    for filename in filenames:
        if not os.path.abspath(filename).startswith(repository_root):
            errors.append((filename, 'Error: File %s does not belong to '
                           'repository %s' % (filename, repository_root)))
        if not os.path.exists(filename):
            errors.append((filename,
                           'Error: File %s does not exist' % (filename, )))
        if os.path.isdir(filename):
            errors.append((filename,
                           'Error: %s is a directory. Directories are'
                           ' not yet supported' % (filename, )))

    return errors