+
    Cir                    J   ^ RI Ht ^ RIHt ^ RIt^ RIHtHtHtH	t	H
t
HtHtHtHtHtHt ^ RIt^ RIHt ^ RIHtHtHtHtHt ^ RIHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'  ! R R	](4      t) ! R
 R](4      t* ! R R]*4      t+ ! R R]*4      t, ! R R]*4      t- ! R R])4      t.R# )    )annotations)defaultdictN)AnyCallablecastDictIteratorIterableListOptionalSequenceTypeUnion)_deprecated)AttributeDictNavigableStringPageElement	ResultSetTag)_AtMostOneElement_AttributeValue_NullableStringMatchFunction_OneElement_PageElementMatchFunction_QueryResults_RawAttributeValues_RegularExpressionProtocol_StrainableAttribute_StrainableElement_StrainableString_StringMatchFunction_TagMatchFunctionc                      ] tR t^,t$ RtR]R&   RR R llt]R R l4       t]R	 R
 l4       t	RR R llt
R R ltR R ltRR R lltR R ltR R ltRtR# )ElementFiltera  `ElementFilter` encapsulates the logic necessary to decide:

1. whether a `PageElement` (a `Tag` or a `NavigableString`) matches a
user-specified query.

2. whether a given sequence of markup found during initial parsing
should be turned into a `PageElement` at all, or simply discarded.

The base class is the simplest `ElementFilter`. By default, it
matches everything and allows all markup to become `PageElement`
objects. You can make it more selective by passing in a
user-defined match function, or defining a subclass.

Most users of Beautiful Soup will never need to use
`ElementFilter`, or its more capable subclass
`SoupStrainer`. Instead, they will use methods like
:py:meth:`Tag.find`, which will convert their arguments into
`SoupStrainer` objects and run them against the tree.

However, if you find yourself wanting to treat the arguments to
Beautiful Soup's find_*() methods as first-class objects, those
objects will be `SoupStrainer` objects. You can create them
yourself and then make use of functions like
`ElementFilter.filter()`.
#Optional[_PageElementMatchFunction]match_functionNc                   V ^8  d   QhRR/# )   r&   r%    )formats   ",/usr/lib/python3/dist-packages/bs4/filter.py__annotate__ElementFilter.__annotate__I   s     - -'J -    c                    Wn         R# )zPass in a match function to easily customize the behavior of
`ElementFilter.match` without needing to subclass.

:param match_function: A function that takes a `PageElement`
  and returns `True` if that `PageElement` matches some criteria.
Nr&   )selfr&   s   &&r+   __init__ElementFilter.__init__I   s
     -r.   c                   V ^8  d   QhRR/# r(   returnboolr)   )r*   s   "r+   r,   r-   S   s     ' 'T 'r.   c                $    V P                   '       * # )a  Does this `ElementFilter` obviously include everything? If so,
the filter process can be made much faster.

The `ElementFilter` might turn out to include everything even
if this returns `False`, but it won't include everything in an
obvious way.

The base `ElementFilter` implementation includes things based on
the match function, so includes_everything is only true if
there is no match function.
r0   r1   s   &r+   includes_everything!ElementFilter.includes_everythingR   s     &&&&r.   c                   V ^8  d   QhRR/# r5   r)   )r*   s   "r+   r,   r-   b   s      T r.   c                    R# )a  Does this `ElementFilter` obviously exclude everything? If
so, Beautiful Soup will issue a warning if you try to use it
when parsing a document.

The `ElementFilter` might turn out to exclude everything even
if this returns `False`, but it won't exclude everything in an
obvious way.

The base `ElementFilter` implementation excludes things based
on a match function we can't inspect, so excludes_everything
is always false.
Fr)   r9   s   &r+   excludes_everything!ElementFilter.excludes_everythinga   s     r.   c               $    V ^8  d   QhRRRRRR/# r(   elementr   _known_rulesr7   r6   r)   )r*   s   "r+   r,   r-   q   s!     , ,[ ,t ,d ,r.   c                    V'       g   V P                   '       d   R# V P                  '       g   R# V P                  V4      # )a=  Does the given PageElement match the rules set down by this
ElementFilter?

The base implementation delegates to the function passed in to
the constructor.

