MCPcopy Index your code
hub / github.com/mne-tools/mne-python / _ensure_copyright

Function _ensure_copyright

tools/dev/ensure_headers.py:147–161  ·  view source on GitHub ↗
(lines, path)

Source from the content-addressed store, hash-verified

145
146
147def _ensure_copyright(lines, path):
148 n_expected = {
149 "mne/preprocessing/_csd.py": 2,
150 "mne/transforms.py": 2,
151 }
152 n_copyright = sum(line.startswith(COPYRIGHT_STARTS) for line in lines)
153 assert n_copyright <= n_expected.get(str(path), 1), n_copyright
154 insert = lines.index(LICENSE_LINE) + 1
155 if lines[insert].startswith(COPYRIGHT_STARTS):
156 lines[insert] = COPYRIGHT_LINE
157 else:
158 lines.insert(insert, COPYRIGHT_LINE)
159 assert lines.count(COPYRIGHT_LINE) == 1, (
160 f"{lines.count(COPYRIGHT_LINE)=} for {path=}"
161 )
162
163
164def _ensure_blank(lines, path):

Callers 1

ensure_headers.pyFile · 0.85

Calls 2

insertMethod · 0.80
countMethod · 0.80

Tested by

no test coverage detected