
    `j-                        d Z ddlZddlZddlZddlmZ dkdZeede_	        dld	Z
dmdZ G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d  d!          Z G d" d#          Z G d$ d%          Z G d& d'          Z G d( d)          Z G d* d+          Z G d, d-          Z G d. d/          Z G d0 d1          Z G d2 d3          Z G d4 d5          Z  G d6 d7          Z! G d8 d9          Z" G d: d;          Z# G d< d=          Z$ G d> d?          Z% G d@ dA          Z& ej'        dBdCdDg          Z( G dE dFe(          Z) G dG dH          Z* e*            Z+ G dI dJ          Z, G dK dL          Z-dM Z.dN Z/ G dO dPe0          Z1 e1ddQdR          Z2 G dS dTej3                  Z4 G dU dV          Z5dndXZ6dodZZ7d[ Z8 G d\ d]          Z9 G d^ d_          Z: G d` da          Z;db Z<e<dpdd            Z=de Z>dmdfZ?dqdjZ@dS )rzAThis module has components that are used for testing Python Fire.    N)test_components_py3
      c                     | |||||fS N )arg1arg2arg3arg4arg5arg6s         X/home/jworkman/hermes-web-chat/venv/lib/python3.11/site-packages/fire/test_components.pyidentityr      s    	tT4t	++    )r
   r      c                     | |z  S )zMultiplies num by rate.

  Args:
    num (int): the num you want to multiply
    rate (int): the rate for multiplication
  Returns:
    Multiplication of num by rate
  r   )numrates     r   multiplier_with_docstringr      s     
tr   Tc                     | S r   r   )helps    r   function_with_helpr   *   s    	+r   c                       e Zd ZdS )EmptyN__name__
__module____qualname__r   r   r   r   r   .           $r   r   c                       e Zd ZdS )OldStyleEmptyNr   r   r   r   r"   r"   2   r    r   r"   c                       e Zd Zd ZdS )WithInitc                     d S r   r   selfs    r   __init__zWithInit.__init__8   s    Dr   Nr   r   r   r(   r   r   r   r$   r$   6   s#        	 	 	 	 	r   r$   c                       e Zd ZddZdS )ErrorInConstructorvaluec                 .    || _         t          d          )NzError in constructor)r,   
ValueErrorr'   r,   s     r   r(   zErrorInConstructor.__init__>   s    DJ
+
,
,,r   N)r,   r)   r   r   r   r+   r+   <   s(        - - - - - -r   r+   c                       e Zd ZdZddZdS )WithHelpArgz2Test class for testing when class has a help= arg.Tc                 &    || _         ddi| _        d S )N__helpzhelp in a dict)has_help
dictionary)r'   r   s     r   r(   zWithHelpArg.__init__F   s    DM!12DOOOr   NTr   r   r   __doc__r(   r   r   r   r1   r1   C   s.        ::3 3 3 3 3 3r   r1   c                       e Zd Zd Zd ZdS )
NoDefaultsc                     d|z  S Nr   r   r'   counts     r   doublezNoDefaults.doubleM       u9r   c                     d|z  S N   r   r=   s     r   triplezNoDefaults.tripleP   r@   r   Nr   r   r   r?   rD   r   r   r   r:   r:   K   s2              r   r:   c                   ,    e Zd ZdZddZddZ	 d	dZdS )
WithDefaultsz1Class with functions that have default arguments.r   c                     d|z  S )zReturns the input multiplied by 2.

    Args:
      count: Input number that you want to double.

    Returns:
      A number that is the double of count.
    r   r   r=   s     r   r?   zWithDefaults.doubleW   s     u9r   c                     d|z  S rB   r   r=   s     r   rD   zWithDefaults.tripleb   r@   r   P00010203040506070809101112131415161718192021222324252627282930313233343536373839c                     |S r   r   )r'   strings     r   textzWithDefaults.texte   s	    
 Mr   Nr   )rJ   )r   r   r   r8   r?   rD   rM   r   r   r   rG   rG   T   s[        99	 	 	 	   
9     r   rG   c                       e Zd ZddZddZdS )OldStyleWithDefaultsr   c                     d|z  S r<   r   r=   s     r   r?   zOldStyleWithDefaults.doubleo   r@   r   c                     d|z  S rB   r   r=   s     r   rD   zOldStyleWithDefaults.tripler   r@   r   NrN   rE   r   r   r   rP   rP   m   s<                r   rP   c                   $    e Zd Zd ZddZddZdS )	MixedDefaultsc                     dS )Nr   r   r&   s    r   tenzMixedDefaults.tenx   s    2r   r   c                     |d|z  z   S r<   r   r'   alphabetas      r   sumzMixedDefaults.sum{   s    1t8r   0c                 
    ||fS r   r   rX   s      r   r   zMixedDefaults.identity~   s    $;r   Nr   r   )r\   )r   r   r   rV   r[   r   r   r   r   rT   rT   v   sK                  r   rT   c                       e Zd ZddZddZdS )SimilarArgNamesFc                 
    ||fS r   r   )r'   bool_onebool_twos      r   r   zSimilarArgNames.identity   s    Xr   Nc                 
    ||fS r   r   )r'   arY   s      r   	identity2zSimilarArgNames.identity2   s    e8Or   )FF)NN)r   r   r   r   rf   r   r   r   r`   r`      s<                r   r`   c                       e Zd ZddZdS )CapitalizedArgNames      ?       @c                     ||z   S r   r   )r'   DeltaGammas      r   r[   zCapitalizedArgNames.sum   s    5=r   N)ri   rj   )r   r   r   r[   r   r   r   rh   rh      s(             r   rh   c                   B    e Zd ZddZddZdeie_        deie_        dS )Annotationsr   c                     d|z  S r<   r   r=   s     r   r?   zAnnotations.double   r@   r   c                     d|z  S rB   r   r=   s     r   rD   zAnnotations.triple   r@   r   r>   NrN   )r   r   r   r?   rD   float__annotations__r   r   r   ro   ro      sT               $U+&#U+&r   ro   c                       e Zd ZdZd ZdS )TypedPropertieszDTest class for testing Python Fire with properties of various types.c                     d| _         d| _        t                      | _        ddddd| _        dd	g| _        d
