
    ̆h                       % S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSKJ	r	J
r
JrJrJrJr  SSKJr  SSKJr  SSKJr  SSKJrJrJrJrJrJr  SS	KJrJrJr  SS
KJ r   SSK!J"r"J#r#J$r$  \(       a  SSKJ%r%J&r&J'r'  SSK(J)r)J*r*J+r+  SSK,J-r-   " S S\SS9r. " S S\SS9r/ " S S\*\0   \+\0   \'5      r1\2\3\2\3\34   -  \2\3\44   -  S4   S-  r5S\6S'   \7\3S-  \54   \5-  r8S\6S'   \2\4\3\4\2\4S4   -  \9\4   \4S-  4   r:S\6S'   \2\3\4\2\4S4   -  \9\4   \4S-  4   r;S\6S'   \	\1\%\0   -  \\4\84   \
\4   \\4\4   /\\;   4   r<S\6S'   \<\4-  r=S\6S'   Sr>S \6S!'   SSS"SS"S#S$SS%S&S'.
r?S(\6S)'   S*/r@S+\6S,'   \A" \S-S5      rB\A" \S.S5      rC\A" \S/S5      rDS@S0 jrESAS1 jrFS\@S\?S2SSS4                 SBS3 jjrG SC                 SDS4 jjrH\?S2SS4             SES5 jjrI          SFS6 jrJ\" SS79SGS8 j5       rK\?S2SS4             SHS9 jjrL          SIS: jrM          SJS; jrNSKS< jrO SL           SMS= jjrP SL           SNS> jjrQ\M\N\PS?.rRg)Oa:  
babel.messages.extract
~~~~~~~~~~~~~~~~~~~~~~

Basic infrastructure for extracting localizable messages from source files.

This module defines an extensible system for collecting localizable message
strings from a variety of sources. A native extractor for Python source
files is builtin, extractors for other sources can be added using very
simple plugins.

The main entry points into the extraction functionality are the functions
`extract_from_dir` and `extract_from_file`.

:copyright: (c) 2013-2025 by the Babel Team.
:license: BSD, see LICENSE for more details.
    )annotationsN)Callable
Collection	GeneratorIterableMappingMutableSequence)	lru_cache)relpath)dedent)COMMENTNAMENLOPSTRINGgenerate_tokens)TYPE_CHECKINGAny	TypedDict)find_entrypoints)parse_encodingparse_future_flags	pathmatch)IOFinalProtocol)SupportsItemsSupportsReadSupportsReadline)	TypeAliasc                       \ rS rSr% S\S'   Srg)
_PyOptions0   strencoding N__name__
__module____qualname____firstlineno____annotations____static_attributes__r&       N/opt/services/DDDS/venv/lib/python3.13/site-packages/babel/messages/extract.pyr"   r"   0   s    r.   r"   F)totalc                  >    \ rS rSr% S\S'   S\S'   S\S'   S\S'   Srg	)

_JSOptions3   r$   r%   booljsxtemplate_stringparse_template_stringr&   Nr'   r&   r.   r/   r2   r2   3   s    	##r.   r2   c                  ,    \ rS rSrSSS jjrSS jrSrg)	_FileObj9   c                    g Nr&   )self_FileObj__offset_FileObj__whences      r/   seek_FileObj.seek:   s    3r.   c                    g r<   r&   )r=   s    r/   tell_FileObj.tell;   s    sr.   r&   N).)r>   intr?   rE   returnrE   )rF   rE   )r(   r)   r*   r+   r@   rC   r-   r&   r.   r/   r9   r9   9   s    F"r.   r9   .r    _SimpleKeyword_Keyword_FileExtractionResult_ExtractionResult_CallableExtractionMethod_ExtractionMethodzbabel.extractorsz
Final[str]
GROUP_NAME)      )rO   )rO      )rN   crO   )rQ   rO   rP   )
_gettextngettextugettext	ungettextdgettext	dngettextN_pgettext	npgettextzdict[str, _Keyword]DEFAULT_KEYWORDS)z**.pypythonzlist[tuple[str, str]]DEFAULT_MAPPINGFSTRING_STARTFSTRING_MIDDLEFSTRING_ENDc                2   ^ SU4S jjn[        X 5      U SS& g)zHelper function for `extract` that strips comment tags from strings
in a list of comment lines.  This functions operates in-place.
c                   > T H7  nU R                  U5      (       d  M  U [        U5      S  R                  5       s  $    U $ r<   )
startswithlenstrip)linetagtagss     r/   _strip#_strip_comment_tags.<locals>._stripj   s<    Cs##CHI,,..  r.   N)rh   r$   )map)commentsrj   rk   s    ` r/   _strip_comment_tagsro   f   s    
 f'HQKr.   c                    [         R                  R                  U 5      nUR                  S5      =(       d    UR                  S5      (       + $ )N.rS   )ospathbasenamere   )dirpathsubdirs     r/   default_directory_filterrw   r   s:    WWg&F!!#&@&*;*;C*@AAr.   r&   c              #  d  #    U c  [         R                  " 5       n Uc  0 nUc  [        n[         R                  R	                  U 5      n[         R
                  " U5       H  u  pnU
 Vs/ s H1  nU" [         R                  R                  X5      5      (       d  M/  UPM3     snU
