<s> from common import SushiError , read_all_text <EOL> def parse_scxvid_keyframes ( text ) : <EOL> return [ i - <NUM_LIT:3> for i , line in enumerate ( text . splitlines ( ) ) if line and line [ <NUM_LIT:0> ] == '<STR_LIT:i>' ] <EOL> def parse_keyframes ( path ) : <EOL> text = read_all_text ( path ) <EOL> if text . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> frames = parse_scxvid_keyframes ( text ) <EOL> else : <EOL> raise SushiError ( '<STR_LIT>' ) <EOL> if <NUM_LIT:0> not in frames : <EOL> frames . insert ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> return frames </s>
