
    Cj"	                     J    S SK Jr  SSKJr  SS/r " S S5      rS\S\4S	 jrg
)    )Any   )SourceLocationSource	is_sourcec            	           \ rS rSrSrSrS\" SS5      4S\S\S\S	S
4S jjrS\	S	\4S jr
S	\4S jrS\S	\4S jrS\S	\4S jrSrg
)r      z,A representation of source input to GraphQL.)__weakref____dict__bodynamelocation_offsetzGraphQL requestr   r   r   r   returnNc                     Xl         X l        [        U[        5      (       d  [        R                  " U5      nUR
                  S::  a  [        S5      eUR                  S::  a  [        S5      eX0l        g)a  Initialize source input.

The ``name`` and ``location_offset`` parameters are optional, but they are
useful for clients who store GraphQL documents in source files. For example,
if the GraphQL input starts at line 40 in a file named ``Foo.graphql``, it might
be useful for ``name`` to be ``"Foo.graphql"`` and location to be ``(40, 0)``.

The ``line`` and ``column`` attributes in ``location_offset`` are 1-indexed.
r   z:line in location_offset is 1-indexed and must be positive.z<column in location_offset is 1-indexed and must be positive.N)	r   r   
isinstancer   _makeline
ValueErrorcolumnr   )selfr   r   r   s       i/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/graphql/language/source.py__init__Source.__init__   sq     		/>::,22?CO1$L  !!Q&N   /    positionc                     U R                   S U R                  5       nU(       a  [        U5      n[        US   5      S-   nOSnSn[        X45      $ )Nr   )r   
splitlineslenr   )r   r   linesr   r   s        r   get_locationSource.get_location+   sN    		)8$//1u:Dr^a'FDFd++r   c                 R    SU R                   R                   SU R                  < S3$ )N<z name=>)	__class____name__r   )r   s    r   __repr__Source.__repr__5   s&    4>>**+6$))a@@r   otherc                     [        U[        5      =(       a    UR                  U R                  :H  =(       d%    [        U[        5      =(       a    XR                  :H  $ N)r   r   r   strr   r*   s     r   __eq__Source.__eq__8   s>    5&)EejjDII.E 
uc"9u		'9	
r   c                     X:X  + $ r,    r.   s     r   __ne__Source.__ne__=   s      r   )r   r   r   )r'   
__module____qualname____firstlineno____doc__	__slots__r   r-   r   intr!   r(   r   boolr/   r3   __static_attributes__r2   r   r   r   r      s    6 MI
 &*8A*>	// / (	/
 
/:,S ,^ ,A# A
C 
D 

!C !D !r   sourcer   c                 "    [        U [        5      $ )zDTest if the given value is a Source object.

For internal use only.
)r   r   )r=   s    r   r   r   A   s    
 ff%%r   N)typingr   locationr   __all__r   r;   r   r2   r   r   <module>rB      s3     $[
!6! 6!r&c &d &r   