o
    j-                     @   s  d Z ddlZddlZddlZddlmZ dxddZeede_	dyd
dZ
dzddZG dd dZG dd dZG dd dZG dd dZG dd dZG dd dZG dd dZG dd dZG dd  d ZG d!d" d"ZG d#d$ d$ZG d%d& d&ZG d'd( d(ZG d)d* d*ZG d+d, d,ZG d-d. d.ZG d/d0 d0ZG d1d2 d2ZG d3d4 d4ZG d5d6 d6ZG d7d8 d8Z G d9d: d:Z!G d;d< d<Z"G d=d> d>Z#G d?d@ d@Z$G dAdB dBZ%G dCdD dDZ&e'dEdFdGgZ(G dHdI dIe(Z)G dJdK dKZ*e* Z+G dLdM dMZ,G dNdO dOZ-dPdQ Z.dRdS Z/G dTdU dUe0Z1e1d	dVdWZ2G dXdY dYej3Z4G dZd[ d[Z5d{d]d^Z6d|d`daZ7dbdc Z8G ddde deZ9G dfdg dgZ:G dhdi diZ;djdk Z<e<d}dmdnZ=dodp Z>dzdqdrZ?d~dvdwZ@dS )zAThis module has components that are used for testing Python Fire.    N)test_components_py3
      c                 O   s   | |||||fS N )arg1arg2arg3arg4Zarg5Zarg6r   r   U/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/fire/test_components.pyidentity      r   )r   r
      c                 C   s   | | 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   )numZrater   r   r   multiplier_with_docstring      	r   Tc                 C      | S r   r   )helpr   r   r   function_with_help*      r   c                   @      e Zd ZdS )EmptyN__name__
__module____qualname__r   r   r   r   r   .       r   c                   @   r   )OldStyleEmptyNr   r   r   r   r   r   2   r   r   c                   @      e Zd Zdd ZdS )WithInitc                 C   s   d S r   r   selfr   r   r   __init__8   r   zWithInit.__init__Nr   r   r   r"   r   r   r   r   r   6       r   c                   @      e Zd ZdddZdS )ErrorInConstructorvaluec                 C   s   || _ td)NzError in constructor)r'   
ValueErrorr!   r'   r   r   r   r"   >   s   zErrorInConstructor.__init__N)r'   r#   r   r   r   r   r&   <       r&   c                   @   s   e Zd ZdZdddZdS )WithHelpArgz2Test class for testing when class has a help= arg.Tc                 C   s   || _ ddi| _d S )NZ__helpzhelp in a dict)Zhas_help
dictionary)r!   r   r   r   r   r"   F   s   zWithHelpArg.__init__NTr   r   r   __doc__r"   r   r   r   r   r+   C   s    r+   c                   @      e Zd Zdd Zdd ZdS )
NoDefaultsc                 C      d| S Nr   r   r!   countr   r   r   doubleM      zNoDefaults.doublec                 C   r2   N   r   r4   r   r   r   tripleP   r7   zNoDefaults.tripleNr   r   r   r6   r:   r   r   r   r   r1   K       r1   c                   @   s0   e Zd ZdZdddZdddZ	ddd	Zd
S )WithDefaultsz1Class with functions that have default arguments.r   c                 C   r2   )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   r4   r   r   r   r6   W   r   zWithDefaults.doublec                 C   r2   r8   r   r4   r   r   r   r:   b   r7   zWithDefaults.tripleP00010203040506070809101112131415161718192021222324252627282930313233343536373839c                 C      |S r   r   )r!   stringr   r   r   texte   s   zWithDefaults.textNr   )r>   )r   r   r   r/   r6   r:   rA   r   r   r   r   r=   T   s    

