MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / valid_header

Method valid_header

scenedetect/stats_manager.py:206–217  ·  view source on GitHub ↗

Check that the given CSV row is a valid header for a statsfile. Arguments: row: A row decoded from the CSV reader. Returns: True if `row` is a valid statsfile header, False otherwise.

(row: list[str])

Source from the content-addressed store, hash-verified

204
205 @staticmethod
206 def valid_header(row: list[str]) -> bool:
207 """Check that the given CSV row is a valid header for a statsfile.
208
209 Arguments:
210 row: A row decoded from the CSV reader.
211
212 Returns:
213 True if `row` is a valid statsfile header, False otherwise.
214 """
215 if not row or not len(row) >= 2:
216 return False
217 return not (row[0] != COLUMN_NAME_FRAME_NUMBER or row[1] != COLUMN_NAME_TIMECODE)
218
219 # TODO(v1.0): Create a replacement for a calculation cache that functions like load_from_csv
220 # did, but is better integrated with detectors for cached calculations instead of statistics.

Callers 1

load_from_csvMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected