Ë
    äØjjª  ã                   ó¬   — d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
 	 	 	 ddee   ded	ed
edee   f
d„Zddeee      ddfd„Zedk(  r e«        yy)a  
Script which takes one or more file paths and reports on their detected
encodings

Example::

    % chardetect somefile someotherfile
    somefile: windows-1252 with confidence 0.5
    someotherfile: ascii with confidence 1.0

If no paths are provided, it takes its input from stdin.

é    N)ÚIterableÚListÚOptionalé   )Ú__version__)ÚUniversalDetectorÚlinesÚnameÚminimalÚshould_rename_legacyÚreturnc                 óö   — t        |¬«      }| D ],  }t        |«      }|j                  |«       |j                  sŒ, n |j	                  «        |j
                  }|r|d   S |d   r|› d|d   › d|d   › �S |› d�S )a°  
    Return a string describing the probable encoding of a file or
    list of strings.

    :param lines: The lines to get the encoding of.
    :type lines: Iterable of bytes
    :param name: Name of file or collection of lines
    :type name: str
    :param should_rename_legacy:  Should we rename legacy encodings to
                                  their more modern equivalents?
    :type should_rename_legacy:   ``bool``
    )r   Úencodingz: z with confidence Ú
confidencez: no result)r   Ú	bytearrayÚfeedÚdoneÚcloseÚresult)r	   r
   r   r   ÚuÚliner   s          úd/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/pip/_vendor/chardet/cli/chardetect.pyÚdescription_ofr      s—   € ô$ 	Ð/CÔD€AØò ˆÜ˜‹ˆØ	�‰ˆtŒà�6‹6Ùðð ‡G�G„IØ�X‰X€FÙØ�jÑ!Ð!ØˆjÒØ��r˜& Ñ,Ð-Ð->¸vÀlÑ?SÐ>TÐUÐUØˆV�;ÐÐó    Úargvc           	      óB  — t        j                  d¬«      }|j                  ddt        j                  d«      dt        j
                  j                  g¬«       |j                  dd	d
¬«       |j                  dddd
¬«       |j                  dddt        › �¬«       |j                  | «      }|j                  D ]c  }|j                  «       rt        dt        j                  ¬«       t        t        ||j                  |j                  |j                   ¬«      «       Œe y)zã
    Handles command line arguments and gets things started.

    :param argv: List of arguments, as if specified on the command-line.
                 If None, ``sys.argv[1:]`` is used instead.
    :type argv: list of str
    zATakes one or more file paths and reports their detected encodings)ÚdescriptionÚinputz@File whose encoding we would like to determine. (default: stdin)ÚrbÚ*)ÚhelpÚtypeÚnargsÚdefaultz	--minimalz*Print only the encoding to standard outputÚ
store_true)r!   Úactionz-lz--legacyz,Rename legacy encodings to more modern ones.z	--versionÚversionz	%(prog)s )r&   r'   z£You are running chardetect interactively. Press CTRL-D twice at the start of a blank line to signal the end of your input. If you want help, run chardetect --help
)Úfile)r   r   N)ÚargparseÚArgumentParserÚadd_argumentÚFileTypeÚsysÚstdinÚbufferr   Ú
parse_argsr   ÚisattyÚprintÚstderrr   r
   r   Úlegacy)r   ÚparserÚargsÚfs       r   Úmainr8   :   s   € ô ×$Ñ$àOô€Fð
 ×ÑØØOÜ×Ñ˜tÓ$ØÜ—‘×!Ñ!Ð"ð ô ð ×ÑØØ9Øð ô ð
 ×ÑØØØ;Øð	 ô ð ×ÑØ˜I°¼;¸-Ð/Hð ô ð ×Ñ˜TÓ"€Dà�Z‰Zò 
ˆØ�8‰8Œ:Üðô —Z‘Zõô 	ÜØ�1—6‘6 4§<¡<ÀdÇkÁkôõ	
ñ
r   Ú__main__)r.   FF)N)Ú__doc__r)   r-   Útypingr   r   r   Ú r   Úuniversaldetectorr   ÚbytesÚstrÚboolr   r8   Ú__name__© r   r   ú<module>rC      s–   ðñó Û 
ß +Ñ +å Ý 1ð
 ØØ!&ñ	 Ø�E‰?ð à
ð ð ð ð ð	 ð
 ˆc�]ó ñD2
ˆx˜˜S™	Ñ"ð 2
¨dó 2
ðj ˆzÒÙ…Fð r   