MCPcopy
hub / github.com/deepspeedai/DeepSpeed / main

Function main

scripts/replace_copyright.py:209–230  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

207
208
209def main(args):
210 preserve_text_store = {} # Used to track header comments we should preserve
211 for root, dirs, fnames in os.walk(args.repo_dir):
212 # Walk across directory looking for all files with extensions we want to modify
213 for ext in args.python_style_ext:
214 fpaths = [os.path.join(root, fn) for fn in fnames if fn.endswith(ext)]
215 for fp in fpaths:
216 file_header, rest_of_file = get_header_py(fp)
217 preserve_text_store = modify_file_header(fp, file_header, rest_of_file, preserve_text_store,
218 PY_COMMENTS)
219 for ext in args.c_style_ext:
220 fpaths = [os.path.join(root, fn) for fn in fnames if fn.endswith(ext)]
221 for fp in fpaths:
222 file_header, rest_of_file = get_header_c(fp)
223 preserve_text_store = modify_file_header(fp, file_header, rest_of_file, preserve_text_store,
224 C_COMMENTS)
225 for ext in args.bash_style_ext:
226 fpaths = [os.path.join(root, fn) for fn in fnames if fn.endswith(ext)]
227 for fp in fpaths:
228 file_header, rest_of_file = get_header_bash(fp)
229 preserve_text_store = modify_file_header(fp, file_header, rest_of_file, preserve_text_store,
230 BASH_COMMENTS)
231
232
233if __name__ == "__main__":

Callers 1

Calls 4

get_header_pyFunction · 0.85
modify_file_headerFunction · 0.85
get_header_cFunction · 0.85
get_header_bashFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…