def METHOD_NAME(files, root, basenames, patterns):
    files.extend(
        [
            os.path.normpath(os.path.join(root, n))
            for n in basenames
            for pat in patterns
            if fnmatch(n, pat)
        ]
    )