SS& U
R                  5         UR                  5         U HX  n[         R                  R                  X5      R                  [         R                  S5      n[        UUUUUUUUS9 Sh  vN   MZ     M     gs  snf  N7f)a<  Extract messages from any source files found in the given directory.

This function generates tuples of the form ``(filename, lineno, message,
comments, context)``.

Which extraction method is used per file is determined by the `method_map`
parameter, which maps extended glob patterns to extraction method names.
For example, the following is the default mapping:

>>> method_map = [
...     ('**.py', 'python')
... ]

This basically says that files with the filename extension ".py" at any
level inside the directory should be processed by the "python" extraction
method. Files that don't match any of the mapping patterns are ignored. See
the documentation of the `pathmatch` function for details on the pattern
syntax.

The following extended mapping would also use the "genshi" extraction
method on any file in "templates" subdirectory:

>>> method_map = [
...     ('**/templates/**.*', 'genshi'),
...     ('**.py', 'python')
... ]

The dictionary provided by the optional `options_map` parameter augments
these mappings. It uses extended glob patterns as keys, and the values are
dictionaries mapping options names to option values (both strings).

The glob patterns of the `options_map` do not necessarily need to be the
same as those used in the method mapping. For example, while all files in
the ``templates`` folders in an application may be Genshi applications, the
options for those files may differ based on extension:

>>> options_map = {
...     '**/templates/**.txt': {
...         'template_class': 'genshi.template:TextTemplate',
...         'encoding': 'latin-1'
...     },
...     '**/templates/**.html': {
...         'include_attrs': ''
...     }
... }

:param dirname: the path to the directory to extract messages from.  If
                not given the current working directory is used.
:param method_map: a list of ``(pattern, method)`` tuples that maps of
                   extraction method names to extended glob patterns
:param options_map: a dictionary of additional options (optional)
:param keywords: a dictionary mapping keywords (i.e. names of functions
                 that should be recognized as translation functions) to
                 tuples that specify which of their arguments contain
                 localizable strings
:param comment_tags: a list of tags of translator comments to search for
                     and include in the results
:param callback: a function that is called for every file that message are
                 extracted from, just before the extraction itself is
                 performed; the function is passed the filename, the name
                 of the extraction method and and the options dictionary as
                 positional arguments, in that order
:param strip_comment_tags: a flag that if set to `True` causes all comment
                           tags to be removed from the collected comments.
:param directory_filter: a callback to determine whether a directory should
                         be recursed into. Receives the full directory path;
                         should return True if the directory is valid.
:see: `pathmatch`
N/)ru   )rr   getcwdrw   rs   abspathwalkjoinsortreplacesepcheck_and_call_extract_file)dirname
method_mapoptions_mapkeywordscomment_tagscallbackstrip_comment_tagsdirectory_filterabsnamerootdirnames	filenamesrv   filenamefilepaths                  r/   extract_from_dirr   x   s    ^ ))+3ggoog&G%'WWW%5!	!)
!)vT :; 
 	!Hww||D3;;BFFCHH2"	 	 	 " &6
	s%   A&D0(.D)D) A;D0D.D0c           
   #    #    [        X5      nU Hr  u  p[        X5      (       d  M  0 nUR                  5        H  u  p[        X5      (       d  M  Un  O   U(       a	  U" XU5        [        XUUUUS9 H  nU/UQ7v   M       g   g7f)a  Checks if the given file matches an extraction method mapping, and if so, calls extract_from_file.