| _        d| _        d S )NT)   r   rC   Ere   b)r   rw   )echonestalexbethany)carrydividemyexcitingstring)rY   rZ   rG   charliedeltarz   foxgammar&   s    r   r(   zTypedProperties.__init__   s\    DJDI>>DL
 
 DJ #DI"DH#DJJJr   Nr7   r   r   r   ru   ru      s)        LL$ $ $ $ $r   ru   c                        e Zd ZdZd ZddZdS )VarArgsz@Test class for testing Python Fire with a property with varargs.c                 V    d }g }|D ]!}||}n||z  }|                     |           "|S r   )append)r'   itemstotalsumsitems        r   cumsumszVarArgs.cumsums   sJ    ED  	
kk%Kr   r   c                 2    ||d                     |          fS )N join)r'   rY   rZ   charss       r   varcharszVarArgs.varchars   s    $&&r   Nr^   )r   r   r   r8   r   r   r   r   r   r   r      s=        HH	 	 	' ' ' ' ' 'r   r   c                       e Zd Zd Zd ZdS )Underscoresc                     d| _         d S )Nzfish fingers)underscore_exampler&   s    r   r(   zUnderscores.__init__   s    ,Dr   c                     |S r   r   )r'   underscore_args     r   underscore_functionzUnderscores.underscore_function   s    r   N)r   r   r   r(   r   r   r   r   r   r      s2        - - -    r   r   c                       e Zd ZddZdS )BoolConverterFc                      t          |          S r   )bool)r'   args     r   as_boolzBoolConverter.as_bool   s    99r   N)F)r   r   r   r   r   r   r   r   r      s(             r   r   c                       e Zd Zd ZdS )
ReturnsObjc                      ~t                      S r   )r   )r'   r   s     r   get_objzReturnsObj.get_obj   s    ??r   N)r   r   r   r   r   r   r   r   r      s#            r   r   c                       e Zd ZddZddZdS )NumberDefaults      $@c                     d|z  S Nri   r   r'   divisors     r   
reciprocalzNumberDefaults.reciprocal       =r   r   c                     d|z  S r   r   r   s     r   integer_reciprocalz!NumberDefaults.integer_reciprocal   r   r   N)r   r   )r   r   r   r   r   r   r   r   r   r      s<                r   r   c                       e Zd Zd Zd ZdS )InstanceVarsc                 "    || _         || _        d S r   r	   r
   r'   r	   r
   s      r   r(   zInstanceVars.__init__   s    DIDIIIr   c                 "    | j         | j        ||fS r   r   r   s      r   runzInstanceVars.run   s    Ity$--r   N)r   r   r   r(   r   r   r   r   r   r      s2          . . . . .r   r   c                   "    e Zd Zd Zd ZddZdS )Kwargsc                     |S r   r   r'   kwargss     r   propszKwargs.props   s    Mr   c                     d                     t          |                                                                                    S )N )r   sortedkeysupperr   s     r   r   zKwargs.upper   s0    88F6;;==))**00222r   Nc                     |||fS r   r   )r'   
positionalnamedr   s       r   r   z
Kwargs.run   s    v&&r   r   )r   r   r   r   r   r   r   r   r   r   r      sF          3 3 3' ' ' ' ' 'r   r   c                       e Zd Zd ZdS )ErrorRaiserc                      t          d          )NzThis error is part of a test.r.   r&   s    r   failzErrorRaiser.fail   s    
4
5
55r   N)r   r   r   r   r   r   r   r   r      s#        6 6 6 6 6r   r   c                       e Zd Zd Zd ZdS )NonComparablec                      t          d          Nz+Instances of this class cannot be compared.r   r'   others     r   __eq__zNonComparable.__eq__       
B
C
CCr   c                      t          d          r   r   r   s     r   __ne__zNonComparable.__ne__  r   r   N)r   r   r   r   r   r   r   r   r   r      s:        D D DD D D D Dr   r   c                       e Zd Zd Zd ZdS )EmptyDictOutputc                     i S r   r   r&   s    r   totally_emptyzEmptyDictOutput.totally_empty  s    Ir   c                 
    ddiS )N__do_not_print_merw   r   r&   s    r   nothing_printablez!EmptyDictOutput.nothing_printable  s    ##r   N)r   r   r   r   r   r   r   r   r   r     s2          $ $ $ $ $r   r   c                       e Zd Zd ZdS )CircularReferencec                     i }||d<   |S )Nyr   r'   xs     r   createzCircularReference.create  s    
AAcFHr   N)r   r   r   r   r   r   r   r   r     s#            r   r   c                       e Zd Zd Zd ZdS )OrderedDictionaryc                 (    t          j                    S r   collectionsOrderedDictr&   s    r   emptyzOrderedDictionary.empty  s    "$$$r   c                 @    t          j                    }d|d<   d|d<   |S )NAr   r   )r'   ordered_dicts     r   	non_emptyzOrderedDictionary.non_empty  s)    *,,LLLOr   N)r   r   r   r   r   r   r   r   r   r     s2        % % %    r   r   c                       e Zd ZdZd Zd ZdS )
NamedTuplez2Functions returning named tuples used for testing.c                 J    t          j        dddg          } |dd          S )z(Point example straight from Python docs.Pointr   r         )r   r   
namedtupler'   r   s     r   pointzNamedTuple.point&  s,     "7S#J77E5r???r   c                 J    t          j        dddg          } |dd          S )zField name equals value.r   r   r   r   r   r   r   s     r   matching_nameszNamedTuple.matching_names,  s/     "7S#J77E53#r   N)r   r   r   r8   r   r   r   r   r   r   r   #  s8        ::      r   r   c                   "    e Zd ZdZdZd Zd ZdS )CallableWithPositionalArgs#Test class for supporting callable.rw   c                     ||z   S r   r   )r'   r   r   s      r   __call__z#CallableWithPositionalArgs.__call__8      q5Lr   c                     |dz   S Nrw   r   r   s     r   fnzCallableWithPositionalArgs.fn;  r   r   N)r   r   r   r8   TESTr   r  r   r   r   r   r   3  s=        ++	
$      r   r   NamedTuplePointr   r   c                       e Zd ZdZd ZdS )SubPointz@Used for verifying subclasses of namedtuples behave as intended.c                      | j         | j        z   S r   r   r&   s    r   coordinate_sumzSubPoint.coordinate_sumE  s    6DF?r   N)r   r   r   r8   r	  r   r   r   r  r  B  s)        HH    r   r  c                       e Zd ZdZd Zd ZdS )CallableWithKeywordArgumentr   c                     |                                 D ](\  }}t          d                    ||                     )d S )Nz{}: {})r   printformat)r'   r   keyr,   s       r   r   z$CallableWithKeywordArgument.__call__L  sF    llnn ) )
UHOOC''(((() )r   c                 $    t          |           d S r   r  r'   msgs     r   	print_msgz%CallableWithKeywordArgument.print_msgP  s    	#JJJJJr   N)r   r   r   r8   r   r  r   r   r   r  r  I  s8        ++) ) )    r   r  c                   "    e Zd ZdZddZddZdS )ClassWithDocstringzbTest class for testing help text output.

  This is some detail description of this test class.
  Hello!c                     || _         dS )zConstructor of the test class.

    Constructs a new ClassWithDocstring object.

    Args:
      message: The default message to print.
    N)message)r'   r  s     r   r(   zClassWithDocstring.__init__]  s     DLLLr   Nc                 6    || j         }t          |           dS )zPrints a message.N)r  r  r  s     r   r  zClassWithDocstring.print_msgg  s    
{Lc	#JJJJJr   )r  r   )r   r   r   r8   r(   r  r   r   r   r  r  W  sF         
        r   r  c                   (    e Zd ZdZed             ZdS )ClassWithMultilineDocstringzTest class for testing help text output with multiline docstring.

  This is a test class that has a long docstring description that spans across
  multiple lines for testing line breaking in help text.
  c              #   4   K   t          |           E d{V  dS )a  Generators have a ``Yields`` section instead of a ``Returns`` section.

    Args:
        n (int): The upper limit of the range to generate, from 0 to `n` - 1.

    Yields:
        int: The next number in the range of 0 to `n` - 1.

    Examples:
        Examples should be written in doctest format, and should illustrate how
        to use the function.

        >>> print([i for i in example_generator(4)])
        [0, 1, 2, 3]

    N)range)ns    r   example_generatorz-ClassWithMultilineDocstring.example_generatoru  s,      $ Qxxr   N)r   r   r   r8   staticmethodr   r   r   r   r  r  n  s9            <  r   r  c                  
    h dS N>   threerw   r   r   r   r   r   
