Re6ddlZddlmZGddeZdS)N) MachineStatecFeZdZdZdZdZdZdZdZe dZ dS) CodingStateMachinea A state machine to verify a byte sequence for a particular encoding. For each byte the detector receives, it will feed that byte to every active state machine available, one byte at a time. The state machine changes its state based on its previous state and the byte it receives. There are 3 states in a state machine that are of interest to an auto-detector: START state: This is the state to start with, or a legal byte sequence (i.e. a valid code point) for character has been identified. ME state: This indicates that the state machine identified a byte sequence that is specific to the charset it is designed for and that there is no other possible encoding which can contain this byte sequence. This will to lead to an immediate positive answer for the detector. ERROR state: This indicates the state machine identified an illegal byte sequence for that encoding. This will lead to an immediate negative answer for this encoding. Detector will exclude this encoding from consideration from here on. c||_d|_d|_d|_t jt |_|dS)Nr) _model_curr_byte_pos_curr_char_len _curr_statelogging getLogger__name__loggerreset)selfsms /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/chardet/codingstatemachine.py__init__zCodingStateMachine.__init__7sD '11  c(tj|_dSN)rSTARTr rs rrzCodingStateMachine.reset?s'-rc|jd|}|jtjkrd|_|jd||_|j|jdz|z}|jd||_|xjdz c_|jS)N class_tablerchar_len_table class_factor state_tabler)rr rrr r )rc byte_class curr_states r next_statezCodingStateMachine.next_stateBs[/2  |1 1 1"#D "&+.>"? "KD &^)DD"# ;}5jA q rc|jSr)r rs rget_current_charlenz&CodingStateMachine.get_current_charlenPs ""rc|jdS)Nnamerrs rget_coding_state_machinez+CodingStateMachine.get_coding_state_machineSs{6""rc|jdS)Nlanguager'rs rr*zCodingStateMachine.languageVs{:&&rN) r __module__ __qualname____doc__rrr"r$r(propertyr*rrrr!s*...    ######''X'''rr)r enumsrobjectrr/rrr2sV87'7'7'7'7'7'7'7'7'7'r