def _regenerate(self, dev_mode=False):
        # This function is only called in only_dependencies mode
        if self._compiled:
            for module_name, (mtime, content, hash) in self._compiled.items():
                if module_name not in self._collected or \
                        not os.path.exists(self._collected[module_name]) or \
                        os.path.getmtime(self._collected[module_name]) != mtime:
                    # Just recompile everything
                    # TODO: track dependencies and changes and recompile only
                    # what's necessary
                    self._compiled = {}
                    break
            else:
                # No changes
                return

        modules = [self.main_module, 'pyjslib']
        while True:
            if not modules:
                break

            module_name = modules.pop()
            path = self._collected[module_name]
            mtime = os.path.getmtime(path)

            source = read_text_file(path)

            try:
                content, py_deps, js_deps = self._compile(module_name, source, dev_mode=dev_mode)
            except:
                self._compiled = {}
                raise
            hash = sha1(smart_str(content)).hexdigest()
            self._compiled[module_name] = (mtime, content, hash)

            for name in py_deps:
                if name not in self._collected:
                    if name in '.' and name.rsplit('.', 1)[0] in self._collected:
                        name = name.rsplit('.', 1)[0]
                    else:
                        raise ImportError('The pyjs module %s could not find '
                            'the dependency %s' % (module_name, name))
                if name not in self._compiled:
                    modules.append(name)
dataset/ETHPy150Open adieu/django-mediagenerator/mediagenerator/filters/pyjs_filter.py/Pyjs._regenerate/swapped operands of `in`