def METHOD_NAME(self, resources, changes, factory_name, global_, job_set):
    if global_:
        replacement = "__rope_factory_%s_" % factory_name
    else:
        replacement = self._new_function_name(factory_name, global_)
    for file_ in resources:
        job_set.started_job(file_.path)
        if file_ == self.resource:
            self._change_resource(changes, factory_name, global_)
            job_set.finished_job()
            continue
        changed_code = self._rename_occurrences(file_, replacement, global_)
        if changed_code is not None:
            if global_:
                new_pymodule = libutils.get_string_module(
                    self.project, changed_code, self.resource
                )
                modname = libutils.modname(self.resource)
                changed_code, imported = importutils.add_import(
                    self.project, new_pymodule, modname, factory_name
                )
                changed_code = changed_code.replace(replacement, imported)
            changes.add_change(ChangeContents(file_, changed_code))
        job_set.finished_job()