r=   c                   @   s    e Zd ZdddZdddZdS )OldStyleWithDefaultsr   c                 C   r2   r3   r   r4   r   r   r   r6   o   r7   zOldStyleWithDefaults.doublec                 C   r2   r8   r   r4   r   r   r   r:   r   r7   zOldStyleWithDefaults.tripleNrB   r;   r   r   r   r   rC   m       
rC   c                   @   s(   e Zd Zdd Zd
ddZdddZd	S )MixedDefaultsc                 C      dS )Nr   r   r    r   r   r   tenx   r   zMixedDefaults.tenr   c                 C   s   |d|  S r3   r   r!   alphabetar   r   r   sum{      zMixedDefaults.sum0c                 C      ||fS r   r   rH   r   r   r   r   ~   r7   zMixedDefaults.identityNr   r   )rM   )r   r   r   rG   rK   r   r   r   r   r   rE   v   s    
rE   c                   @   s    e Zd ZdddZdddZdS )	SimilarArgNamesFc                 C   rN   r   r   )r!   Zbool_oneZbool_twor   r   r   r      r7   zSimilarArgNames.identityNc                 C   rN   r   r   )r!   arI   r   r   r   	identity2   r7   zSimilarArgNames.identity2)FF)NN)r   r   r   r   rR   r   r   r   r   rP      rD   rP   c                   @   s   e Zd ZdddZdS )CapitalizedArgNames      ?       @c                 C      || S r   r   )r!   DeltaGammar   r   r   rK      r7   zCapitalizedArgNames.sumN)rT   rU   )r   r   r   rK   r   r   r   r   rS      r*   rS   c                   @   s4   e Zd ZdddZdddZdeie_deie_dS )	Annotationsr   c                 C   r2   r3   r   r4   r   r   r   r6      r7   zAnnotations.doublec                 C   r2   r8   r   r4   r   r   r   r:      r7   zAnnotations.tripler5   NrB   )r   r   r   r6   r:   float__annotations__r   r   r   r   rY      s
    


rY   c                   @      e Zd ZdZdd ZdS )TypedPropertieszDTest class for testing Python Fire with properties of various types.c                 C   s@   d| _ d| _t | _ddddd| _dd	g| _d
| _d| _d S )NT)   r   r9   ErQ   b)r   r^   )echonestZalexZbethany)ZcarrydivideZmyexcitingstring)rI   rJ   r=   Zcharliedeltara   Zfoxgammar    r   r   r   r"      s   

zTypedProperties.__init__Nr.   r   r   r   r   r]          r]   c                   @   s"   e Zd ZdZdd ZdddZdS )	VarArgsz@Test class for testing Python Fire with a property with varargs.c                 G   s6   d }g }|D ]}|d u r|}n||7 }| | q|S r   )append)r!   itemstotalZsumsitemr   r   r   cumsums   s   zVarArgs.cumsumsr   c                 G   s   ||d |fS )N join)r!   rI   rJ   charsr   r   r   varchars   r   zVarArgs.varcharsNrO   )r   r   r   r/   rl   rq   r   r   r   r   rg      s    rg   c                   @   r0   )Underscoresc                 C   s
   d| _ d S )Nzfish fingers)Zunderscore_exampler    r   r   r   r"         
zUnderscores.__init__c                 C   r?   r   r   )r!   Zunderscore_argr   r   r   underscore_function   r   zUnderscores.underscore_functionN)r   r   r   r"   rt   r   r   r   r   rr      r<   rr   c                   @   r%   )BoolConverterFc                 C   s   t |S r   )bool)r!   argr   r   r   as_bool   r7   zBoolConverter.as_boolN)F)r   r   r   rx   r   r   r   r   ru      r*   ru   c                   @   r   )
ReturnsObjc                 G   s   ~t  S r   )ru   )r!   ri   r   r   r   get_obj   s   zReturnsObj.get_objN)r   r   r   rz   r   r   r   r   ry      r$   ry   c                   @   s    e Zd ZdddZd	ddZdS )
NumberDefaults      $@c                 C      d| S NrT   r   r!   Zdivisorr   r   r   
reciprocal   r7   zNumberDefaults.reciprocalr   c                 C   r}   r~   r   r   r   r   r   integer_reciprocal   r7   z!NumberDefaults.integer_reciprocalN)r|   r   )r   r   r   r   r   r   r   r   r   r{      rD   r{   c                   @   r0   )InstanceVarsc                 C   s   || _ || _d S r   r   r   r!   r   r   r   r   r   r"      s   
zInstanceVars.__init__c                 C   s   | j | j||fS r   r   r   r   r   r   run   r   zInstanceVars.runN)r   r   r   r"   r   r   r   r   r   r      s    r   c                   @   s&   e Zd Zdd Zdd ZdddZdS )	Kwargsc                 K   r?   r   r   r!   kwargsr   r   r   props   r   zKwargs.propsc                 K   s   d t|  S )N )ro   sortedkeysupperr   r   r   r   r      s   zKwargs.upperNc                 K   s
   |||fS r   r   )r!   