Note that the extraction method mappings are based relative to dirpath.
So, given an absolute path to a file `filepath`, we want to check using
just the relative path from `dirpath` to `filepath`.

Yields 5-tuples (filename, lineno, messages, comments, context).

:param filepath: An absolute path to a file that exists.
:param method_map: a list of ``(pattern, method)`` tuples that maps of
                   extraction method names to extended glob patterns
:param options_map: a dictionary of additional options (optional)
:param callback: a function that is called for every file that message are
                 extracted from, just before the extraction itself is
                 performed; the function is passed the filename, the name
                 of the extraction method and and the options dictionary as
                 positional arguments, in that order
:param keywords: a dictionary mapping keywords (i.e. names of functions
                 that should be recognized as translation functions) to
                 tuples that specify which of their arguments contain
                 localizable strings
:param comment_tags: a list of tags of translator comments to search for
                     and include in the results
:param strip_comment_tags: a flag that if set to `True` causes all comment
                           tags to be removed from the collected comments.
:param dirpath: the path to the directory to extract messages from.
:return: iterable of 5-tuples (filename, lineno, messages, comments, context)
:rtype: Iterable[tuple[str, int, str|tuple[str], list[str], str|None]
)r   r   optionsr   N)r   r   itemsextract_from_file)r   r   r   r   r   r   r   ru   r   patternmethodr   opatternodictmessage_tuples                  r/   r   r      s     P x)H%++*002OH,,  3 Xw/.%1
M ,m,,
 	) &s   A
