def collect_copyable_files(self, media_files, root):
        #python 2.5 does not have the followlinks keyword argument
        has_followlinks = sys.version_info >= (2, 6)
        if has_followlinks:
            allfiles = os.walk(root, followlinks=True)
        else:
            allfiles = os.walk(root)

        for root_path, dirs, files in allfiles:
            for file in files:
                ext = os.path.splitext(file)[1].lstrip('.')
                path = os.path.join(root_path, file)
                if not has_followlinks:
                    path = os.path.abspath(path)
                media_path = path[len(root) + 1:].replace(os.sep, '/')
                if ext in COPY_MEDIA_FILETYPES and \
                        not IGNORE_PATTERN.match(media_path):
                    media_files[media_path] = path
dataset/ETHPy150Open adieu/django-mediagenerator/mediagenerator/generators/copyfiles.py/CopyFiles.collect_copyable_files/original