positionalnamedr   r   r   r   r      rs   z
Kwargs.runr   )r   r   r   r   r   r   r   r   r   r   r      s    r   c                   @   r   )ErrorRaiserc                 C      t d)NzThis error is part of a test.r(   r    r   r   r   fail   r7   zErrorRaiser.failN)r   r   r   r   r   r   r   r   r      r$   r   c                   @   r0   )NonComparablec                 C   r   Nz+Instances of this class cannot be compared.r   r!   otherr   r   r   __eq__   r7   zNonComparable.__eq__c                 C   r   r   r   r   r   r   r   __ne__  r7   zNonComparable.__ne__N)r   r   r   r   r   r   r   r   r   r      r<   r   c                   @   r0   )EmptyDictOutputc                 C   s   i S r   r   r    r   r   r   totally_empty  r   zEmptyDictOutput.totally_emptyc                 C   s   ddiS )NZ__do_not_print_mer^   r   r    r   r   r   nothing_printable  r7   z!EmptyDictOutput.nothing_printableN)r   r   r   r   r   r   r   r   r   r     r<   r   c                   @   r   )CircularReferencec                 C   s   i }||d< |S )Nyr   r!   xr   r   r   create  s   zCircularReference.createN)r   r   r   r   r   r   r   r   r     r$   r   c                   @   r0   )OrderedDictionaryc                 C   s   t  S r   collectionsOrderedDictr    r   r   r   empty  r7   zOrderedDictionary.emptyc                 C   s   t  }d|d< d|d< |S )NAr   r   )r!   Zordered_dictr   r   r   	non_empty  s   zOrderedDictionary.non_emptyN)r   r   r   r   r   r   r   r   r   r     r<   r   c                   @       e Zd ZdZdd Zdd ZdS )
NamedTuplez2Functions returning named tuples used for testing.c                 C   s   t dddg}|dddS )z(Point example straight from Python docs.Pointr   r         )r   r   
namedtupler!   r   r   r   r   point&     zNamedTuple.pointc                 C   s   t dddg}|dddS )zField name equals value.r   r   r   r   r   r   r   r   r   r   matching_names,  r   zNamedTuple.matching_namesN)r   r   r   r/   r   r   r   r   r   r   r   #  s    r   c                   @   s$   e Zd ZdZdZdd Zdd ZdS )CallableWithPositionalArgs#Test class for supporting callable.r^   c                 C   rV   r   r   )r!   r   r   r   r   r   __call__8  r7   z#CallableWithPositionalArgs.__call__c                 C   s   |d S Nr^   r   r   r   r   r   fn;  r7   zCallableWithPositionalArgs.fnN)r   r   r   r/   TESTr   r   r   r   r   r   r   3  s
    r   NamedTuplePointr   r   c                   @   r\   )SubPointz@Used for verifying subclasses of namedtuples behave as intended.c                 C   s   | j | j S r   r   r    r   r   r   coordinate_sumE  rL   zSubPoint.coordinate_sumN)r   r   r   r/   r   r   r   r   r   r   B  rf   r   c                   @   r   )CallableWithKeywordArgumentr   c                 K   s&   |  D ]\}}td|| qd S )Nz{}: {})ri   printformat)r!   r   keyr'   r   r   r   r   L  s   z$CallableWithKeywordArgument.__call__c                 C   s   t | d S r   r   r!   msgr   r   r   	print_msgP  rL   z%CallableWithKeywordArgument.print_msgN)r   r   r   r/   r   r   r   r   r   r   r   I  s    r   c                   @   s$   e Zd ZdZdddZd	ddZdS )
ClassWithDocstringzbTest class for testing help text output.

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

    Constructs a new ClassWithDocstring object.

    Args:
      message: The default message to print.
    N)message)r!   r   r   r   r   r"   ]  s   
zClassWithDocstring.__init__Nc                 C   s   |du r| j }t| dS )zPrints a message.N)r   r   r   r   r   r   r   g  s   zClassWithDocstring.print_msg)r   r   )r   r   r   r/   r"   r   r   r   r   r   r   W  s    

r   c                   @   s   e Zd ZdZed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                 c   s    t | E dH  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)nr   r   r   example_generatoru  s   z-ClassWithMultilineDocstring.example_generatorN)r   r   r   r/   staticmethodr   r   r   r   r   r   n  s    r   c                   C   s   h dS N>   r^   r   threer   r   r   r   r   
simple_set  r7   r   c                   C   s   t h dS r   )	frozensetr   r   r   r   simple_frozenset  rL   r   c                   @   s   e Zd ZdZdS )Subdictz)A subclass of dict, for testing purposes.N)r   r   r   r/   r   r   r   r   r     s    r   blue)r^   redc                   @   s   e Zd ZdZdZdZdS )Colorr^   r   r9   N)r   r   r   ZREDZGREENZBLUEr   r   r   r   r     s    r   c                   @   s4   e Zd ZdZdZdd Zedd Zedd Z	d	S )
HasStaticAndClassMethodsz0A class with a static method and a class method.r^   c                 C   s
   || _ d S r   )instance_state)r!   r   r   r   r   r"     rs   z!HasStaticAndClassMethods.__init__c                 C   r   r   r   )argsr   r   r   	static_fn  s   z"HasStaticAndClassMethods.static_fnc                 C   s
   || j  S r   )CLASS_STATE)clsr   r   r   r   class_fn  s   