:param _known_rules: Defined for compatibility with
    SoupStrainer._match(). Used more for consistency than because
    we need the performance optimization.
T)r:   r&   r1   rB   rC   s   &&&r+   matchElementFilter.matchq   s5      8 8 8"""""7++r.   c                    V ^8  d   QhRRRR/# )r(   	generatorIterator[PageElement]r6   zIterator[_OneElement]r)   )r*   s   "r+   r,   r-      s     1 1 5 1:O 1r.   c              #     "   V P                   '       d   T Rj  xL
    \        V4      pT'       g   K  T P                  TRR7      '       g   K2  \	        RT4      x  KB   LF  \         d     R# i ; i5i)zThe most generic search method offered by Beautiful Soup.

Acts like Python's built-in `filter`, using
`ElementFilter.match` as the filtering function.
NT)rC   r   )r:   nextStopIterationrF   r   )r1   rI   is   && r+   filterElementFilter.filter   sl      ###   O q::ad:33}a00 ! ! s<   A5A!A5A# A5A5A5#A2.A51A22A5c                    V ^8  d   QhRRRR/# )r(   rI   rJ   r6   r   r)   )r*   s   "r+   r,   r-      s      3 8I r.   c                :    V P                  V4       F  pVu # 	  R# )a  A lower-level equivalent of :py:meth:`Tag.find`.

You can pass in your own generator for iterating over
`PageElement` objects. The first one that matches this
`ElementFilter` will be returned.

:param generator: A way of iterating over `PageElement`
    objects.
N)rO   )r1   rI   rF   s   && r+   findElementFilter.find   s     [[+EL ,r.   c               $    V ^8  d   QhRRRRRR/# )r(   rI   rJ   limitzOptional[int]r6   r   r)   )r*   s   "r+   r,   r-      s$     ( (.(7D(	(r.   c                    . pV P                  V4       F,  pVP                  V4       Vf   K  \        V4      V8  g   K,   M	  \        W4      # )ac  A lower-level equivalent of :py:meth:`Tag.find_all`.

You can pass in your own generator for iterating over
`PageElement` objects. Only elements that match this
`ElementFilter` will be returned in the :py:class:`ResultSet`.

:param generator: A way of iterating over `PageElement`
    objects.

:param limit: Stop looking after finding this many results.
)rO   appendlenr   )r1   rI   rV   resultsrF   s   &&&  r+   find_allElementFilter.find_all   sI     [[+ENN5! S\U%: , ''r.   c               (    V ^8  d   QhRRRRRRRR/# 	r(   nsprefixOptional[str]namestrattrsOptional[_RawAttributeValues]r6   r7   r)   )r*   s   "r+   r,   r-      s,      %-09V	r.   c                    R# )a*  Based on the name and attributes of a tag, see whether this
`ElementFilter` will allow a `Tag` object to even be created.

By default, all tags are parsed. To change this, subclass
`ElementFilter`.

:param name: The name of the prospective tag.
:param attrs: The attributes of the prospective tag.
Tr)   )r1   r_   ra   rc   s   &&&&r+   allow_tag_creation ElementFilter.allow_tag_creation   s     r.   c                    V ^8  d   QhRRRR/# r(   stringrb   r6   r7   r)   )r*   s   "r+   r,   r-      s     
 
C 
D 
r.   c                    R# )a;  Based on the content of a string, see whether this
`ElementFilter` will allow a `NavigableString` object based on
this string to be added to the parse tree.

By default, all strings are processed into `NavigableString`
objects. To change this, subclass `ElementFilter`.

:param str: The string under consideration.
Tr)   r1   rj   s   &&r+   allow_string_creation#ElementFilter.allow_string_creation   s     r.   r0   NF)__name__
__module____qualname____firstlineno____doc____annotations__r2   propertyr:   r>   rF   rO   rS   r[   rf   rm   __static_attributes__r)   r.   r+   r$   r$   ,   s_    4 87- ' '  ,"1&(*
 
r.   r$   c                      ] tR t^t$ RtR]R&   R]R&   R]R&   R]R&   RR
 R lltR R ltR R ltR R lt	R R lt
RtR	# )	MatchRulezuEach MatchRule encapsulates the logic behind a single argument
passed in to one of the Beautiful Soup find* methods.
r`   rj   $Optional[_RegularExpressionProtocol]patternOptional[bool]presentexclude_everythingNc          
     ,    V ^8  d   QhRRRRRRRRR	R/# )
r(   rj   zOptional[Union[str, bytes]]r|   r{   functionzOptional[Callable]r~   r}   r   r)   )r*   s   "r+   r,   MatchRule.__annotate__   s<     ! !+! 6! %	!
  ! +!r.   c                	   \        V\        4      '       d   VP                  R 4      pWn        \        V\        4      '       d,   \        P
                  ! VP                  R 4      4      V n        M8\        V\        4      '       d   \        P
                  ! V4      V n        MW n        W0n        W@n	        WPn
        V P                  V P                  V P                  V P                  V P                  3 Uu. uF  pVf   K	  VNK  	  pp\        V4      ^ 8X  d   \        R4      h\        V4      ^8  d   \        R4      hR# u upi )utf8NzREither string, pattern, function, present, or exclude_everything must be provided.z[At most one of string, pattern, function, present, and exclude_everything must be provided.)
isinstancebytesdecoderj   recompiler|   rb   r   r~   r   rY   
ValueError)r1   rj   r|   r   r~   r   xvaluess   &&&&&&  r+   r2   MatchRule.__init__   s	    fe$$]]6*Fgu%%::gnnV&<=DL%%::g.DL"L "4 kk4<<dNeNef
f Af 	 

 v;!d  v;?m  
s   4D??D?c                    V ^8  d   QhRRRR/# )r(   rj   r`   r6   r}   r)   )r*   s   "r+   r,   r     s      - N r.   c                   V P                   '       d   R# V P                  RJ d   VRJ# V P                  RJ d   VRJ # V P                  e   V P                  V8H  # V P                  e$   Vf   R# V P                  P	                  V4      RJ# R# )zRun the 'cheap' portion of a match, trying to get an answer without
calling a potentially expensive custom function.

:return: True or False if we have a (positive or negative)
match; None if we need to keep trying.
FTN)r   r~   rj   r|   searchrl   s   &&r+   _base_matchMatchRule._base_match  s     """ <<4%% <<5 T>! ;;";;&(( <<#~<<&&v.d::r.   c                    V ^8  d   QhRRRR/# )r(   rj   r`   r6   r7   r)   )r*   s   "r+   r,   r   $  s      ] t r.   c                	    V P                  V4      pVe   V# V P                  e   V P                  V4      '       g   R# R# )NFT)r   r   )r1   rj   _base_results   && r+   matches_stringMatchRule.matches_string$  s<    ''/#==$T]]6-B-Br.   c                   V ^8  d   QhRR/# r(   r6   rb   r)   )r*   s   "r+   r,   r   .  s     v v# vr.   c                	    \        V 4      P                  pR V RV P                   RV P                   RV P                   RV P
                   R2# )< string=z	 pattern=z
 function=z	 present=>)typerq   rj   r|   r   r~   )r1   clss   & r+   __repr__MatchRule.__repr__.  sN    4j!!3%x}Idll^:dmm_\efjfrfresstuur.   c                    V ^8  d   QhRRRR/# )r(   otherr   r6   r7   r)   )r*   s   "r+   r,   r   2  s     
 
