def create_index(file_path, index_path, index_ratio, index_width):
i = <NUM_LIT:0><EOL>with file_path.open() as f:<EOL><INDENT>with index_path.open("<STR_LIT:wb>") as idx:<EOL><INDENT>idx.write(index_ratio.to_bytes(<NUM_LIT:1>, byteorder="<STR_LIT>"))<EOL>idx.write(index_width.to_bytes(<NUM_LIT:1>, byteorder="<STR_LIT>"))<EOL>idx.write((<NUM_LIT:0>).to_bytes(<NUM_LIT:32>, byteorder="<STR_LIT>"))  <EOL>idx.write((<NUM_LIT:0>).to_bytes(index_width, byteorder="<STR_LIT>"))<EOL>while f.readline():<EOL><INDENT>i += <NUM_LIT:1><EOL>if (i % index_ratio) == <NUM_LIT:0>:<EOL><INDENT>pointer = f.tell()<EOL>b = pointer.to_bytes(index_width, byteorder="<STR_LIT>")<EOL>idx.write(b)<EOL><DEDENT><DEDENT>idx.seek(<NUM_LIT:2>)<EOL>idx.write(i.to_bytes(<NUM_LIT:32>, byteorder="<STR_LIT>"))<EOL><DEDENT>t = file_path.stat().st_mtime<EOL>os.utime(str(index_path), (t, t))<EOL><DEDENT>
Index format:
    1st byte: index_ratio
    2nd byte: index_width
    3rd byte: line_count