
    <i	                         S r S rS rS rg)zt
Some generic comparison utility functions.

.. autosummary::
   :toctree: compare

   comparison
   observation

|
c                 "    X:  a  S$ X:  a  S$ S$ )a  
Generic comparator of values which uses the builtin '<' and '>' operators.
Assumes the values can be compared that way.

Args:
    value1: The first value
    value2: The second value

Returns:
    -1, 0, or 1 depending on whether value1 is less, equal, or greater
    than value2
        )value1value2s     d/home/james-whalen/.local/lib/python3.13/site-packages/stix2/equivalence/pattern/compare/__init__.pygeneric_cmpr
      s     2A6?aAA    c                 0   [        U 5      n[        U5      nS=pV  [        U5      n [        U5      nU(       a  U(       a  Sn	 U	$ U(       a  Sn	 U	$ U(       a  Sn	 U	$ U" WW5      n
U
S:w  a  U
n	 U	$ MY  ! [         a    Sn N[f = f! [         a    Sn Naf = f)a  
Generic lexicographical compare function, which works on two iterables and
a comparator function.

Args:
    seq1: The first iterable
    seq2: The second iterable
    cmp: a two-arg callable comparator for values iterated over.  It
        must behave analogously to this function, returning <0, 0, or >0 to
        express the ordering of the two values.

Returns:
    <0 if seq1 < seq2; >0 if seq1 > seq2; 0 if they're equal
FTr   r   r   )iternextStopIteration)seq1seq2cmpit1it2it1_exhaustedit2_exhaustedval1val2resultval_cmps              r	   iter_lex_cmpr      s      t*C
t*C$))M
	!9D	!9D
 ]F& M! F M F M $oG!| MC   	! M	!
  	! M	!s"   A4 B 4BBBBc                 >    SnU H  nU" X5      S:X  d  M  Sn  U$    U$ )a  
A function behaving like the "in" Python operator, but which works with a
a comparator function.  This function checks whether the given value is
contained in the given iterable.

Args:
    value: A value
    seq: An iterable
    cmp: A 2-arg comparator function which must return 0 if the args
        are equal

Returns:
    True if the value is found in the iterable, False if it is not
Fr   Tr   )valueseqr   r   seq_vals        r	   iter_inr    W   s4     Fu!#FM 
 Mr   N)__doc__r
   r   r    r   r   r	   <module>r"      s   
B"5pr   