C 
D 
r.   c                	*   \        V\        4      ;'       d}    V P                  VP                  8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # ro   )r   rz   rj   r|   r   r~   )r1   r   s   &&r+   __eq__MatchRule.__eq__2  s}    ui( . .u||+. .-. . /. . -	
r.   )r   r   r|   r~   rj   )NNNNN)rq   rr   rs   rt   ru   rv   r2   r   r   r   r   rx   r)   r.   r+   rz   rz      sB     11&&
!FBv
 
r.   rz   c                  2    ] tR tRt$ RtR]R&   R R ltRtR# )	TagNameMatchRulei<  z@A MatchRule implementing the rules for matches against tag name.zOptional[_TagMatchFunction]r   c                    V ^8  d   QhRRRR/# r(   tagr   r6   r7   r)   )r*   s   "r+   r,   TagNameMatchRule.__annotate__A  s     
 
s 
t 
r.   c                	    V P                  VP                  4      pVe   V# \        \        V P                  4      pV! V4      '       d   R# R# )NTF)r   ra   r   r"   r   )r1   r   
base_valuer   s   &&  r+   matches_tagTagNameMatchRule.matches_tagA  sD    %%chh/
! )4==9C==r.   r)   N)rq   rr   rs   rt   ru   rv   r   rx   r)   r.   r+   r   r   <  s    J))
 