z!HasStaticAndClassMethods.class_fnN)
r   r   r   r/   r   r"   r   r   classmethodr   r   r   r   r   r     s    
r   r^   c                 G   s
   ~ ~~|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	   varargsr   r   r   function_with_varargs  s   r   r9   c                 K   s
   ~| |fS r   r   r   r   r   r   r   r   function_with_keyword_arguments  s   r   c                   C   rF   )zThis has code in the docstring.



  Example:
    x = fn_with_code_in_docstring()
    indentation_matters = True



  Returns:
    True.
  Tr   r   r   r   r   fn_with_code_in_docstring  s   r   c                   @   sJ   e Zd ZdZdddZdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dS )BinaryCanvasz:A canvas with which to make binary art, one bit at a time.r   c                    s.    fddt  D | _ | _d| _d| _d S )Nc                    s   g | ]}d g  qS rB   r   ).0_sizer   r   
<listcomp>  s    z)BinaryCanvas.__init__.<locals>.<listcomp>r   )r   pixels_size_row_col)r!   r   r   r   r   r"     s   
zBinaryCanvas.__init__c                 C   s   d dd | jD S )N
c                 s   s$    | ]}d  dd |D V  qdS )r   c                 s   s    | ]}t |V  qd S r   )str)r   Zpixelr   r   r   	<genexpr>  s    z1BinaryCanvas.__str__.<locals>.<genexpr>.<genexpr>Nrn   )r   rowr   r   r   r     s    
z'BinaryCanvas.__str__.<locals>.<genexpr>)ro   r   r    r   r   r   __str__  s   
zBinaryCanvas.__str__c                 C   s   t |  | S r   r   r    r   r   r   show  s   zBinaryCanvas.showc                 C   s   || j  | _|| j  | _| S r   )r   r   r   )r!   r   colr   r   r   move  s   zBinaryCanvas.movec                 C   
   |  dS r   setr    r   r   r   on  rs   zBinaryCanvas.onc                 C   r   )Nr   r   r    r   r   r   off  rs   zBinaryCanvas.offc                 C   s   || j | j | j< | S r   )r   r   r   r)   r   r   r   r     s   zBinaryCanvas.setNr   )r   r   r   r/   r"   r   r   r   r   r   r   r   r   r   r   r     s    
r   c                   @   r0   )DefaultMethodc                 C   r2   r3   r   r!   numberr   r   r   r6     r7   zDefaultMethod.doublec                 C   s   dd }|S )Nc                   S   rF   )NzUndefined functionr   r   r   r   r   _missing  r   z+DefaultMethod.__getattr__.<locals>._missingr   )r!   namer   r   r   r   __getattr__  s   zDefaultMethod.__getattr__N)r   r   r   r6   r  r   r   r   r   r     r<   r   c                   @   s    e Zd Zdd Zedd ZdS )InvalidPropertyc                 C   r2   r3   r   r   r   r   r   r6     r7   zInvalidProperty.doublec                 C   r   )Ntestr   r    r   r   r   prop     zInvalidProperty.propN)r   r   r   r6   propertyr  r   r   r   r   r    s    r  c                    s   t   fdd}|S )Nc                     s    | i |S r   r   )r   r   fr   r   wrapper  s   z!simple_decorator.<locals>.wrapper)	functoolswraps)r  r	  r   r  r   simple_decorator  s   r  Worldc                 C   s   d|  S )NzHello %sr   )r   r   r   r   decorated_method  r  r  c                 K   s   ~ ~| dS )zFunction with kwarg.

  :param arg1: Description of arg1.
  :param arg2: Description of arg2.
  :key arg3: Description of arg3.
  r	   getr   r   r   r   fn_with_kwarg  s   
r  c                 K   s   ~ ~~| 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   r   r   r   fn_with_kwarg_and_defaults$  s   
r  firstlastlatec                 C   s   ~~| 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  r   r   r   fn_with_multiple_defaults/  s   r  )r   r   )r   r-   )r^   )r9   )r  r  )Ar/   r   enumr
  firer   py3r   intr[   r   r   r   r   r   r&   r+   r1   r=   rC   rE   rP   rS   rY   r]   rg   rr   ru   ry   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   ZCALLABLE_WITH_KEYWORD_ARGUMENTr   r   r   r   dictr   ZSUBDICTEnumr   r   r   r   r   r   r   r  r  r  r  r  r  r   r   r   r   <module>   sx   


					
		

!