simple_setr%    s    	r   c                  $    t          h d          S r#  )	frozensetr   r   r   simple_frozensetr(    s    	???	#	##r   c                       e Zd ZdZdS )Subdictz)A subclass of dict, for testing purposes.N)r   r   r   r8   r   r   r   r*  r*    s        1111r   r*  blue)rw   redc                       e Zd ZdZdZdZdS )Colorrw   r   rC   N)r   r   r   REDGREENBLUEr   r   r   r.  r.    s        	#
%	
$$$r   r.  c                   H    e Zd ZdZdZd Zed             Zed             Z	dS )HasStaticAndClassMethodsz0A class with a static method and a class method.rw   c                     || _         d S r   )instance_state)r'   r5  s     r   r(   z!HasStaticAndClassMethods.__init__  s    (Dr   c                     | S r   r   )argss    r   	static_fnz"HasStaticAndClassMethods.static_fn  s    Kr   c                     || j         z   S r   )CLASS_STATE)clsr7  s     r   class_fnz!HasStaticAndClassMethods.class_fn  s    #/!!r   N)
r   r   r   r8   r:  r(   r!  r8  classmethodr<  r   r   r   r3  r3    sd        88+) ) )   < " " ;" " "r   r3  rw   c                     ~ ~~|S )zFunction with varargs.

  Args:
    arg1: Position arg docstring.
    arg2: Position arg docstring.
    arg3: Flags docstring.
    *varargs: Accepts unlimited positional args.
  Returns:
    The unlimited positional args.
  r   )r	   r
   r   varargss       r   function_with_varargsr@    s     D$	.r   rC   c                     ~| |fS r   r   r	   r
   r   s      r   function_with_keyword_argumentsrC    s    
	vr   c                      dS )zThis has code in the docstring.



  Example:
    x = fn_with_code_in_docstring()
    indentation_matters = True



  Returns:
    True.
  Tr   r   r   r   fn_with_code_in_docstringrE    s	     