r.   r   c                  &    ] tR tRt$ RtR]R&   RtR# )AttributeValueMatchRuleiN  zGA MatchRule implementing the rules for matches against attribute value.z&Optional[_NullableStringMatchFunction]r   r)   Nrq   rr   rs   rt   ru   rv   rx   r)   r.   r+   r   r   N  s    Q44r.   r   c                  &    ] tR tRt$ RtR]R&   RtR# )StringMatchRuleiT  zIA MatchRule implementing the rules for matches against a NavigableString.zOptional[_StringMatchFunction]r   r)   Nr   r)   r.   r+   r   r   T  s    S,,r.   r   c                  X   ] tR tRt$ RtR]R&   R]R&   R]R&   R,R
 R llt]R R l4       t]R R l4       t	]R R l4       t
]R R l4       tR R lt]R R l4       tR R ltR R ltR R ltR R ltR  R! ltR-R" R# llt]! R$R%4      R& R' l4       t]! R(R%4      R) R* l4       tR+tR	# ).SoupStraineriZ  a  The `ElementFilter` subclass used internally by Beautiful Soup.

A `SoupStrainer` encapsulates the logic necessary to perform the
kind of matches supported by methods such as
:py:meth:`Tag.find`. `SoupStrainer` objects are primarily created
internally, but you can create one yourself and pass it in as
``parse_only`` to the `BeautifulSoup` constructor, to parse a
subset of a large document.

Internally, `SoupStrainer` objects work by converting the
constructor arguments into `MatchRule` objects. Incoming
tags/markup are matched against those rules.

:param name: One or more restrictions on the tags found in a document.

:param attrs: A dictionary that maps attribute names to
  restrictions on tags that use those attributes.

:param string: One or more restrictions on the strings found in a
  document.

:param kwargs: A dictionary that maps attribute names to restrictions
  on tags that use those attributes. These restrictions are additive to
  any specified in ``attrs``.

