U ʗRe@s(ddlZddlZddlZddlZddlmZddlmZmZm Z e dZ GdddZ edde ee d d d Zedde ee d d d Zedde eed ddZGdddZGdddZGdddZGdddeZeedddZd"eee efeedddZeedd d!ZdS)#N) lru_cache)ListUnionIterable\c@sZeZdZUdZgZeeed<gZeeed<dZ e ddZ e ddZ e d dZ d S) __config_flagsz=Internal class for defining compatibility and debugging flags _all_names _fixed_names configurationc Csd||jkr6td|j||jtt||dS||j krNt |||nt d|j|dS)Nz'{}.{} {} is {} and cannot be overriddenzno such {} {!r}) r warningswarnformat__name__ _type_descstrgetattrupperrsetattr ValueError)clsdnamevaluer/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pyparsing/util.py_sets  z__config_flags._setcCs ||dS)NTrrnamerrr$z__config_flags.cCs ||dS)NFrrrrrr%rN)r __module__ __qualname____doc__rrr__annotations__r r classmethodrenabledisablerrrrr s   r)maxsize)locstrgreturncCsF|}d|krt|kr4nn||ddkr4dS||dd|S)a Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. r )lenrfind)r)r*srrrcol(s r1cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note - the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. r-rr,)count)r)r*rrrlineno9s r3cCsB|dd|}|d|}|dkr2||d|S||ddS)zh Returns the line of text containing loc within a string, counting newlines as line separators. r-rr,N)r/find)r)r*last_crnext_crrrrlineGs r7c@seZdZddZdS)_UnboundedCachecspijt|_fdd}fdd}fdd}d|_t|||_t|||_t|||_dS)Ncs |SNr_key cache_get not_in_cacherrgetWsz%_UnboundedCache.__init__..getcs ||<dSr9rr;r<rcacherrset_Zsz&_UnboundedCache.__init__..set_cs dSr9clearr;rBrrrF]sz'_UnboundedCache.__init__..clear)r@objectr?sizetypes MethodTypesetrF)selfr@rDrFr)rCr>r?r__init__Rs   z_UnboundedCache.__init__Nrr r!rNrrrrr8Qsr8c@seZdZddZdS) _FifoCachecsvt|_tjfdd}fdd}fdd}|_t|||_t|||_t|||_ dS)Ncs |Sr9rr:r=rrr@lsz _FifoCache.__init__..getcs&||<tkr"jddqdSNF)last)r.popitemrA)rCrIrrrDos z!_FifoCache.__init__..set_cs dSr9rErGrBrrrFtsz"_FifoCache.__init__..clear) rHr? collections OrderedDictr@rIrJrKrLrF)rMrIr@rDrFr)rCr>r?rIrrNgs  z_FifoCache.__init__NrOrrrrrPfsrPc@s8eZdZdZddZddZddZdd Zd d Zd S) LRUMemoz A memoizing mapping that retains `capacity` deleted items The memo tracks retained items by their access order; once `capacity` items are retained, the least recently used item is discarded. cCs||_i|_t|_dSr9) _capacity_activerTrU_memory)rMcapacityrrrrNszLRUMemo.__init__cCs<z |j|WStk r6|j||j|YSXdSr9)rXKeyErrorrY move_to_endrMr<rrr __getitem__s   zLRUMemo.__getitem__cCs|j|d||j|<dSr9)rYpoprXrMr<rrrr __setitem__szLRUMemo.__setitem__cCsTz|j|}Wntk r$Yn,Xt|j|jkrF|jjddq&||j|<dSrQ)rXr_r[r.rYrWrSr`rrr __delitem__szLRUMemo.__delitem__cCs|j|jdSr9)rXrFrY)rMrrrrFs z LRUMemo.clearN) rr r!r"rNr^rarbrFrrrrrV}s  rVc@seZdZdZddZdS) UnboundedMemoz< A memoizing mapping that retains all deleted items cCsdSr9rr]rrrrbszUnboundedMemo.__delitem__N)rr r!r"rbrrrrrcsrc)r0r+cCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-[]r-z\n z\t)replace_bslashr)r0crrr_escape_regex_range_charss   rhT)r0 re_escaper+c sfddd_t_d_dddd}|s:|g}d tt|}t|d krtj |d D]\}}t |}}t j t t|g|d d }||kr||qjt|t|d krd nd}|d|||qjnfdd|D}d |S)Ncs4t|}|j_}||dkr.tj_jS)Nr,)ordprevnextcounterr)rgc_intrk)is_consecutiverrros   z2_collapse_string_to_ranges..is_consecutivercSs|dkrd|S|S)Nz\^-][\rrgrrrescape_re_range_charsz8_collapse_string_to_ranges..escape_re_range_charcSs|Sr9rrrrrrno_escape_re_range_charsz;_collapse_string_to_ranges..no_escape_re_range_char)r<r,)maxlen-z{}{}{}csg|] }|qSrr).0rg)rsrr sz._collapse_string_to_ranges..)rk itertoolsr2rmrjoinsortedrLr.groupbyrlrTdequechainiterr_appendrjr ) r0rirtretr;charsfirstrRsepr)rsror_collapse_string_to_rangess:     r)llr+cCs6g}|D](}t|tr&|t|q||q|Sr9) isinstancelistextend_flattenr)rrirrrrs   r)T)r rJrTr{ functoolsrtypingrrrchrrfrintrr1r3r7r8rPrVdictrcrhboolrrrrrrrs2   '   .