r   c                   >    e Zd ZdZddZd Zd Zd Zd Zd Z	d	 Z
d
S )BinaryCanvasz:A canvas with which to make binary art, one bit at a time.r   c                 r    fdt                    D             | _        | _        d| _        d| _        d S )Nc                     g | ]}d gz  	S rN   r   ).0_sizes     r   
<listcomp>z)BinaryCanvas.__init__.<locals>.<listcomp>  s    333!A3:333r   r   )r  pixels_size_row_col)r'   rL  s    `r   r(   zBinaryCanvas.__init__  s=    3333uT{{333DKDJDIDIIIr   c                 J    d                     d | j        D                       S )N
c              3   T   K   | ]#}d                      d |D                       V  $dS )r   c              3   4   K   | ]}t          |          V  d S r   )str)rJ  pixels     r   	<genexpr>z1BinaryCanvas.__str__.<locals>.<genexpr>.<genexpr>  s(      --U------r   Nr   )rJ  rows     r   rX  z'BinaryCanvas.__str__.<locals>.<genexpr>  sV       F F25-------F F F F F Fr   )r   rN  r&   s    r   __str__zBinaryCanvas.__str__  s>    99 F F9=F F F F F Fr   c                 $    t          |            | S r   r  r&   s    r   showzBinaryCanvas.show  s    	$KKKKr   c                 B    || j         z  | _        || j         z  | _        | S r   )rO  rP  rQ  )r'   rY  cols      r   movezBinaryCanvas.move  s#    dj DIdj DIKr   c                 ,    |                      d          S r  setr&   s    r   onzBinaryCanvas.on      88A;;r   c                 ,    |                      d          S )Nr   ra  r&   s    r   offzBinaryCanvas.off  rd  r   c                 :    || j         | j                 | j        <   | S r   )rN  rP  rQ  r/   s     r   rb  zBinaryCanvas.set  s    (-DK	49%Kr   Nr   )r   r   r   r8   r(   rZ  r\  r_  rc  rf  rb  r   r   r   rG  rG    s        BB   F F F    
        r   rG  c                       e Zd Zd Zd ZdS )DefaultMethodc                     d|z  S r<   r   r'   numbers     r   r?   zDefaultMethod.double      v:r   c                     d }|S )Nc                      dS )NzUndefined functionr   r   r   r   _missingz+DefaultMethod.__getattr__.<locals>._missing  s    !!r   r   )r'   namerp  s      r   __getattr__zDefaultMethod.__getattr__  s    " " "Or   N)r   r   r   r?   rr  r   r   r   ri  ri    s2              r   ri  c                   *    e Zd Zd Zed             ZdS )InvalidPropertyc                     d|z  S r<   r   rk  s     r   r?   zInvalidProperty.double  rm  r   c                      t          d          )Ntestr   r&   s    r   propzInvalidProperty.prop  s    
V

r   N)r   r   r   r?   propertyrx  r   r   r   rt  rt    s>             8  r   rt  c                 F     t          j                    fd            }|S )Nc                       | i |S r   r   )r7  r   fs     r   wrapperz!simple_decorator.<locals>.wrapper  s    1dfr   )	functoolswraps)r|  r}  s   ` r   simple_decoratorr    s6    ?1    	.r   Worldc                     d| z  S )NzHello %sr   )rq  s    r   decorated_methodr    s    	d	r   c                 0    ~ ~|                     d          S )zFunction with kwarg.

  :param arg1: Description of arg1.
  :param arg2: Description of arg2.
  :key arg3: Description of arg3.
  r   getrB  s      r   fn_with_kwargr    s     D	F		r   c                 2    ~ ~~|                     d          S )zFunction with kwarg and defaults.

  :param arg1: Description of arg1.
  :param arg2: Description of arg2.
  :key arg3: Description of arg3.
  r   r  )r	   r
   optr   s       r   fn_with_kwarg_and_defaultsr  $  s     D#	F		r   firstlastlatec                 
    ~~| S )zFunction with kwarg and defaults.

  :key first: Description of first.
  :key last: Description of last.
  :key late: Description of late.
  r   r  r  r  s      r   fn_with_multiple_defaultsr  /  s     D	,r   )r   r   )r   r6   )rw   )rC   )r  r  )Ar8   r   enumr~  firer   py3r   intrs   r   r   r   r"   r$   r+   r1   r:   rG   rP   rT   r`   rh   ro   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  CALLABLE_WITH_KEYWORD_ARGUMENTr  r  r%  r(  dictr*  SUBDICTEnumr.  r3  r@  rC  rE  rG  ri  rt  r  r  r  r  r  r   r   r   <module>r     ss   H G          + + + + + +, , , , %(55 	 	 	 	                 	 	 	 	 	 	 	 	- - - - - - - -3 3 3 3 3 3 3 3              2       	 	 	 	 	 	 	 	              	, 	, 	, 	, 	, 	, 	, 	,$ $ $ $ $ $ $ $&' ' ' ' ' ' ' '$                            . . . . . . . .	' 	' 	' 	' 	' 	' 	' 	'6 6 6 6 6 6 6 6D D D D D D D D$ $ $ $ $ $ $ $       	 	 	 	 	 	 	 	        	 	 	 	 	 	 	 	 )+():S#JGG               "=!<!>!>        .       8  $ $ $2 2 2 2 2d 2 2 2
 'a''
(
(    DI   " " " " " " " ""      
  "       B                    
          r   