zList[TagNameMatchRule]
name_rulesz(Dict[str, List[AttributeValueMatchRule]]attribute_ruleszList[StringMatchRule]string_rulesNc               (    V ^8  d   QhRRRRRRRR/# )	r(   ra   zOptional[_StrainableElement]rc   z)Optional[Dict[str, _StrainableAttribute]]rj   Optional[_StrainableString]kwargsr   r)   )r*   s   "r+   r,   SoupStrainer.__annotate__z  s2     ; ;*; 9; ,	;
 ';r.   c           	     	x   VfO   RV9   dH   \        \        \        ,          VP                  R4      4      p\        P
                  ! R\        ^R7       Vf,   V'       g$   V'       g   V'       g   \        RR7      .V n        M=\        \        \        ,          \        V P                  V\        4      4      4      V n        \        \        4      V n        Vf   / p\        V\        4      '       g   RV/pW$3 F}  pVP!                  4        Ff  w  rgVR8X  d   WTJ d   RpVf   RpV P                  V\"        4       F3  pV P                  V,          P%                  \        \"        V4      4       K5  	  Kh  	  K  	  \        \        \&        ,          \        V P                  V\&        4      4      4      V n        W0n        R # )	NtextznAs of version 4.11.0, the 'text' argument to the SoupStrainer constructor is deprecated. Use 'string' instead.
stacklevelTr~   classclass_F)r   r   r    popwarningswarnDeprecationWarningr   r   r   list_make_match_rulesr   r   r   dictitemsr   rX   r   r   _SoupStrainer__string)	r1   ra   rc   rj   r   attrdictattrvaluerule_objs	   &&&&,    r+   r2   SoupStrainer.__init__z  si    >f.(#45vzz&7IJFMM A" <fV  0=>DO"%&T-C-CDJZ-[(\DO  +40=E%&& e$EH'~~/8#(: #D=!E $ 6 6u>U VH((.554h? !W  0 &" !!4(>(>v(W#X
 r.   c                   V ^8  d   QhRR/# r5   r)   )r*   s   "r+   r,   r     s     Z ZT Zr.   c                    V P                   '       * ;'       d+    V P                  '       * ;'       d    V P                  '       * # )zCheck whether the provided rules will obviously include
everything. (They might include everything even if this returns `False`,
but not in an obvious way.)
)r   r   r   r9   s   &r+   r:    SoupStrainer.includes_everything  s3     ??"YY4+<+<'<YYTEYEYAYYr.   c                   V ^8  d   QhRR/# r5   r)   )r*   s   "r+   r,   r     s      T r.   c                r   V P                   '       d'   V P                  '       g   V P                  '       d   R# \        ;QJ d&    R V P                    4       F  '       g   K   RM	  RM! R V P                    4       4      '       d   R# \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   R# V P                  P	                  4        F@  p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   K?   R# 	  R# )zCheck whether the provided rules will obviously exclude
everything. (They might exclude everything even if this returns `False`,
but not in an obvious way.)
Tc              3  8   "   T F  qP                   x  K  	  R # 5iro   r   .0r   s   & r+   	<genexpr>3SoupStrainer.excludes_everything.<locals>.<genexpr>  s     ?->##->   Fc              3  8   "   T F  qP                   x  K  	  R # 5iro   r   r   s   & r+   r   r     s     =_##_r   c              3  8   "   T F  qP                   x  K  	  R # 5iro   r   r   s   & r+   r   r     s     9A''r   )r   r   r   anyr   )r1   rulesets   & r+   r>    SoupStrainer.excludes_everything  s     4???d6J6J6J
 3?T->->?333?T->->???3=T__=333=T__===++224Gs99sss9999 5 r.   c                   V ^8  d   QhRR/# r(   r6   r   r)   )r*   s   "r+   r,   r     s      3 r.   c                T    \         P                  ! R\        ^R7       V P                  # ):meta private:ziAccess to deprecated property string. (Look at .string_rules instead) -- Deprecated since version 4.13.0.r   r   r   r   r   r9   s   &r+   rj   SoupStrainer.string  s%     	w	

 }}r.   c                   V ^8  d   QhRR/# r   r)   )r*   s   "r+   r,   r     s      1 r.   c                T    \         P                  ! R\        ^R7       V P                  # )r   zgAccess to deprecated property text. (Look at .string_rules instead) -- Deprecated since version 4.13.0.r   r   r9   s   &r+   r   SoupStrainer.text  s%     	u	

 }}r.   c                   V ^8  d   QhRR/# r   r)   )r*   s   "r+   r,   r     s     } }# }r.   c           	     	    R V P                   P                   RV P                   RV P                   RV P                   R2	# )r   z name=z attrs=r   r   )	__class__rq   r   r   r   r9   s   &r+   r   SoupStrainer.__repr__  sD    4>>**+6$//1B'$J^J^I__ghlhyhygzz{||r.   c               $    V ^8  d   QhRRRRRR/# )r(   objz9Optional[Union[_StrainableElement, _StrainableAttribute]]
rule_classzType[MatchRule]r6   zIterator[MatchRule]r)   )r*   s   "r+   r,   r     s(     -. -.F-. $-. 
	-.r.   c              #    "   Vf   R# \        V\        \        34      '       d   V! VR7      x  R# \        V\        4      '       d   V! VR7      x  R# \	        V4      '       d   V! VR7      x  R# \        V\
        4      '       d   V! VR7      x  R# \        VR4      '       d   V'       g   V! RR7      x  V Fv  p\        V\        \        34      '       g<   \        VR4      '       d*   \        P                  ! R	V R
2^R7       V! RR7      x  KZ  V P                  W24       F  pVx  K	  	  Kx  	  R# V! \        V4      R7      x  R# 5i)zConvert a vaguely-specific 'object' into one or more well-defined
`MatchRule` objects.

:param obj: Some kind of object that corresponds to one or more
   matching rules.
:param rule_class: Create instances of this `MatchRule` subclass.
N)rj   r   )r   )r|   __iter__Tr   zIgnoring nested list z0 to avoid the possibility of infinite recursion.r   )
r   rb   r   r7   callabler   hasattrr   r   r   )r   r   r   or   s   &&&  r+   r   SoupStrainer._make_match_rules  s     ;cC<((C((T""S))c]]c**788S))S*%% !D99!!eS\22wq*7M7M MM/s2bc#$ %==..q=AG > $ CH--s   B-E0BEc                    V ^8  d   QhRRRR/# r   r)   )r*   s   "r+   r,   r     s     L Ls Lt Lr.   c                   V P                   '       g   V P                  '       g   R# VP                  '       gh   \        V P                   4      ^8X  dN   V P                   ^ ,          P                  e/   VP
                  V P                   ^ ,          P                  8w  d   R# RpVP                  '       d   VP                   RVP
                   2pV P                   '       dl   RpV P                    FO  pVP                  V4      '       g4   VP                  '       d   K.  Vf   K4  VP                  V4      '       g   KM  Rp M	  V'       g   R# V P                  P                  4        F3  w  rVVP                  VR4      pV P                  Wv4      pV'       d   K2   R# 	  V P                  '       d,   VP                  p	V	f   R# V P                  V	4      '       g   R# R# )a  Do the rules of this `SoupStrainer` trigger a match against the
given `Tag`?

If the `SoupStrainer` has any `TagNameMatchRule`, at least one
must match the `Tag` or its `Tag.name`.

If there are any `AttributeValueMatchRule` for a given
attribute, at least one of them must match the attribute
value.

If there are any `StringMatchRule`, at least one must match,
but a `SoupStrainer` that *only* contains `StringMatchRule`
cannot match a `Tag`, only a `NavigableString`.
FN:T)r   r   prefixrY   rj   ra   r   r   r   r   get_attribute_matchr   matches_any_string_rule)
r1   r   prefixed_namename_matchesruler   rules
attr_valuethis_attr_match_strs
   &&        r+   r   SoupStrainer.matches_tag  sk   ( t';';'; 


DOO$)"))5DOOA.555
 :::"zzl!CHH:6M??? L ##C(( MMMm.GDL_L_`mLnLn#'L (  
  //557KDt,J"33JFO"?	 8 ::D|//55r.   c               $    V ^8  d   QhRRRRRR/# )r(   r  zOptional[_AttributeValue]r  z!Iterable[AttributeValueMatchRule]r6   r7   r)   )r*   s   "r+   r,   r   j  s(     $ $-$ 1$ 
	$r.   c                	  a \        V\        4      '       d   TpM\        \        V4      .pR  V3R llpV! V4      pV'       gF   \	        V4      ^8w  d6   \        \
        \        ,          V4      pRP                  V4      pV! V.4      pV# )c                    V ^8  d   QhRRRR/# )r(   attr_valueszSequence[Optional[str]]r6   r7   r)   )r*   s   "r+   r,   3SoupStrainer._attribute_match.<locals>.__annotate__u  s     	 	7N 	SW 	r.   c                b   < S F'  pV  F  pVP                  V4      '       g   K    R # 	  K)  	  R# )TF)r   )r  r  r  r  s   &  r+   _match_attribute_value_helperDSoupStrainer._attribute_match.<locals>._match_attribute_value_helperu  s0    "-J**:66# #.  r.    )r   r   r   rb   rY   r   join)r1   r  r  r  r  r  joined_attr_values   &&f    r+   r   SoupStrainer._attribute_matchj  s     j$''$KZ01K	 	 8D3{#3q#8 x}k:K # 5;=N<OPOr.   c               (    V ^8  d   QhRRRRRRRR/# r^   r)   )r*   s   "r+   r,   r     s,     ' '%'-0'9V'	'r.   c                   V P                   '       d   R# RpV'       d   V RV 2pV P                  '       dL   RpV P                   F/  pW$3 F%  pVf   K	  VP                  V4      '       g   K"  Rp K-  	  K1  	  V'       g   R# Vf   \        4       pV P                  P                  4        F0  w  rVP                  V4      p
