
    &`i5                     V    d Z ddlZddlmZ  G d de          Z G d de          ZdS )	z8
This module provides the base definition for patterns.
    N   )unicodec                   "    e Zd ZdZdZd Zd ZdS )PatternzG
	The :class:`Pattern` class is the abstract definition of a pattern.
	includec                     || _         dS )z
		Initializes the :class:`Pattern` instance.

		*include* (:class:`bool` or :data:`None`) is whether the matched
		files should be included (:data:`True`), excluded (:data:`False`),
		or is a null-operation (:data:`None`).
		Nr   )selfr   s     |/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/_private/thirdparty/pathspec/pattern.py__init__zPattern.__init__   s     $,     c                 p    t          d                    | j        j        | j        j                            )a3  
		Matches this pattern against the specified files.

		*files* (:class:`~collections.abc.Iterable` of :class:`str`) contains
		each file relative to the root directory (e.g., ``"relative/path/to/file"``).

		Returns an :class:`~collections.abc.Iterable` yielding each matched
		file path (:class:`str`).
		z{}.{} must override match().)NotImplementedErrorformat	__class__
__module____name__)r
   filess     r   matchzPattern.match#   s/     	:AA$.B[]a]k]tuuvvvr   N)r   r   __qualname____doc__	__slots__r   r    r   r   r   r      sH         
    
w 
w 
w 
w 
wr   r   c                   J     e Zd ZdZdZd fd	Zd Zd Zed             Z	 xZ
S )	RegexPatternza
	The :class:`RegexPattern` class is an implementation of a pattern
	using regular expressions.
	)regexNc                     d| _         	 t          |t          t          f          rO|J d                    ||                      |                     |          \  }}|t          j        |          }nZ|t          |d          r|}nE|!|J d                    ||                      n"t          d                    |                    t          t          |                               |           || _         dS )a>  
		Initializes the :class:`RegexPattern` instance.

		*pattern* (:class:`unicode`, :class:`bytes`, :class:`re.RegexObject`,
		or :data:`None`) is the pattern to compile into a regular
		expression.

		*include* (:class:`bool` or :data:`None`) must be :data:`None`
		unless *pattern* is a precompiled regular expression (:class:`re.RegexObject`)
		in which case it is whether matched files should be included
		(:data:`True`), excluded (:data:`False`), or is a null operation
		(:data:`None`).

			.. NOTE:: Subclasses do not need to support the *include*
			   parameter.
		Nz8include:{!r} must be null when pattern:{!r} is a string.r   z4include:{!r} must be null when pattern:{!r} is null.z3pattern:{!r} is not a string, RegexObject, or None.)r   
isinstancer   bytesr   pattern_to_regexrecompilehasattr	TypeErrorsuperr   r   )r
   patternr   r   r   s       r   r   zRegexPattern.__init__9   s   $ $*
 '5)** Z
//U\\]dfmnn///))'22>5' JuEww88 55 //QXXY`bijj//// 
HOOPWXX	Y	YYd$$W---$***r   c                 z    t          |t                    r | j        |j        k    o| j        |j        k    S t          S )z
		Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
		by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
		attributes.
		)r   r   r   r   NotImplemented)r
   others     r   __eq__zRegexPattern.__eq__i   s9     |$$ 
,%-
'
EDJ%+,EE
r   c              #   b   K   | j         #|D ]"}| j                            |          |V  !dS dS )a/  
		Matches this pattern against the specified files.

		*files* (:class:`~collections.abc.Iterable` of :class:`str`)
		contains each file relative to the root directory (e.g., "relative/path/to/file").

		Returns an :class:`~collections.abc.Iterable` yielding each matched
		file path (:class:`str`).
		N)r   r   r   )r
   r   paths      r   r   zRegexPattern.matcht   sQ       
\  tz)ZZZ  r   c                 
    |dfS )a  
		Convert the pattern into an uncompiled regular expression.

		*pattern* (:class:`str`) is the pattern to convert into a regular
		expression.

		Returns the uncompiled regular expression (:class:`str` or :data:`None`),
		and whether matched files should be included (:data:`True`),
		excluded (:data:`False`), or is a null-operation (:data:`None`).

			.. NOTE:: The default implementation simply returns *pattern* and
			   :data:`True`.
		Tr   )clsr&   s     r   r    zRegexPattern.pattern_to_regex   s     
$r   )N)r   r   r   r   r   r   r*   r   classmethodr    __classcell__)r   s   @r   r   r   0   s          . . . . . .`	 	 	     +    r   r   )r   r!   compatr   objectr   r   r   r   r   <module>r3      s     
			      "w "w "w "w "wf "w "w "wJb b b b b7 b b b b br   