MCPcopy
hub / github.com/mne-tools/mne-python / get_author_idx

Function get_author_idx

tools/dev/ensure_headers.py:73–77  ·  view source on GitHub ↗

Get the index of the author line, if available.

(path, lines)

Source from the content-addressed store, hash-verified

71
72
73def get_author_idx(path, lines):
74 """Get the index of the author line, if available."""
75 author_idx = np.where([AUTHOR_RE.match(line) is not None for line in lines])[0]
76 assert len(author_idx) <= 1, f"{len(author_idx)=} for {path=}"
77 return author_idx[0] if len(author_idx) else None
78
79
80def get_license_idx(path, lines):

Callers 2

_ensure_authorFunction · 0.85
_ensure_licenseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected