def _collect_all_modules(self):
        """Collect modules, so we can handle imports later"""
        for pkgroot in self.path:
            pkgroot = os.path.abspath(pkgroot)

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

            for root, dirs, files in allfiles:
                if '__init__.py' in files:
                    files.remove('__init__.py')
                    # The root __init__.py is ignored
                    if root != pkgroot:
                        files.insert(0, '__init__.py')
                elif root != pkgroot:
                    # Only add valid Python packages
                    dirs[:] = []
                    continue

                for filename in files:
                    if not filename.endswith('.py'):
                        continue

                    path = os.path.join(root, filename)
                    if not has_followlinks:
                        path = os.path.abspath(path)
                    module_path = path[len(pkgroot) + len(os.sep):]
                    if os.path.basename(module_path) == '__init__.py':
                        module_name = os.path.dirname(module_path)
                    else:
                        module_name = module_path[:-3]
                    assert '.' not in module_name, \
                        module_path % 'Invalid module file name: %s'
                    module_name = module_name.replace(os.sep, '.')

                    self._collected.setdefault(module_name, path)
dataset/ETHPy150Open adieu/django-mediagenerator/mediagenerator/filters/pyjs_filter.py/Pyjs._collect_all_modules/swapped operands of `%`