MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / check_copies

Function check_copies

diffusers/utils/check_copies.py:198–210  ·  view source on GitHub ↗
(overwrite: bool = False)

Source from the content-addressed store, hash-verified

196
197
198def check_copies(overwrite: bool = False):
199 all_files = glob.glob(os.path.join(DIFFUSERS_PATH, "**/*.py"), recursive=True)
200 diffs = []
201 for filename in all_files:
202 new_diffs = is_copy_consistent(filename, overwrite)
203 diffs += [f"- {filename}: copy does not match {d[0]} at line {d[1]}" for d in new_diffs]
204 if not overwrite and len(diffs) > 0:
205 diff = "\n".join(diffs)
206 raise Exception(
207 "Found the following copy inconsistencies:\n"
208 + diff
209 + "\nRun `make fix-copies` or `python utils/check_copies.py --fix_and_overwrite` to fix them."
210 )
211
212
213if __name__ == "__main__":

Callers 1

check_copies.pyFile · 0.85

Calls 1

is_copy_consistentFunction · 0.85

Tested by

no test coverage detected