B7Bc                    U S:X  a  / $ [        US5       n[        [        XX#XE5      5      sSSS5        $ ! , (       d  f       g= f)a  Extract messages from a specific file.

This function returns a list of tuples of the form ``(lineno, message, comments, context)``.

:param filename: the path to the file to extract messages from
:param method: a string specifying the extraction method (.e.g. "python")
:param keywords: a dictionary mapping keywords (i.e. names of functions
                 that should be recognized as translation functions) to
                 tuples that specify which of their arguments contain
                 localizable strings
:param comment_tags: a list of translator tags to search for and include
                     in the results
:param strip_comment_tags: a flag that if set to `True` causes all comment
                           tags to be removed from the collected comments.
:param options: a dictionary of additional options (optional)
:returns: list of tuples of the form ``(lineno, message, comments, context)``
:rtype: list[tuple[int, str|tuple[str], list[str], str|None]
ignorerbN)openlistextract)r   r   r   r   r   r   fileobjs          r/   r   r   &  s?    4 		h	GFX#9 : 
		s	   5
Ac                   / nS n[        U5      nU HH  n[        U[        5      (       a  XS   S-
     nM$  Xx:  a    g XS-
     n	U	c    g UR                  U	5        MJ     [        US   [        5      (       a	  US   S-
  n
OUS   S-
  n
X   (       d<  [	        USS 5      =(       d    Sn[
        R                  R                  U SU  S35        g [        U5      n[        U5      S:X  a  US   nXX&4$ )Nr   rN   namez	(unknown):z: warning: Empty msgid.  It is reserved by GNU gettext: gettext("") returns the header entry with meta information, not the empty string.
)rf   
isinstancetupleappendgetattrsysstderrwrite)linenomessagesrn   r   spectranslatablecontext
last_indexindexmessagefirst_msg_indexr   s               r/   _match_messages_against_specr   H  s    LG XJeU##Qx!|,G19%?G$  $q'5!!q'A+q'A+$GVT2Ak

j& "V W	
 	&L
<A#A22r.   )maxsizec                P    [        [        5       H  u  pX:X  d  M  U" 5       s  $    g r<   )r   rM   )r   ep_nameloads      r/   _find_extractorr   v  s$    )*5?6M 6 r.   c           	   #    #    [        U 5      (       a  U nOSU ;   d  SU ;   aQ  SU ;  a  U R                  S5      nU SU XS-   S pOU R                  SS5      u  p[        [	        U0 0 U	/5      U	5      nO#[        U 5      nUc  [        R                  U 5      nUc  [        SU < 35      eU" XR                  5       UU=(       d    0 S9n
U
 H  u  pp[        U[        [        45      (       d  U/nU(       d  M-  U(       a  X,   =(       d    SOSn[        U[        5      (       d  SU0nU(       a  [        X5        S[        U5      4 H$  n UU   nUc  Sn[#        XXU5      nUc  M   Uv   M&     M     g! [          a     M:  f = f7f)a&  Extract messages from the given file-like object using the specified
extraction method.

This function returns tuples of the form ``(lineno, message, comments, context)``.

The implementation dispatches the actual extraction to plugins, based on the
value of the ``method`` parameter.

>>> source = b'''# foo module
... def run(argv):
...    print(_('Hello, world!'))
... '''

>>> from io import BytesIO
>>> for message in extract('python', BytesIO(source)):
...     print(message)
(3, u'Hello, world!', [], None)

:param method: an extraction method (a callable), or
               a string specifying the extraction method (.e.g. "python");
               if this is a simple name, the extraction function will be
               looked up by entry point; if it is an explicit reference
               to a function (of the form ``package.module:funcname`` or
               ``package.module.funcname``), the corresponding function
               will be imported and used
:param fileobj: the file-like object the messages should be extracted from
:param keywords: a dictionary mapping keywords (i.e. names of functions
                 that should be recognized as translation functions) to
                 tuples that specify which of their arguments contain
                 localizable strings
:param comment_tags: a list of translator tags to search for and include
                     in the results
:param options: a dictionary of additional options (optional)
:param strip_comment_tags: a flag that if set to `True` causes all comment
                           tags to be removed from the collected comments.
:raise ValueError: if the extraction method is not registered
:returns: iterable of tuples of the form ``(lineno, message, comments, context)``
:rtype: Iterable[tuple[int, str|tuple[str], list[str], str|None]
r   rq   NrN   zUnknown extraction method )r   rN   )callablerfindsplitr   
__import__r   _BUILTIN_EXTRACTORSget
ValueErrorkeysr   r   r   dictro   rf   KeyErrorr   )r   r   r   r   r   r   funclastdotmoduleattrnameresultsr   funcnamer   rn   specsarityr   results                      r/   r   r   ~  s    ^ 	#-fll3'G%hw/!1EH%||C3Fz&"b8*=xHv&< '**62D|5fZ@AA7MMO\"=b*G 18,((T5M22 zH.6"*dD%&&5ME7 CM*EU| |1&HW[\F! + 18$  s0   EFE1F$F1
E?;F>E??Fc                    / $ )z\Pseudo extractor that does not actually extract anything, but simply
returns an empty list.
r&   )r   r   r   r   s       r/   extract_nothingr     s	     Ir.   c           	   #    ^ ^#    S=n=pVSn/ n/ n	/ n
S=pSn[        T 5      =(       d    UR                  SS5      m[        T T5      nUU 4S jn[        U5      nSnU GHV  u  nnu  n    nUS:X  a  U[        :X  a
  US;   a  SnGOU[
        :X  a  US	:X  a  U(       a  SnMB  U(       a  US
-  nGOU(       a  U[
        :X  a
  US:X  a  SnMk  US:X  a  U[        :X  aw  US
S R                  5       nU(       a$  U
S   S   US
-
  :X  a  U
R                  UU45        M  U H1  nUR                  U5      (       d  M  SnU
R                  UU45          GOM   GOIU(       Ga  US:X  Ga  U[        :H  =(       a    UU;   nU[
        :X  a  US:X  d  U(       a  U(       a&  U	R                  SR                  U5      5        USS2	 OU	R                  S5        [        U	5      S
:  a  [        U	5      OU	S   n	U
(       a  U
S   S   US
-
  :  a  / n
XdU	U
 Vs/ s H  nUS
   PM
     sn4v   S=n=pVSn/ n	/ n
SnU(       a  UnGOfU[        :X  a,  [        UTU5      nUb  U(       d  UnUR                  U5        GO0U[        :X  a  UnU(       d  UnGOU[         :X  a
  Ub  UU-  nGOU["        :X  a*  Ub&  UU-   n[        UTU5      nUb  UR                  U5        OU[
        :X  au  US:X  ao  U(       a&  U	R                  SR                  U5      5        USS2	 OU	R                  S5        U
(       a)  U
R%                  5       u  nnU
R                  US
-   U45        ORU[&        :w  a	  U(       d  UnO>US:  a  U[
        :X  a  US:X  a  US
-  nO"U(       a	  US:X  a  SnOU[        :X  a  UU;   a  UnUc  GMA  U[        [         1;  d  GMT  SnGMY     gs  snf 7f)a7  Extract messages from Python source code.

It returns an iterator yielding tuples in the following form ``(lineno,
funcname, message, comments)``.

:param fileobj: the seekable, file-like object the messages should be
                extracted from
:param keywords: a list of keywords (i.e. function names) that should be
                 recognized as translation functions
:param comment_tags: a list of translator tags to search for and include
                     in the results
:param options: a dictionary of additional options (optional)
:rtype: ``iterator``
NFr%   zUTF-8c                 B   > TR                  5       R                  T 5      $ r<   )readlinedecode)r%   r   s   r/   <lambda> extract_python.<locals>.<lambda>  s    ((*11(;r.   )defclassT(rN   r   r   ) ,)r   r   r   r   r   r   r   rg   r   re   r}   rf   r   r   _parse_python_stringr`   ra   rb   popr   )r   r   r   r   r   r   message_lineno
call_stackbufr   translator_commentsin_defin_translator_commentscomment_tagfuture_flags	next_linetokenscurrent_fstring_starttokvaluerS   nestedcommentvalfstring
old_linenoold_commentr%   s   `                          @r/   extract_pythonr     s    ( *.-H-vJ
CH&++FKg&J'++j'*JH%gx8L;IY'F !)/%UKVQAt9I0IFBY5C< a
r	eslF2#.!"IOO%E%'+A.&1*<#**FE?;  ,##K00-1*'..?	  ,
 */Tk7ex&7Fr	eslvOOBGGCL1AOOD).1(ma.?5?Xa[ '+B/2^a5GG*,'%2EF2Ew
2EFH H 6:996
&(#).&$H*5(LI?))/JJsO %(-%%%+N&(4)U2)#(43e;G.w,OC

3u|OOBGGCL1AOOD)&
 /B.E.E.G+J'..
Q/LM>!'!^r	esl!OJ**HD[Uh.H ,]N<[1[
 %)!U *0^ Gs&   D+N>3CN>N9FN>N>1N>c                   [        S[        U5       SU  3SS[        R                  U-  5      n[	        U[        R
                  5      (       a  UR                  n[	        U[        R                  5      (       a  UR                  $ [	        U[        R                  5      (       aC  [        S UR                   5       5      (       a"  SR                  S UR                   5       5      $ g )Nz	# coding=
z<string>evalc              3  V   #    U  H  n[        U[        R                  5      v   M!     g 7fr<   )r   astConstant.0nodes     r/   	<genexpr>'_parse_python_string.<locals>.<genexpr>  s     Jkd:dCLL11ks   ')r   c              3  8   #    U  H  oR                   v   M     g 7fr<   )r   r   s     r/   r   r     s     Bkdzzks   )compiler$   r   PyCF_ONLY_ASTr   
Expressionbodyr   r   	JoinedStrallvaluesr}   )r   r%   r   coder  s        r/   r   r   }  s     
CM?"UG,L(	D $''yydCLL))::dCMM**JdkkJJJwwBdkkBBBr.   c           	   #  ,
  #    SSK JnJnJn  S=p/ n
Sn/ nSnUR	                  SS5      nSnSn[        S U 5       5      nU" U R                  5       R                  U5      UR	                  S	S
5      UR	                  SS
5      UUS9 GH  nU(       a\  U(       aU  UR                  S:X  aE  UR                  S:X  a5  UR                  n	U" UR                  5      /n
SnU" SSUR                  5      nUR	                  S5      (       aC  U(       d<  UR                  S:X  a,  [        UR                  XUUR                  5       Sh  vN   GOUR                  S:X  a*  UR                  S:X  a  U(       a  UR                  n	US-  nGOUS:X  a  UR                  S:X  a  UR                  SS R                  5       nU(       a9  US   S   UR                  S-
  :X  a   UR                  UR                  U45        GMm  U HG  nUR                  U5      (       d  M  UR                  UR                  UR                  5       45          GO   GOUR                  S:X  a  / nUR                  SS R                  5       nU H  nUR                  U5      (       d  M  UR                  5       nU(       ay  US   R                  5       US'   [!        SR#                  USS 5      5      R                  5       USS& [%        U5       H&  u  nnUR                  UR                  U-   U45        M(       GO   GOU(       GaE  US:X  Ga>  UR                  S:X  a  UR                  S:X  a  Ub  U
R                  U5        ['        U
5      S:  a  [)        U
5      n
OU
(       a  U
S   n
OSn
U(       a  US   S   U	S-
  :  a  / nU
b  XU
U Vs/ s H  nUS   PM
     sn4v   S=n=pSn/ n/ n
SnGO,UR                  S;   a-  U" UR                  5      nU(       a  U=(       d    SU-   nSnOUnOUR                  S:X  aM  UR                  S:X  a+  Ub  U
R                  U5        SnOU
R                  S5        SnOUR                  S:X  a  S
nOUS:  a&  UR                  S:X  a  UR                  S:X  a  US-  nOeU(       a	  US:X  a  SnOUUS:X  aO  UR                  S:X  a?  UR                  U;   a/  Ub   UR                  S:w  d  UR                  S:w  a  UR                  nUnGM     g GNs  snf 7f)a~  Extract messages from JavaScript source code.

:param fileobj: the seekable, file-like object the messages should be
                extracted from
:param keywords: a list of keywords (i.e. function names) that should be
                 recognized as translation functions
:param comment_tags: a list of translator tags to search for and include
                     in the results
:param options: a dictionary of additional options (optional)
                Supported options are:
                * `jsx` -- set to false to disable JSX/E4X support.
                * `template_string` -- if `True`, supports gettext(`key`)
                * `parse_template_string` -- if `True` will parse the
                                             contents of javascript
                                             template strings.
:param lineno: line number offset (for parsing embedded fragments)
r   )Tokentokenizeunquote_stringNFr%   zutf-8r   c              3  ,   #    U  H
  nS U;   v   M     g7f)rq   Nr&   )r   kws     r/   r   %extract_javascript.<locals>.<genexpr>  s     .XrXs   r5   Tr6   )r5   r6   dottedr   r   operatorr   r7   r   rN   linecommentrO   multilinecommentr   )stringr6   r   r   +function)babel.messages.jslexerr	  r
  r  r   anyreadr   typer   r   r7   rg   r   re   
splitlinesr   r}   	enumeraterf   r   )r   r   r   r   r   r	  r
  r  r   r   r   last_argumentr   concatenate_nextr%   
last_tokenr   r  tokenr   r   linesoffsetrh   r   	new_values                             r/   extract_javascriptr$    s    0 GF $$HHM{{:w/HJJ.X..Fh'KKt$$5t< JOOv5JJ++"\\N&u{{34HJ*c5<<8E;;.//UZZSdEd,U[[(RY[`[g[ghhhZZ:%%++*<!&a
2%**"=KKO))+E""2&q)U\\A-==#**ELL%+@A+##K00'..ekkm/LM  ,
 ZZ--"$KK"%++-E+##K00!,,.E#(8>>#3a$*499U12Y+?$@$K$K$Mab	,5e,<LFD/66v8M8<8> ? -=   , */zzZ'EKK3,> ,OOM2x=1$$XH'{H#H '&r*1-0BB*,'')X6IJ6I7GAJ6IJL L =A@@>#( &(#
<<*5;;7	#%2%8bI$EM',$$-Mz);;#%$0 6(, -',$[[C''+$!^

j 8KK3&!OJ**H2%**"6KK8#:??f#<+{{H
_$ ij Ks4   D>T TCTA:TD%T4TE
TTc              #    #    SSK Jn  SnSnSnSn	U SS  H  n
U(       d	  U
S;   a  U
nOX:X  a  US	:w  a  SnU(       a  X-  n	U(       d  U
S
:X  a  US:X  a  US-  nO|U(       au  U
S:X  ao  US-  nUS:X  ad  U	(       a]  U	SS n	[        R                  " U	R	                  5       5      n[        XX#U5       Sh  vN   U[        UR                  U	5      5      -  nSn	U
nM     g N*7f)a  Parse JavaScript template string.

:param template_string: the template string to be parsed
:param keywords: a list of keywords (i.e. function names) that should be
                 recognized as translation functions
:param comment_tags: a list of translator tags to search for and include
                     in the results
:param options: a dictionary of additional options (optional)
:param lineno: starting line number (optional)
r   )line_reNFr   rN   r   )"'`z\\{$})r  r&  ioBytesIOencoder$  rf   findall)r6   r   r   r   r   r&  prev_characterlevel
inside_strexpression_contents	characterfake_file_objs               r/   r7   r7   %  s     " /NEJ$Qr*	i?:"J$5)@J,CNc$9
9+
A:"5*=a*C'$&JJ/B/I/I/K$LM1-<bhiiic'//2E"FGGF*,'"% + js   B0C2C3+C)r   r^   
javascript)rn   zMutableSequence[str]rj   zIterable[str])ru   str | os.PathLike[str]rF   r4   )r   str | os.PathLike[str] | Noner   Iterable[tuple[str, str]]r   z)SupportsItems[str, dict[str, Any]] | Noner   Mapping[str, _Keyword]r   Collection[str]r   3Callable[[str, str, dict[str, Any]], object] | Noner   r4   r   zCallable[[str], bool] | NonerF   ,Generator[_FileExtractionResult, None, None]r<   )r   r8  r   r:  r   z"SupportsItems[str, dict[str, Any]]r   r=  r   r;  r   r<  r   r4   ru   r9  rF   r>  )r   rL   r   r8  r   r;  r   r<  r   Mapping[str, Any] | Noner   r4   rF   list[_ExtractionResult])
r   rE   r   zlist[str | None]rn   z	list[str]r   r9   r   z!tuple[int | tuple[int, str], ...])r   r$   )r   rL   r   r9   r   r;  r   r<  r   r?  r   r4   rF   (Generator[_ExtractionResult, None, None])
r   r9   r   r;  r   r<  r   zMapping[str, Any]rF   r@  )
r   z	IO[bytes]r   r;  r   r<  r   r"   rF   rA  )r   r$   r%   r$   r   rE   rF   z
str | Noner   )r   r9   r   r;  r   r<  r   r2   r   rE   rF   rA  )r6   r$   r   r;  r   r<  r   r2   r   rE   rF   rA  )S__doc__
__future__r   r   r-  rr   r   r
  collections.abcr   r   r   r   r   r	   	functoolsr
   os.pathr   textwrapr   r   r   r   r   r   r   typingr   r   r   babel.messages._compatr   
babel.utilr   r   r   r   r   r   	_typeshedr   r   r   typing_extensionsr    r"   r2   bytesr9   r   rE   r$   rG   r,   r   rH   r   rI   rJ   rK   rL   rM   r]   r_   r   r`   ra   rb   ro   rw   r   r   r   r   r   r   r   r   r   r$  r7   r   r&   r.   r/   <module>rN     s'  " # 
 	 	 
       C C 0 0 3 D D**GG+Ye $Ye $#<&(8(? # !&cE#s(O&;eCHo&Ms&R SVZ ZNIZsTz>9:^KHiK (-S#sU38_7LdSViY\_cYc-c'd9d $)cE#s(O.CT#YPSVZPZ)Z#[y[ ,4	BuI	wsH}5z#PSUXPXHYZ"#	%,y 
 $=s#ByB+
J + 

!) %  +>)>& > /48#3T:ht4	(B .2,;=A'7$&DH$59j*j)j ;j %	j
 "j Bj j 3j 2jj .2>$>)> 4> B	>
 %> "> > +> 2>H (8$&(,$::$: %: "	:
 &: : :D+3+3+3 +3 	+3
 ,+3\ 4  (8$&(,$]]] %] "	]
 &] ] .]@		$	 "	 		
 	P)P)$P) "P) 	P)
 .P)f2 QQ$Q "Q 	Q
 Q .Qr (#(#$(# "(# 	(#
 (# .(#X $ r.   