(lines, path)
| 145 | |
| 146 | |
| 147 | def _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 | |
| 164 | def _ensure_blank(lines, path): |
no test coverage detected