V P                  W4      '       d   K/   R# 	  R# )zBased on the name and attributes of a tag, see whether this
`SoupStrainer` will allow a `Tag` object to even be created.

:param name: The name of the prospective tag.
:param attrs: The attributes of the prospective tag.
FNr   T)r   r   r   r   r   r   r   r   )r1   r_   ra   rc   r  
name_matchr  r   r   r  r  s   &&&&       r+   rf   SoupStrainer.allow_tag_creation  s     
 'j$0M???J,A}..q11)-J!	 - (  =!OE//557KD4J((;; 8
 r.   c                    V ^8  d   QhRRRR/# ri   r)   )r*   s   "r+   r,   r     s      C D r.   c                    V P                   '       g   V P                  '       d   R# V P                  '       g   R# V P                  V4      '       g   R# R# )zBased on the content of a markup string, see whether this
`SoupStrainer` will allow it to be instantiated as a
`NavigableString` object, or whether it should be ignored.
FT)r   r   r   r  rl   s   &&r+   rm   "SoupStrainer.allow_string_creation  sE    
 ???d222     ++F33r.   c                    V ^8  d   QhRRRR/# ri   r)   )r*   s   "r+   r,   r     s     	 	c 	d 	r.   c                    V P                   '       g   R# V P                    F  pVP                  V4      '       g   K   R# 	  R# )zWSee whether the content of a string matches any of
this `SoupStrainer`'s string rules.
TF)r   r   )r1   rj   string_rules   && r+   r  $SoupStrainer.matches_any_string_rule  s<        ,,K))&11 - r.   c               $    V ^8  d   QhRRRRRR/# rA   r)   )r*   s   "r+   r,   r     s!      [  t r.   c                &   V'       g   V P                   '       d   R# \        V\        4      '       d   V P                  V4      # \        V\        4      '       g   Q hV P
                  '       g$   V P                  '       g   V P                  V4      # R# )a  Does the given `PageElement` match the rules set down by this
`SoupStrainer`?

The find_* methods rely heavily on this method to find matches.

:param element: A `PageElement`.
:param _known_rules: Set to true in the common case where
   we already checked and found at least one rule in this SoupStrainer
   that might exclude a PageElement. Without this, we need
   to check .includes_everything every time, just to be safe.
:return: `True` if the element matches this `SoupStrainer`'s rules; `False` otherwise.
TF)r:   r   r   r   r   r   r   r  rE   s   &&&r+   rF   SoupStrainer.match  sp      8 8 8gs####G,,'?33334#7#7#7 //88r.   rf   z4.13.0c               $    V ^8  d   QhRRRRRR/# )r(   ra   rb   rc   rd   r6   r7   r)   )r*   s   "r+   r,   r     s"     : :s :+H :T :r.   c                (     V P                  RW4      # )zGA less elegant version of `allow_tag_creation`. Deprecated as of 4.13.0N)rf   )r1   ra   rc   s   &&&r+   
search_tagSoupStrainer.search_tag  s     	&&tT99r.   rF   c                    V ^8  d   QhRRRR/# )r(   rB   r   r6   zOptional[PageElement]r)   )r*   s   "r+   r,   r     s     8 8k 8.C 8r.   c                8    V P                  V4      '       d   V# R# )zLA less elegant version of match(). Deprecated as of 4.13.0.

:meta private:
N)rF   )r1   rB   s   &&r+   r   SoupStrainer.search  s     **W--w747r.   )__stringr   r   r   )NNNrp   )rq   rr   rs   rt   ru   rv   r2   rw   r:   r>   rj   r   r   classmethodr   r   r   rf   rm   r  rF   r   r&  r   rx   r)   r.   r+   r   r   Z  s    6 '&=='';z Z Z  *    } -. -.^L\$L'R$	4 %x0: 1:
 (#8 $8r.   r   )/
__future__r   collectionsr   r   typingr   r   r   r   r	   r
   r   r   r   r   r   r   bs4._deprecationr   bs4.elementr   r   r   r   r   bs4._typingr   r   r   r   r   r   r   r   r   r   r    r!   r"   objectr$   rz   r   r   r   r   r)   r.   r+   <module>r4     s    " # 	     (    "dF dNf
 f
Ry $5i 5-i -b8= b8r.   