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

Function get_header_bash

scripts/replace_copyright.py:131–148  ·  view source on GitHub ↗
(fp)

Source from the content-addressed store, hash-verified

129
130
131def get_header_bash(fp):
132 with open(fp, "r") as f:
133 lines = iter(l for l in f.readlines())
134
135 header = []
136 rest = []
137
138 while (l := next(lines, None)) is not None:
139 l = l.strip()
140 if not l.startswith(BASH_SL_COMMENT) or l.isspace():
141 # Not in a comment
142 rest += [l + "\n"]
143 break
144 header.append(l)
145
146 rest += list(lines)
147
148 return header, rest
149
150
151def remove_comments(line, comment_strs):

Callers 1

mainFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…