@classmethod<EOL><INDENT>def _parse_cod_segment(cls, fptr):<DEDENT>
offset = fptr.tell() - <NUM_LIT:2><EOL>read_buffer = fptr.read(<NUM_LIT:2>)<EOL>length, = struct.unpack('<STR_LIT>', read_buffer)<EOL>read_buffer = fptr.read(length - <NUM_LIT:2>)<EOL>lst = struct.unpack_from('<STR_LIT>', read_buffer, offset=<NUM_LIT:0>)<EOL>scod, prog, nlayers, mct, nr, xcb, ycb, cstyle, xform = lst<EOL>if len(read_buffer) > <NUM_LIT:10>:<EOL><INDENT>precinct_size = _parse_precinct_size(read_buffer[<NUM_LIT:10>:])<EOL><DEDENT>else:<EOL><INDENT>precinct_size = None<EOL><DEDENT>sop = (scod & <NUM_LIT:2>) > <NUM_LIT:0><EOL>eph = (scod & <NUM_LIT:4>) > <NUM_LIT:0><EOL>if sop or eph:<EOL><INDENT>cls._parse_tpart_flag = True<EOL><DEDENT>else:<EOL><INDENT>cls._parse_tpart_flag = False<EOL><DEDENT>pargs = (scod, prog, nlayers, mct, nr, xcb, ycb, cstyle, xform,<EOL>precinct_size)<EOL>return CODsegment(*pargs, length=length, offset=offset)<EOL>
Parse the COD segment.

        Parameters
        ----------
        fptr : file
            Open file object.

        Returns
        -------
        CODSegment
            The current COD segment.