§
    P„jÍ± ã                   ó–  — d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ  G d„ de
j        ¦  «        Z G d	„ d
¦  «        Z G d„ d¦  «        Zdefd„Zej        dd„¦   «         Z  ej!        ¦   «         Z"i Z#i Z$i Z% e&¦   «         Z'i Z( e
j)        ¦   «         Z* e¦   «         Z+g Z,da-da. ej!        ¦   «         Z/ e¦   «         gZ0i Z1e2ej3        j4        fgZ5i Z6dgZ7 e8¦   «         Z9e9e/d<   d„ Z:d„ Z;d€d„Z<d„ Z=d„ Z>	 	 d�d„Z? G d„ dej@        ¦  «        ZAd‚d„ZBd„ ZCd„ ZD G d„ d¦  «        ZE G d „ d!¦  «        ZFd"„ ZGd#„ ZH G d$„ d%ejI        ¦  «        ZI G d&„ d'ej@        ¦  «        ZJd(„ ZKd)„ ZLd€d*„ZMd+„ ZNd,„ ZOd-„ ZPd.„ ZQd/„ ZRd0„ ZSd1„ ZTd2„ ZUd3„ ZVd4„ ZWd5„ ZXd6„ ZYd7„ ZZej        d8„ ¦   «         Z[eed9ef         ee         e\f         Z]d:e]deee\         e\f         fd;„Z^	 	 dƒd=e\d>e_dee\ef         fd?„Z`	 	 d„d:e]d@e_d>e_dee\ef         fdA„Zad:e]ded9ef         fdB„ZbdC„ Zc	 	 	 	 	 	 d…dD„Zd	 	 	 	 d†dE„Ze	 	 	 	 d†dF„Zf	 	 	 	 d†dG„ZgddH„ZhdIe\dJee\         fdK„Zi G dL„ dM¦  «        Zj	 	 d‡dP„Zkd‡dQ„Zld‡dR„Zm G dS„ dTej@        ¦  «        Znd€dU„ZodV„ ZpdW„ ZqdX„ Zr	 	 d�dYe\dZee_ee\         f         d[e_denfd\„Zs	 	 	 dˆd]eee\                  d^eee\                  d_e_dZee_ee\         f         d[e_f
d`„Zt	 	 d‰daendbe\dce\fdd„Zude„ Zvdf„ Zwdg„ Zxej        dh„ ¦   «         Zydi„ Zzdj„ Z{ej        dk„ ¦   «         Z|dl„ Z}dm„ Z~dn„ Zddo„Z€dŠdp„Z� egdq¬r¦  «        ds„ ¦   «         Z‚ egdtdq¬r¦  «        du„ ¦   «         Zƒ egdq¬r¦  «        dv„ ¦   «         Z„ddw„Z…dx„ Z†d‹dy„Z‡e~dz„ ¦   «         Zˆd{„ Z‰e~d|„ ¦   «         ZŠe~d}„ ¦   «         Z‹d~„ ZŒdS )ŒaC
  Defines the Gin configuration framework.

Programs frequently have a number of "hyperparameters" that require variation
across different executions of the program. When the number of such parameters
grows even moderately large, or use of some parameter is deeply embedded in the
code, top-level flags become very cumbersome. This module provides an
alternative mechanism for setting such hyperparameters, by allowing injection of
parameter values for any function marked as "configurable".

For detailed documentation, please see the user guide:

https://github.com/google/gin-config/tree/master/docs/index.md

# Making functions and classes configurable

Functions and classes can be marked configurable using the `@configurable`
decorator, which associates a "configurable name" with the function or class (by
default, just the function or class name). Optionally, parameters can be
allowlisted or denylisted to mark only a subset of the function's parameters as
configurable. Once parameters have been bound (see below) to this function, any
subsequent calls will have those parameters automatically supplied by Gin.

If an argument supplied to a function by its caller (either as a positional
argument or as a keyword argument) corresponds to a parameter configured by Gin,
the caller's value will take precedence.

# A short example

Python code:

    @gin.configurable
    def mix_cocktail(ingredients):
      ...

    @gin.configurable
    def serve_random_cocktail(available_cocktails):
      ...

    @gin.configurable
    def drink(cocktail):
      ...

Gin configuration:

    martini/mix_cocktail.ingredients = ['gin', 'vermouth', 'twist of lemon']
    gin_and_tonic/mix_cocktail.ingredients = ['gin', 'tonic water']

    serve_random_cocktail.available_cocktails = {
        'martini': @martini/mix_cocktail,
        'gin_and_tonic': @gin_and_tonic/mix_cocktail,
    }

    drink.cocktail = @serve_random_cocktail()

In the above example, there are three configurable functions: `mix_cocktail`
(with a parameter `ingredients`), `serve_random_cocktail` (with parameter
`available_cocktails`), and `drink` (with parameter `cocktail`).

When `serve_random_cocktail` is called, it will receive a dictionary
containing two scoped *references* to the `mix_cocktail` function (each scope
providing unique parameters, meaning calling the different references will
presumably produce different outputs).

On the other hand, when the `drink` function is called, it will receive the
*output* of calling `serve_random_cocktail` as the value of its `cocktail`
parameter, due to the trailing `()` in `@serve_random_cocktail()`.
é    N)	ÚAnyÚCallableÚDictÚOptionalÚSequenceÚSetÚTupleÚTypeÚUnion)Úconfig_parser)Úselector_map)Úutilsc                   óP   — e Zd ZdZd„ Zed„ ¦   «         Zed„ ¦   «         Zd„ Zd„ Z	dS )Ú_ScopeManagerzóManages currently active config scopes.

  This ensures thread safety of config scope management by subclassing
  `threading.local`. Scopes are tracked as a stack, where elements in the
  stack are lists of the currently active scope names.
  c                 ó:   — t          | d¦  «        s
g g| _        d S d S )NÚ_active_scopes)Úhasattrr   ©Úselfs    úO/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/gin/config.pyÚ_maybe_initz_ScopeManager._maybe_inito   s/   € Ý�4Ð)Ñ*Ô*ð !Ø˜D€dÔÐÐð!ð !ó    c                 óH   — |                       ¦   «          | j        d d …         S ©N©r   r   r   s    r   Úactive_scopesz_ScopeManager.active_scopess   s&   € à×ÒÑÔÐØÔ˜q˜q˜qÔ!Ð!r   c                 óT   — |                       ¦   «          | j        d         d d …         S ©Néÿÿÿÿr   r   s    r   Úcurrent_scopez_ScopeManager.current_scopex   s+   € à×ÒÑÔÐØÔ˜rÔ" 1 1 1Ô%Ð%r   c                 ób   — |                       ¦   «          | j                             |¦  «         dS )z›Enters the given scope, updating the list of active scopes.

    Args:
      scope: A list of active scope names, ordered from outermost to innermost.
    N)r   r   Úappend)r   Úscopes     r   Úenter_scopez_ScopeManager.enter_scope}   s3   € ð 	×ÒÑÔÐØÔ×Ò˜uÑ%Ô%Ð%Ð%Ð%r   c                 ó`   — |                       ¦   «          | j                             ¦   «          dS )z&Exits the most recently entered scope.N)r   r   Úpopr   s    r   Ú
exit_scopez_ScopeManager.exit_scope†   s/   € à×ÒÑÔÐØÔ×ÒÑÔÐÐÐr   N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r    r$   r'   © r   r   r   r   g   s�   € € € € € ðð ð!ð !ð !ð ð"ð "ñ „8ð"ð ð&ð &ñ „8ð&ð&ð &ð &ðð ð ð ð r   r   c                   ó   — e Zd Zd„ ZdS )Ú_GinBuiltinsc                 óN   — t           | _         t          | _        t          | _        d S r   )ÚmacroÚ_retrieve_constantÚconstantÚ	singletonr   s    r   Ú__init__z_GinBuiltins.__init__Ž   s   € Ý€D„JÝ&€D„MÝ€D„N€N€Nr   N)r(   r)   r*   r5   r-   r   r   r/   r/   Œ   s#   € € € € € ðð ð ð ð r   r/   c                   óz   — e Zd ZdZdd„Zed„ ¦   «         Zed„ ¦   «         Zd„ Zde	j
        fd„Zd	„ Zd
„ Zd„ Zd„ ZdS )ÚParseContextz/Encapsulates context for parsing a single file.Nc                 ó’   — || _         g | _        i | _        i | _        d| _        |�|j        D ]}|                      |¦  «         ŒdS dS )aÚ  Initializes the instance.

    Args:
      import_manager: If not `None`, an `ImportManager` providing an initial set
        of imports to process. Additionally, if an `ImportManager` is provided
        and dynamic registration is enabled, actually importing an unregistered
        configurable during parsing becomes an error (instead, all configurables
        are assumed to be registered already). This is used when generating
        (operative) config strings.
    FN)Ú_import_managerÚ_importsÚ_symbol_tableÚ_symbol_sourceÚ_dynamic_registrationÚsorted_importsÚprocess_import)r   Úimport_managerÚstmts      r   r5   zParseContext.__init__—   sl   € ð *€DÔØ€D„MØ€DÔØ€DÔØ!&€DÔàÐ!Ø Ô/ð "ð "ˆ$Ø×Ò˜DÑ!Ô!Ð!Ð!ð "Ð!ð"ð "r   c                 ó   — | j         S r   )r:   r   s    r   ÚimportszParseContext.imports¬   s
   € àŒ=Ðr   c                 ó   — | j         S r   )r9   r   s    r   r@   zParseContext.import_manager°   s   € àÔÐr   c                 óT   — d| _         t          ¦   «         | j        d<   d | j        d<   d S )NTÚgin)r=   r/   r;   r<   r   s    r   Ú_enable_dynamic_registrationz)ParseContext._enable_dynamic_registration´   s.   € Ø!%€DÔÝ ,¡¤€DÔ�uÑØ!%€DÔ˜ÑÐÐr   Ú	statementc                 óº  — |j         r¶|j                             d¦  «        rœ|j        rt	          d|j        ¦  «        ‚|j                             dd¬¦  «        \  }}|dk    rF| j        r*d„ | j        D ¦   «         }t	          d|› d�|j        ¦  «        ‚|                      ¦   «          n˜t	          d	|j        ¦  «        ‚|j         s|j        rd
gnd}t          |j        |¬¦  «        }| j
        rS|                     ¦   «         }|dk    r%t          d|                     ¦   «         › d�¦  «        ‚|| j        |<   || j        |<   | j                             |¦  «         dS )z&Processes the given `ImportStatement`.z__gin__.z-__gin__ imports do not support `as` aliasing.ú.é   )ÚmaxsplitÚdynamic_registrationc                 ó6   — g | ]}|                      ¦   «         ‘ŒS r-   ©Úformat)Ú.0rA   s     r   ú
<listcomp>z/ParseContext.process_import.<locals>.<listcomp>Â   s    € ÐFÐFÐF°˜dŸkšk™mœmÐFÐFÐFr   zaDynamic registration should be enabled before any other modules are imported.

Already imported: z)Unrecognized __gin__ feature '{feature}'.Ú N)ÚfromlistrF   z<The `gin` symbol is reserved; cannot bind import statement "zd" to `gin`. Use an alias for the import (via `import ... as ...` or `from ... import ... [as ...]`).)Úis_fromÚmoduleÚ
startswithÚaliasÚSyntaxErrorÚlocationÚsplitr:   rG   Ú
__import__r=   Ú
bound_nameÚ
ValueErrorrP   r;   r<   r"   )r   rH   Ú_ÚfeatureÚexisting_importsrT   rV   Únames           r   r?   zParseContext.process_import¹   sÆ  € àÔð .˜YÔ-×8Ò8¸ÑDÔDð .Ø	Œð .ÝÐIØ#Ô,ñ.ô .ð 	.àÔ#×)Ò)¨#¸Ð)Ñ:Ô:�j€aˆØ	Ð*Ò	*Ð	*ØŒ=ð 	"ØFÐF¸¼ÐFÑFÔFÐ
ÝðHØ4DðHð Hð HàÔ ñ"ô "ð "ð 	×)Ò)Ñ+Ô+Ð+Ð+åØ7¸Ô9KñMô Mð 	Mð #Ô*ÐG¨i¬oÐG�"��À4€hÝ˜)Ô*°XÐ>Ñ>Ô>€fØ	Ô	#ð .Ø×#Ò#Ñ%Ô%ˆØ�5Š=ˆ=ÝðNØ×"Ò"Ñ$Ô$ðNð Nð NñOô Oð Oð $*ˆÔ˜4Ñ Ø$-ˆÔ˜DÑ!Ø„M×Ò˜Ñ#Ô#Ð#Ð#Ð#r   c           
      ó‚  — t          ¦   «         }|                     d¦  «        }|d         }| j                             ||¦  «        }||u rt	          d|› d�¦  «        ‚|g}|dd…         D ]Q}t          |d         ||¦  «        }||u rt          d|› d	|d         › d
|› d�¦  «        ‚|                     |¦  «         ŒR||fS )a^  Resolves the given `selector` using this context's symbol table.

    This method breaks the given `selector` into its contituent components
    (names separated by '.'), resolving the first component using this
    `ParseContext`'s symbol table, and each subsequent component as an attribute
    on the resolved value of the previous component.

    Args:
      selector: The selector to resolve into attribute names and values.

    Raises:
      NameError: If the first component of the selector is not a symbol provided
        by some import statement in the current `ParseContext`.
      AttributeError: If an internal component of the selector does is not a
        valid attribute of its parent component.

    Returns:
      A pair of lists `(attr_names, attr_values)`, with the names and values
      corresponding to each component of `selector`.
    rJ   r   ú'z*' was not provided by an import statement.rK   Nr   zCouldn't resolve selector z; z has no attribute )Úobjectr[   r;   ÚgetÚ	NameErrorÚgetattrÚAttributeErrorr"   )	r   ÚselectorÚ	not_foundÚ
attr_namesÚsymbolrV   Ú
attr_chainÚ	attr_nameÚattrs	            r   Ú_resolve_selectorzParseContext._resolve_selectorÙ   s  € õ* ‘”€Ià—’ Ñ$Ô$€JØ˜Œ]€FØÔ×#Ò# F¨IÑ6Ô6€FØ�ÐÐÝÐL˜&ÐLÐLÐLÑMÔMÐMà�€JØ   ”^ð ð ˆ	Ý�Z ”^ Y°	Ñ:Ô:€dØ	�Ð	Ð	Ýð&¨ð &ð &°ZÀ´^ð &ð &Ø"ð&ð &ð &ñ'ô 'ð 	'ð ×Ò˜ÑÔÐÐà�zÐ!Ð!r   c                 óŽ  — |j         s |j        s™|j                             d¦  «        }d}t	          ||dd…         ¦  «        D ]\  }}||k    r n|dz  }Œd                     |d|…         ¦  «        }d                     ||d…         ¦  «        }|                     |¬¦  «        |fS |d                     |dd…         ¦  «        fS )z7Creates an "import source" tuple for a given reference.rJ   r   Nr   rK   ©rV   )rU   rX   rV   r[   ÚzipÚjoinÚ_replace)	r   Úimport_statementrl   Úmodule_partsÚnum_matchesÚmodule_partro   rV   rj   s	            r   Ú_import_sourcezParseContext._import_source  sä   € àÔ#ð :Ð,<Ô,Bð :Ø%Ô,×2Ò2°3Ñ7Ô7€lØ€kÝ$'¨°jÀÀ"À´oÑ$FÔ$Fð ð Ñ
 ˆ+�yØ˜)Ò#Ð#Ø
ˆ%Ø�qÑˆˆØ�xŠx˜ \ k \Ô2Ñ3Ô3€fØ—’˜* [ \ \Ô2Ñ3Ô3€hØ×'Ò'¨vÐ'Ñ6Ô6¸ÐAÐAà §¢¨°A°B°B¬Ñ 8Ô 8Ð9Ð9r   c           	      ó(  — |�^}}}|�^ }}| j         |         }|€|}	n*d                     |                     ¦   «         g|¢¦  «        }	t          |¦  «        }
t	          |||	|                      ||¦  «        d¬¦  «         |
�2t          t          |
j        ¬¦  «        D ]}| 	                    ¦   «          Œt          j        |¦  «        r@t          j        |d         ¦  «        r&|                      |dd…         |dd…         ¦  «         t          |         S )aÆ  Registers the function/class at the end of the named_attrs list.

    In order to support configurable methods, if a method is registered (a
    function whose parent attribute is a class), its parent class will also be
    registered. If the parent class has already been registered, it will be
    re-registered, and any references to the class in the current config will
    be updated (re-initialized) to reference the updated class registration.

    Args:
      attr_names: A list of attribute names, as returned by `_resolve_selector`.
      attr_values: A list of attribute values corresponding to `attr_names`.

    Returns:
      The `Configurable` instance associated with the new registration.
    NrJ   T)rb   rV   Úimport_sourceÚavoid_class_mutation©Útor   )r<   ru   Úpartial_pathÚ_inverse_lookupÚ_make_configurabler{   Úiterate_referencesÚ_CONFIGÚwrapperÚ
initializeÚinspectÚ
isfunctionÚisclassÚ	_registerÚ_INVERSE_REGISTRY)r   rl   Úattr_valuesÚ	root_nameÚinner_namesÚfn_or_cls_nameÚ
path_attrsÚ	fn_or_clsÚsourcerV   ÚoriginalÚ	references               r   r‹   zParseContext._register  s/  € ð  /9Ñ+€I�˜^Ø(Ñ€Z�àÔ  Ô+€FØ€~Ø€f€fà�xŠx˜×,Ò,Ñ.Ô.Ð=°Ð=Ñ>Ô>€få˜yÑ)Ô)€HÝØØØØ×)Ò)¨&°*Ñ=Ô=Ø!ð#ñ #ô #ð #ð ÐÝ)­'°hÔ6FÐGÑGÔGð ð ˆ)Ø×ÒÑÔÐÐåÔ˜)Ñ$Ô$ð 8­¬¸ÀB¼Ñ)HÔ)Hð 8Ø
‡n‚n�Z   ”_ k°#°2°#Ô&6Ñ7Ô7Ð7å˜YÔ'Ð'r   c                 ó  — | j         ra|                      |¦  «        \  }}t          |d         ¦  «        }|€| j        rt	          d|› d�¦  «        ‚|p|                      ||¦  «        S t                               |¦  «        S )z1Get a configurable matching the given `selector`.r   Nz'Encountered unregistered configurable `zJ` in parse only mode. This indicates an internal error. Please file a bug.)r=   rq   r‚   r9   ÚRuntimeErrorr‹   Ú	_REGISTRYÚ	get_match)r   rj   rl   r�   Úexisting_configurables        r   Úget_configurablezParseContext.get_configurable9  s£   € àÔ!ð 	+Ø $× 6Ò 6°xÑ @Ô @Ñ€j�+Ý-¨k¸"¬oÑ>Ô>ÐØ	Ð	&¨4Ô+?Ð	&ÝðJ°hð Jð Jð JñKô Kð 	Kð #ÐM d§n¢n°ZÀÑ&MÔ&MÐMå× Ò  Ñ*Ô*Ð*r   r   )r(   r)   r*   r+   r5   r,   rC   r@   rG   r   ÚImportStatementr?   rq   r{   r‹   r›   r-   r   r   r7   r7   ”   sÐ   € € € € € Ø7Ð7ð"ð "ð "ð "ð* ðð ñ „8ðð ð ð  ñ „8ð ð&ð &ð &ð
$ mÔ&Cð $ð $ð $ð $ð@&"ð &"ð &"ðP:ð :ð :ð'(ð '(ð '(ðR+ð +ð +ð +ð +r   r7   Úreturnc                  ó   — t           d         S r   )Ú_PARSE_CONTEXTSr-   r   r   Ú_parse_contextr    G  s   € Ý	˜Ô	Ðr   c              #   óè   K  — t                                t          | ¦  «        ¦  «         	 t          ¦   «         V — t                                ¦   «          d S # t                                ¦   «          w xY wr   )rŸ   r"   r7   r    r&   ©r@   s    r   Ú_parse_scoper£   K  si   è è € å×Ò� nÑ5Ô5Ñ6Ô6Ð6ðÝ
Ñ
Ô
ÐÐÐå×ÒÑÔÐÐÐø…O×ÒÑÔÐÐøøøs   «A ÁA1FrS   úgin.REQUIREDc                 ó|   — t          j        | ¦  «        D ]&}d|j        v r	|j        c S d|j        v r	|j        c S Œ'dS )zCFind the first __init__ or __new__ method in the given class's MRO.r5   Ú__new__N)rˆ   ÚgetmroÚ__dict__r5   r¦   )ÚclsÚbases     r   Ú_find_class_construction_fnr«   ”  s`   € åŒn˜SÑ!Ô!ð ð €dØ�T”]Ð"Ð"ØŒ]ÐÐÐØ�D”MÐ!Ð!ØŒ\ÐÐÐð "ðð r   c                 ó  ‡ — t          t          ¦  «        t          t          j        ¦  «        t          t          j        ¦  «        f}t          ‰ |¦  «        r-ˆ fd„}‰ j        |_        ‰ j        |_        d|_        ‰ |_	        |S ‰ S )z9Make sure `fn` can be wrapped cleanly by functools.wraps.c                  ó   •—  ‰| i |¤ŽS r   r-   )ÚargsÚkwargsÚfns     €r   ú<lambda>z&_ensure_wrappability.<locals>.<lambda>¤  s   ø€ ¨2¨2¨tÐ+>°vÐ+>Ð+>€ r   rS   )
ÚtypeÚsumre   r5   Ú__call__Ú
isinstancer(   r+   r)   Ú__wrapped__)r°   Úunwrappable_typesÚwrappable_fns   `  r   Ú_ensure_wrappabilityr¹   �  s~   ø€ õ �C‘y”y¥$¥v¤Ñ"7Ô"7½½f¼oÑ9NÔ9NÐOÐÝ�Ð%Ñ&Ô&ð à>Ð>Ð>Ð>€LØœK€LÔØœ:€LÔØ €LÔØ!€LÔØÐð 
€)r   c                 ó˜   — t          j        | d„ ¬¦  «        }t                               |¦  «        }|�|j        |j        f}|s| |v r|S d S )Nc                 ó   — | t           v S r   )rŒ   )Úfs    r   r±   z!_inverse_lookup.<locals>.<lambda>°  s   € °qÕ<MÐ7M€ r   )Ústop)rˆ   ÚunwraprŒ   rf   Úwrappedr†   )r’   Úallow_decoratorsÚ	unwrappedÚconfigurable_Úwrapped_and_wrappers        r   r‚   r‚   ¯  sb   € ÝŒn˜YÐ-MÐ-MÐNÑNÔN€)Ý#×'Ò'¨	Ñ2Ô2€-ØÐØ(Ô0°-Ô2GÐHÐØð ˜9Ð(;Ð;Ð;ØÐØ	ˆr   c                 óæ  ‡ — i }ˆ fd„}t          j        ‰ |¬¦  «        D ]Ñ\  }}|t          v r­t          |         }|j        |j        |fvr!t          d|› d‰ › d|› d|j        › d�	¦  «        ‚|j        }|dz   |j        z   }|                     ||d	¬
¦  «        }|t          |<   t                               |¦  «         |t          |<   |t          |<   |j        ||<   Œ»t          |d	¬¦  «        r|||<   ŒÒ|S )zEFinds methods in `cls` that have been wrapped or registered with Gin.c                 ó4  •— t          j        ‰¦  «        D ]�}t          j        | ¦  «        rk| j        |j        k    r[t	          || j        d ¦  «        | k    rA| j                             d¦  «        }t          |¦  «        dk    r|d         |j        k    r dS Œ‚dS )NrJ   rK   éþÿÿÿTF)	rˆ   r§   r‰   r)   rh   r(   r*   r[   Úlen)Úmaybe_methodrª   Úqualname_partsr©   s      €r   Ú	is_methodz+_find_registered_methods.<locals>.is_method½  s¢   ø€ õ ”˜sÑ#Ô#ð ð ˆÝ
Ô
˜\Ñ
*Ô
*ð Ø
Ô
! T¤_Ò
4Ð
4Ý
�$˜Ô-¨tÑ
4Ô
4¸Ò
DÐ
DØ%Ô2×8Ò8¸Ñ=Ô=ˆÝˆ~ÑÔ Ò"Ð" ~°bÔ'9¸T¼]Ò'JÐ'JØ��øØˆ5r   )Ú	predicatezMethod z
 in class z (z') was registered with a custom module (z�), but the class is also being registered. Avoid specifying a module on the method to allow class registration to modify the method module name.rJ   T)rV   rj   rÊ   )rÀ   )rˆ   Ú
getmembersrŒ   rV   r)   r^   rj   rb   rv   Ú_RENAMED_SELECTORSr˜   r&   r†   r‚   )	r©   rj   Úregistered_methodsrÊ   rb   ÚmethodÚmethod_infoÚold_selectorÚnew_selectors	   `        r   Ú_find_registered_methodsrÓ   ¹  sx  ø€ àÐðð ð ð ð õ  Ô(¨¸	ÐBÑBÔBð *ð *�l€dˆFØÕ"Ð"Ð"Ý% fÔ-€kØ	Ô	 FÔ$5°xÐ#@Ð	@Ð	@ÝðJ�dð Jð J cð Jð J¨Xð Jð JØ)Ô0ðJð Jð JñKô Kð 	Kð
 !Ô)€lØ ‘^ kÔ&6Ñ6€lØ×(Ò(Ø L¸Dð )ñ Bô B€kà)5Õ˜Ñ&Ý‡m‚m�LÑ!Ô!Ð!Ø +…i�ÑØ"-Õ˜ÑØ!,Ô!4Ð˜ÑÐå	˜°$Ð	7Ñ	7Ô	7ð *Ø#)Ð˜4Ñ øØ	Ðr   c                 ór   ‡ ‡— t          ‰ ¦  «        Št          j        ‰j        ¦  «        ˆ ˆfd„¦   «         }|S )a0  Creates a pickle-compatible wrapper for `type(cls).__call__`.

  This function works in tandem with `_decorate_fn_or_cls` below. It wraps
  `type(cls).__call__`, which is in general responsible for creating a new
  instance of `cls` or one of its subclasses. In cases where the to-be-created
  class is Gin's dynamically-subclassed version of `cls`, the wrapper here
  instead returns an instance of `cls`, which isn't a dynamic subclass and more
  generally doesn't have any Gin-related magic applied. This means the instance
  is compatible with pickling, and is totally transparent to any inspections by
  user code (since it really is an instance of the original type).

  Args:
    cls: The class whose metaclass's call method should be wrapped.

  Returns:
    A wrapped version of the `type(cls).__call__`.
  c                 óB   •— | j         ‰fk    r‰}  ‰j        | g|¢R i |¤ŽS r   )Ú	__bases__r´   )Únew_clsr®   r¯   r©   Úcls_metas      €€r   Úmeta_call_wrapperz2_make_meta_call_wrapper.<locals>.meta_call_wrapperù  s=   ø€ ð Ô˜S˜FÒ"Ð"Ø€gØˆ8Ô˜WÐ6 tÐ6Ð6Ð6¨vÐ6Ð6Ð6r   )r²   Ú	functoolsÚwrapsr´   )r©   rÙ   rØ   s   ` @r   Ú_make_meta_call_wrapperrÜ   å  sO   øø€ õ$ �#‰YŒY€(å„?�8Ô$Ñ%Ô%ð
7ð 
7ð 
7ð 
7ð 
7ñ &Ô%ð
7ð 
Ðr   c                 óæ  ‡ ‡— t          j        |¦  «        s ‰ t          |¦  «        ¦  «        S |Š|råt          ‰|¦  «        }|r ˆ fd„|                     ¦   «         D ¦   «         }t          ‰¦  «        }|r|j        }nt          ‰¦  «        } ‰ t          |¦  «        ¦  «        } t          |¦  «        |j        |fd|i¦  «        }	ˆfd„dD ¦   «         }
t          ‰dd¦  «        dk    rd|
d	<   |
 
                    |¦  «          |	‰j        ‰f|
¦  «        }nY‰}t          |¦  «        } ‰ t          |¦  «        ¦  «        }|j        d
k    rt          |¦  «        }t          ||j        |¦  «         |S )a“  Decorate a function or class with the given decorator.

  When `fn_or_cls` is a function, applies `decorator` to the function and
  returns the (decorated) result.

  When `fn_or_cls` is a class and the `avoid_class_mutation` parameter is
  `False`, this will replace either `fn_or_cls.__init__` or `fn_or_cls.__new__`
  (whichever is first implemented in the class's MRO, with a preference for
  `__init__`) with the result of applying `decorator` to it.

  When `fn_or_cls` is a class and `avoid_class_mutation` is `True`, this will
  dynamically construct a subclass of `fn_or_cls` using a dynamically
  constructed metaclass (which itself is a subclass of `fn_or_cls`'s metaclass).
  The metaclass's `__call__` method is wrapped using `decorator` to
  intercept/inject parameters for class construction. The resulting subclass has
  metadata (docstring, name, and module information) copied over from
  `fn_or_cls`, and should behave like the original as much possible, without
  modifying it (for example, inspection operations using `issubclass` should
  behave the same way as on the original class). When constructed, an instance
  of the original (undecorated) class is returned.

  Args:
    decorator: The decorator to use.
    fn_or_cls: The function or class to decorate.
    selector: The Gin selector for `fn_or_cls`. This is used to modify method
      modules to match the overall class selector.
    avoid_class_mutation: Whether to avoid class mutation using dynamic
      subclassing. This argument is ignored if `fn_or_cls` is not a class.
    decorate_methods: Whether to also decorate Gin-registered methods.

  Returns:
    The decorated function or class.
  c                 ó.   •— i | ]\  }}| ‰|¦  «        “ŒS r-   r-   )rQ   rb   rÏ   Ú	decorators      €r   ú
<dictcomp>z'_decorate_fn_or_cls.<locals>.<dictcomp>:  s6   ø€ ð ð ð Ù&2 d¨Fˆ$�	�	˜&Ñ!Ô!ðð ð r   r´   c                 ó2   •— i | ]}|t          ‰|¦  «        “ŒS r-   )rh   )rQ   rp   r©   s     €r   rà   z'_decorate_fn_or_cls.<locals>.<dictcomp>Z  s5   ø€ ð ð ð àð 	�g�c˜4Ñ Ô ðð ð r   )r)   r(   r*   r+   Ú__dictoffset__Nr   r-   Ú	__slots__r¦   )rˆ   rŠ   r¹   rÓ   Úitemsr²   r´   rÜ   r(   rh   Úupdater«   ÚstaticmethodÚsetattr)rß   r’   rj   r~   Údecorate_methodsÚmethod_overridesrØ   Ú	meta_callÚdecorated_callÚdecorating_metaÚ	overridesÚdecorated_classÚconstruction_fnÚdecorated_fnr©   s   `             @r   Ú_decorate_fn_or_clsrñ   	  sà  øø€ õL 
Œ˜Ñ	#Ô	#ð 6Øˆ9Õ)¨)Ñ4Ô4Ñ5Ô5Ð5Ø€#Øð ?Eõ 0°°XÑ>Ô>ÐØð ðð ð ð Ø6F×6LÒ6LÑ6NÔ6Nðñ ô Ðõ �C‰yŒy€HØð /ð
 Ô#€i€iõ *¨#Ñ.Ô.€ià�YÕ3°IÑ>Ô>Ñ?Ô?€Nð
 %•d˜8‘n”n XÔ%6¸¸Ø�NðFñ ô €Oðð ð ð àIðñ ô €Iõ ˆsÐ$ dÑ+Ô+¨qÒ0Ð0Ø!€i�Ñà×ÒÐ%Ñ&Ô&Ð&à%�o c¤l°S°F¸IÑFÔF€O€Oð
 €OÝ1°/ÑBÔB€OØ�9Õ1°/ÑBÔBÑCÔC€LØÔ 9Ò,Ð,Ý! ,Ñ/Ô/€lÝˆO˜_Ô5°|ÑDÔDÐDØ	Ðr   c                   óä   — e Zd ZU edef         ed<   edef         ed<   eed<   eed<   eee	j
        ef                  ed<   eee                  ed<   eee                  ed<   eed	<   d
Zeed<   dS )ÚConfigurable.r†   r¿   rb   rV   r}   Ú	allowlistÚdenylistrj   FrÊ   N)r(   r)   r*   r   r   Ú__annotations__Ústrr   r	   r   rœ   r   rÊ   Úboolr-   r   r   ró   ró   u  s¯   € € € € € € Ø�C˜�HÔÐÐÑØ�C˜�HÔÐÐÑØ€)€)�)Ø
€+€+�+Ø˜% Ô =¸sÐ BÔCÔDÐDÐDÑDØ�h˜s”mÔ$Ð$Ð$Ñ$Ø�X˜c”]Ô#Ð#Ð#Ñ#Ø€-€-�-Ø€)ˆTÐÐÑÐÐr   ró   c                 ón   — d}| j         rdnd}t          |                     | j        ||¦  «        ¦  «        ‚)Nz-No configurable matching reference '@{}{}'.{}ú()rS   )Úevaluater^   rP   rj   )ÚrefÚadditional_msgÚerr_strÚmaybe_parenss       r   Ú_raise_unknown_reference_errorr   �  s7   € Ø;€'ØœÐ-��¨2€,Ý�7—>’> #¤,°¸nÑMÔMÑNÔNÐNr   c                 ó(   — t          d| › d�¦  «        ‚)NzNo configurable matching 'z'.)r^   )rj   s    r   Ú!_raise_unknown_configurable_errorr  ‡  s   € ÝÐ<°Ð<Ð<Ð<Ñ=Ô=Ð=r   c                 ó\   ‡— ˆfd„}‰rt          || j        | j        dd¬¦  «        S | j        S )aŠ  Decorates `configurable`, using the given `scope_components`.

  Args:
    configurable_: A `Configurable` instance, whose `wrapper` attribute should
      be decorated.
    scope_components: The list of scope components to use as a scope (e.g., as
      returned by `current_scope`).

  Returns:
    A callable function or class, that applies the given scope to
    `configurable_.wrapper`.
  c                 óJ   •‡ — t          j        ‰ ¦  «        ˆ ˆfd„¦   «         }|S )Nc                  óf   •— t          ‰¦  «        5   ‰| i |¤Žcd d d ¦  «         S # 1 swxY w Y   d S r   )Úconfig_scope)r®   r¯   r’   Úscope_componentss     €€r   Úscoping_wrapperzF_decorate_with_scope.<locals>.scope_decorator.<locals>.scoping_wrapper›  sˆ   ø€ åÐ(Ñ)Ô)ð *ð *Øˆy˜$Ð) &Ð)Ð)ð*ð *ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *ð *ð *s   ‘&¦*­*)rÚ   rÛ   )r’   r  r  s   ` €r   Úscope_decoratorz-_decorate_with_scope.<locals>.scope_decorator™  s?   øø€ å„_�YÑÔð*ð *ð *ð *ð *ñ  Ôð*ð Ðr   T)r~   rè   )rñ   r†   rj   )rÂ   r  r	  s    ` r   Ú_decorate_with_scoper
  ‹  s]   ø€ ðð ð ð ð ð ð !ÝØØÔØÔØ!Øðñ ô ð ð Ô Ð r   c                   óÖ   — e Zd ZdZd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
ed„ ¦   «         Zed	„ ¦   «         Zed
„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚConfigurableReferencez;Represents a reference to a configurable function or class.c                 óJ   — || _         || _        |                      ¦   «          d S r   )Ú_scoped_selectorÚ	_evaluater‡   )r   Úscoped_selectorrû   s      r   r5   zConfigurableReference.__init__°  s'   € Ø+€DÔØ€D„NØ‡O‚OÑÔÐÐÐr   c                 ó  — | j                              d¦  «        �^ | _        | _        t	          ¦   «                              | j        ¦  «        | _        | j        st          | ¦  «         t          | j        | j        ¬¦  «        | _	        d S )Nú/©r  )
r  r[   Ú_scopesÚ	_selectorr    r›   Ú_configurabler   r
  Ú_scoped_configurable_fnr   s    r   r‡   z ConfigurableReference.initializeµ  s   € Ø$(Ô$9×$?Ò$?ÀÑ$DÔ$DÑ!€T„\�4”>Ý'Ñ)Ô)×:Ò:¸4¼>ÑJÔJ€DÔØÔð +Ý$ TÑ*Ô*Ð*Ý#7ØÔ¨T¬\ð$;ñ $;ô $;€DÔ Ð Ð r   c                 ó   — | j         S r   )r  r   s    r   Úconfigurablez"ConfigurableReference.configurable½  s   € àÔÐr   c                 ó   — | j         S r   )r  r   s    r   Úscoped_configurable_fnz,ConfigurableReference.scoped_configurable_fnÁ  s   € àÔ'Ð'r   c                 ó   — | j         S r   )r  r   s    r   ÚscopeszConfigurableReference.scopesÅ  s
   € àŒ<Ðr   c                 ó   — | j         S r   ©r  r   s    r   rj   zConfigurableReference.selectorÉ  ó
   € àŒ>Ðr   c                 ó   — | j         S r   )r  r   s    r   r  z%ConfigurableReference.scoped_selectorÍ  s   € àÔ Ð r   c                 óN   — d                      | j        ¦  «        | j        j        fS ©Nr  )ru   r  r  rj   r   s    r   Ú
config_keyz ConfigurableReference.config_keyÑ  s!   € à�HŠH�T”\Ñ"Ô" DÔ$6Ô$?Ð@Ð@r   c                 ó   — | j         S r   ©r  r   s    r   rû   zConfigurableReference.evaluateÕ  r   r   c                 óp   — t          || j        ¦  «        r | j        |j        k    o| j        |j        k    S dS ©NF)rµ   Ú	__class__r  r  ©r   Úothers     r   Ú__eq__zConfigurableReference.__eq__Ù  sA   € Ý�%˜œÑ(Ô(ð 1àÔ  EÔ$7Ò7ð 0ØŒn ¤Ò/ð1ð ˆ5r   c                 ó.   — |                       |¦  «         S r   )r,  r*  s     r   Ú__ne__zConfigurableReference.__ne__á  s   € Ø�{Š{˜5Ñ!Ô!Ð!Ð!r   c                 ó:   — t          t          | ¦  «        ¦  «        S r   )ÚhashÚreprr   s    r   Ú__hash__zConfigurableReference.__hash__ä  s   € Ý•�T‘
”
ÑÔÐr   c                 ó|  — | j         j        }|t          t          fv r$| j        rdd                     | j        ¦  «        z   S | j        rdnd}t          ¦   «         j        }|�"|j	        r| 
                    | j         ¦  «        }n| j        }d                     g | j        ¢|‘¦  «        }d                     ||¦  «        S )Nú%r  rú   rS   z@{}{})r  r¿   r1   r2   r  ru   r  r    r@   rM   Úminimal_selectorrj   r  rP   )r   Úconfigurable_fnrÿ   r@   rj   r  s         r   Ú__repr__zConfigurableReference.__repr__ç  s½   € ð Ô(Ô0€OØ�5Õ"4Ð5Ð5Ð5¸$¼.Ð5Ø�3—8’8˜DœLÑ)Ô)Ñ)Ð)Øœ>Ð1�4�4¨r€LÝ#Ñ%Ô%Ô4€NØÐ! nÔ&IÐ!Ø×0Ò0°Ô1CÑDÔD€h€hà”€hØ—h’hÐ7 ¤Ð7¨hÐ7Ñ8Ô8€OØ�>Š>˜/¨<Ñ8Ô8Ð8r   c                 óF   — | j         r|                      ¦   «         S | j        S )a[  Dishonestly implements the __deepcopy__ special method.

    When called, this returns either the `ConfigurableReference` instance itself
    (when `self._evaluate` is `False`) or the result of calling the underlying
    configurable. Configurable references may be deeply nested inside other
    Python data structures, and by providing this implementation,
    `copy.deepcopy` can be used on the containing Python structure to return a
    copy replacing any `ConfigurableReference` marked for evaluation with its
    corresponding configurable's output.

    Args:
      memo: The memoization dict (unused).

    Returns:
      When `self._evaluate` is `False`, returns the underlying configurable
      (maybe wrapped to be called in the proper scope). When `self._evaluate` is
      `True`, returns the output of calling the underlying configurable.
    )r  r  )r   Úmemos     r   Ú__deepcopy__z"ConfigurableReference.__deepcopy__ö  s)   € ð& „~ð ,Ø×)Ò)Ñ+Ô+Ð+ØÔ'Ð'r   N)r(   r)   r*   r+   r5   r‡   r,   r  r  r  rj   r  r$  rû   r,  r.  r2  r7  r:  r-   r   r   r  r  ­  sC  € € € € € ØCÐCðð ð ð
;ð ;ð ;ð ðð ñ „8ðð ð(ð (ñ „8ð(ð ðð ñ „8ðð ðð ñ „8ðð ð!ð !ñ „8ð!ð ðAð Añ „8ðAð ðð ñ „8ððð ð ð"ð "ð "ðð ð ð9ð 9ð 9ð(ð (ð (ð (ð (r   r  c                   óJ   — e Zd ZdZd„ Zed„ ¦   «         Zed„ ¦   «         Zd„ ZdS )Ú_UnknownConfigurableReferencez®Represents a reference to an unknown configurable.

  This class acts as a substitute for `ConfigurableReference` when the selector
  doesn't match any known configurable.
  c                 óT   — |                      d¦  «        d         | _        || _        d S )Nr  r   )r[   r  r  )r   rj   rû   s      r   r5   z&_UnknownConfigurableReference.__init__  s%   € Ø—^’^ CÑ(Ô(¨Ô,€D„NØ€D„N€N€Nr   c                 ó   — | j         S r   r  r   s    r   rj   z&_UnknownConfigurableReference.selector  r   r   c                 ó   — | j         S r   r&  r   s    r   rû   z&_UnknownConfigurableReference.evaluate  r   r   c                 ó*   — d}t          | |¦  «         dS )ar  Dishonestly implements the __deepcopy__ special method.

    See `ConfigurableReference` above. If this method is called, it means there
    was an attempt to use this unknown configurable reference, so we throw an
    error here.

    Args:
      memo: The memoization dict (unused).

    Raises:
      ValueError: To report that there is no matching configurable.
    z=

    To catch this earlier, ensure gin.finalize() is called.N)r   )r   r9  Úaddl_msgs      r   r:  z*_UnknownConfigurableReference.__deepcopy__!  s    € ð Q€HÝ" 4¨Ñ2Ô2Ð2Ð2Ð2r   N)	r(   r)   r*   r+   r5   r,   rj   rû   r:  r-   r   r   r<  r<    sr   € € € € € ðð ðð ð ð ðð ñ „8ðð ðð ñ „8ðð3ð 3ð 3ð 3ð 3r   r<  c                 óž   — t          | t          t          t          t          f¦  «        s$d}t          |                     | ¦  «        ¦  «        ‚d S )Nz$Invalid value for `skip_unknown`: {})rµ   rø   ÚlistÚtupleÚsetr^   rP   )Úskip_unknownrþ   s     r   Ú_validate_skip_unknownrG  2  sF   € Ý	�L¥4­­uµcÐ":Ñ	;Ô	;ð 3Ø4€GÝ
�W—^’^ LÑ1Ô1Ñ
2Ô
2Ð2ð3ð 3r   c                 ó¨   — t          |¦  «         t                               | ¦  «        rdS t          |t          t
          t          f¦  «        r| |v S |S )z9Checks whether `selector` should be skipped (if unknown).F)rG  r˜   Úmatching_selectorsrµ   rC  rD  rE  )rj   rF  s     r   Ú_should_skiprJ  8  sU   € å˜Ñ&Ô&Ð&Ý×!Ò! (Ñ+Ô+ð Øˆ5Ý��t¥U­CÐ0Ñ1Ô1ð $Ø�|Ð#Ð#Ø	Ðr   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚParserDelegatezBDelegate to handle creation of configurable references and macros.Fc                 ó   — || _         d S r   )Ú_skip_unknown)r   rF  s     r   r5   zParserDelegate.__init__E  s   € Ø%€DÔÐÐr   c                 ó¤   — |                      dd¦  «        d         }t          || j        ¦  «        rt          ||¦  «        S t	          ||¦  «        S )Nr  rK   r   )ÚrsplitrJ  rN  r<  r  )r   r  rû   Úunscoped_selectors       r   Úconfigurable_referencez%ParserDelegate.configurable_referenceH  sT   € Ø'×.Ò.¨s°AÑ6Ô6°rÔ:ÐÝÐ% tÔ'9Ñ:Ô:ð FÝ*¨?¸HÑEÔEÐEÝ  °(Ñ;Ô;Ð;r   c                 ó  — t                                |¦  «        }|rSt          |¦  «        dk    r|d         }t          |dz   d¦  «        S d}t	          |                     ||¦  «        ¦  «        ‚t          |dz   d¦  «        S )NrK   r   z/gin.constantTú-Ambiguous constant selector '{}', matches {}.z
/gin.macro)Ú
_CONSTANTSrI  rÇ   r  r^   rP   )r   rb   rI  rþ   s       r   r1   zParserDelegate.macroN  s‰   € Ý#×6Ò6°tÑ<Ô<ÐØð AÝ	ÐÑ	 Ô	  AÒ	%Ð	%Ø! !Ô$ˆÝ$ T¨OÑ%;¸TÑBÔBÐBØ?€gÝ�w—~’~ dÐ,>Ñ?Ô?Ñ@Ô@Ð@Ý  ¨Ñ!4°dÑ;Ô;Ð;r   N©F)r(   r)   r*   r+   r5   rR  r1   r-   r   r   rL  rL  B  sL   € € € € € ØJÐJð&ð &ð &ð &ð<ð <ð <ð<ð <ð <ð <ð <r   rL  c                   óŠ   — e Zd ZU dZeed<   eed<   eed<   eed<   ed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
d	„ Zd
„ ZdS )ÚParsedBindingKeyaÖ  Represents a parsed and validated binding key.

  A "binding key" identifies a specific parameter (`arg_name`), of a specific
  configurable (`complete_selector`), in a specific scope (`scope`), to which a
  value may be bound in the global configuration. The `given_selector` field
  retains information about how the original configurable selector was
  specified, which can be helpful for error messages (but is ignored for the
  purposes of equality and hashing).
  r#   Úgiven_selectorÚcomplete_selectorÚarg_namec                 ó®  — t          |t          ¦  «        r | |Ž S t          |t          t          f¦  «        r|\  }}}n_t          |t          ¦  «        rt          j        |¦  «        \  }}}n1d}t          |                     t          |¦  «        ¦  «        ¦  «        ‚t          ¦   «                              |¦  «        }|st          |¦  «         |j        rId|vrE|j                             d¦  «        d         }d}t          |                     ||¦  «        ¦  «        ‚t!          |j        |¦  «        s%d}t          |                     ||¦  «        ¦  «        ‚|j        r.||j        vr%d}t          |                     ||¦  «        ¦  «        ‚|j        r.||j        v r%d}t          |                     ||¦  «        ¦  «        ‚ | |||j        |¬¦  «        S )	a¤  Parses and validates the given binding key.

    This function will parse `binding_key` (if necessary), and ensure that the
    specified parameter can be bound for the given configurable selector (i.e.,
    that the parameter isn't denylisted or not allowlisted if an allowlist was
    provided).

    Args:
      binding_key: A spec identifying a parameter of a configurable (maybe in
        some scope). This should either be a string of the form
        'maybe/some/scope/maybe.modules.configurable_name.parameter_name'; or a
        list or tuple of `(scope, selector, arg_name)`; or another instance of
        `ParsedBindingKey`.

    Returns:
      A new instance of `ParsedBindingKey`.

    Raises:
      ValueError: If no function can be found matching the configurable name
        specified by `binding_key`, or if the specified parameter name is
        denylisted or not in the function's allowlist (if present).
    z!Invalid type for binding_key: {}.rJ   rÆ   z/Method '{}' referenced without class name '{}'.z6Configurable '{}' doesn't have a parameter named '{}'.z>Configurable '{}' doesn't include kwarg '{}' in its allowlist.z,Configurable '{}' has denylisted kwarg '{}'.)r#   rY  rZ  r[  )rµ   rX  rC  rD  r÷   r   Úparse_binding_keyr^   rP   r²   r    r›   r  rÊ   rj   r[   Ú_might_have_parameterr†   rô   rõ   )r©   Úbinding_keyr#   rj   r[  rþ   rÂ   Ú
class_names           r   ÚparsezParsedBindingKey.parsei  sê  € õ0 �+Õ/Ñ0Ô0ð ØˆS�+ÐÐå�+¥¥e˜}Ñ-Ô-ð :Ø"-Ñ€eˆX�x�xÝ	�K¥Ñ	%Ô	%ð :Ý"/Ô"AÀ+Ñ"NÔ"NÑ€eˆX�x�xà3€gÝ�w—~’~¥d¨;Ñ&7Ô&7Ñ8Ô8Ñ9Ô9Ð9å"Ñ$Ô$×5Ò5°hÑ?Ô?€MØð 2Ý'¨Ñ1Ô1Ð1àÔð = 3¨hÐ#6Ð#6Ø Ô)×/Ò/°Ñ4Ô4°RÔ8€jØA€gÝ�w—~’~ h°
Ñ;Ô;Ñ<Ô<Ð<å  Ô!6¸ÑAÔAð ;ØH€gÝ�w—~’~ h°Ñ9Ô9Ñ:Ô:Ð:àÔð ; 8°=Ô3JÐ#JÐ#JØP€gÝ�w—~’~ h°Ñ9Ô9Ñ:Ô:Ð:àÔð ; (¨mÔ.DÐ"DÐ"DØ>€gÝ�w—~’~ h°Ñ9Ô9Ñ:Ô:Ð:àˆ3ØØØ'Ô0Øð	ñ ô ð r   c                 ó   — | j         | j        fS r   )r#   rZ  r   s    r   r$  zParsedBindingKey.config_key§  s   € àŒ:�tÔ-Ð-Ð-r   c                 ó*   — | j         | j        | j        fS r   )r#   rZ  r[  r   s    r   Úscope_selector_argz#ParsedBindingKey.scope_selector_arg«  s   € àŒ:�tÔ-¨t¬}Ð<Ð<r   c                 ó"   — | j         |j         k    S r   )rd  r*  s     r   Ú	__equal__zParsedBindingKey.__equal__¯  s   € ð Ô" eÔ&>Ò>Ð>r   c                 ó*   — t          | j        ¦  «        S r   )r0  rd  r   s    r   r2  zParsedBindingKey.__hash__´  s   € Ý�Ô'Ñ(Ô(Ð(r   N)r(   r)   r*   r+   r÷   rö   Úclassmethodra  r,   r$  rd  rf  r2  r-   r   r   rX  rX  Y  sº   € € € € € € ðð ð 
€*€*�*ØÐÐÑØÐÐÑØ€-€-�-àð;ð ;ñ „;ð;ðz ð.ð .ñ „8ð.ð ð=ð =ñ „8ð=ð?ð ?ð ?ð
)ð )ð )ð )ð )r   rX  c                 ór   — t          | ¦  «        }	 t          |¦  «        | k    r|S n# t          $ r Y nw xY wdS )ap  Returns `value` in a format parseable by `parse_value`, or `None`.

  Simply put, This function ensures that when it returns a string value, the
  following will hold:

      parse_value(_format_value(value)) == value

  Args:
    value: The value to format.

  Returns:
    A string representation of `value` when `value` is literally representable,
    or `None`.
  N)r1  Úparse_valuerY   )ÚvalueÚliterals     r   Ú_format_valuerm  ¸  sV   € õ �‰KŒK€'ð	Ý�7ÑÔ˜uÒ$Ð$Ø€nð %øå	ð 	ð 	ð 	Ø€Dð	øøøà	ˆs   ‘' §
4³4c                 ó$   — t          | ¦  «        duS )zèReturns `True` if `value` can be (parseably) represented as a string.

  Args:
    value: The value to check.

  Returns:
    `True` when `value` can be represented as a string parseable by
    `parse_literal`, `False` otherwise.
  N)rm  ©rk  s    r   Ú_is_literally_representablerp  Ð  s   € õ 
�uÑ	Ô	 TÐ	)Ð)r   c                 ó:  — t          d¦  «         t                               ¦   «          t                               ¦   «          | r)t                               ¦   «          t
          t          d<   n\t                               ¦   «         }t                               ¦   «          |                     ¦   «         D ]\  }}t          ||¦  «         Œt                               ¦   «          t          5  t                               ¦   «          ddd¦  «         dS # 1 swxY w Y   dS )ap  Clears the global configuration.

  This clears any parameter values set by `bind_parameter` or `parse_config`, as
  well as the set of dynamically imported modules. It does not remove any
  configurable functions or classes from the registry of configurables.

  Args:
    clear_constants: Whether to clear constants created by `constant`. Defaults
      to False.
  Fr¤   N)Ú_set_config_is_lockedr…   ÚclearÚ_SINGLETONSrU  ÚREQUIREDÚcopyrä   r3   Ú_IMPORTSÚ_OPERATIVE_CONFIG_LOCKÚ_OPERATIVE_CONFIG)Úclear_constantsÚsaved_constantsrb   rk  s       r   Úclear_configr|  Ý  s7  € õ ˜ÑÔÐÝ	‡-‚-�/„/€/Ý×ÒÑÔÐØð Ý×ÒÑÔÐÝ!)…Jˆ~ÑÐå —o’oÑ'Ô'€OÝ×ÒÑÔÐØ&×,Ò,Ñ.Ô.ð ð ‰ˆˆeÝˆt�UÑÔÐÐÝ
‡.‚.ÑÔÐÝð ð Ý×ÒÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   Ã)DÄDÄDc                 óÈ   — t          ¦   «         rt          d¦  «        ‚t                               | ¦  «        }t                               |j        i ¦  «        }|||j        <   dS )a  Binds the parameter value specified by `binding_key` to `value`.

  The `binding_key` argument should either be a string of the form
  `maybe/scope/optional.module.names.configurable_name.parameter_name`, or a
  list or tuple of `(scope, selector, parameter_name)`, where `selector`
  corresponds to `optional.module.names.configurable_name`. Once this function
  has been called, subsequent calls (in the specified scope) to the specified
  configurable function will have `value` supplied to their `parameter_name`
  parameter.

  Example:

      @configurable('fully_connected_network')
      def network_fn(num_layers=5, units_per_layer=1024):
         ...

      def main(_):
        config.bind_parameter('fully_connected_network.num_layers', 3)
        network_fn()  # Called with num_layers == 3, not the default of 5.

  Args:
    binding_key: The parameter whose value should be set. This can either be a
      string, or a tuple of the form `(scope, selector, parameter)`.
    value: The desired value.

  Raises:
    RuntimeError: If the config is locked.
    ValueError: If no function can be found matching the configurable name
      specified by `binding_key`, or if the specified parameter name is
      denylisted or not in the function's allowlist (if present).
  z&Attempted to modify locked Gin config.N)Úconfig_is_lockedr—   rX  ra  r…   Ú
setdefaultr$  r[  )r_  rk  ÚpbkÚfn_dicts       r   Úbind_parameterr‚  ø  s_   € õ@ ÑÔð AÝ
Ð?Ñ
@Ô
@Ð@å×Ò˜{Ñ+Ô+€#Ý×Ò˜sœ~¨rÑ2Ô2€'Ø€'ˆ#Œ,ÑÐÐr   c                 óœ  — t           j                             | ¦  «        rxt                               | ¦  «        }t          |¦  «        dk    rt          |d                  S t          |¦  «        dk    r%d}t          |                     | |¦  «        ¦  «        ‚t           	                    | ¦  «        }|j
        t          vr)d}t          |                     |j        ¦  «        ¦  «        ‚|j        t          |j
                 vr/d}t          |                     |j        |j        ¦  «        ¦  «        ‚t          |j
                 |j                 S )aÉ  Returns the currently bound value to the specified `binding_key`.

  The `binding_key` argument should look like
  'maybe/some/scope/maybe.modules.configurable_name.parameter_name'. Note that
  this will not include default parameters.

  Args:
    binding_key: The parameter whose value should be queried.

  Returns:
    The value bound to the configurable/parameter combination given in
    `binding_key`.

  Raises:
    ValueError: If no function can be found matching the configurable name
      specified by `binding_key`, or if the specified parameter name is
      denylisted or not in the function's allowlist (if present) or if there is
      no value bound for the queried parameter or configurable.
  rK   r   rT  z*Configurable '{}' has no bound parameters.z8Configurable '{}' has no value bound for parameter '{}'.)r   Ú	MODULE_REÚmatchrU  rI  rÇ   r^   rP   rX  ra  r$  r…   rY  r[  )r_  rI  rþ   r€  s       r   Úquery_parameterr†     s  € õ( Ô×"Ò" ;Ñ/Ô/ð HÝ#×6Ò6°{ÑCÔCÐÝ
ÐÑÔ !Ò#Ð#ÝÐ*¨1Ô-Ô.Ð.Ý	ÐÑ	 Ô	  1Ò	$Ð	$Ø?€gÝ�w—~’~ kÐ3EÑFÔFÑGÔGÐGÝ×Ò˜{Ñ+Ô+€#Ø„^�7Ð"Ð"Ø:€GÝ
�W—^’^ CÔ$6Ñ7Ô7Ñ
8Ô
8Ð8Ø„\� ¤Ô0Ð0Ð0ØH€GÝ
�W—^’^ CÔ$6¸¼ÑEÔEÑ
FÔ
FÐFÝ	�”Ô	  ¤Ô	.Ð.r   c                 óð   — t          j        | ¦  «        rt          | ¦  «        }n| }t          |d¦  «        r|j        }t          |d¦  «        °t          |¦  «        }|j        rdS ||j        v p||j        v S )ag  Returns True if `arg_name` might be a valid parameter for `fn_or_cls`.

  Specifically, this means that `fn_or_cls` either has a parameter named
  `arg_name`, or has a `**kwargs` parameter.

  Args:
    fn_or_cls: The function or class to check.
    arg_name: The name fo the parameter.

  Returns:
    Whether `arg_name` might be a valid argument of `fn`.
  r¶   T)	rˆ   rŠ   r«   r   r¶   Ú_get_cached_arg_specÚvarkwr®   Ú
kwonlyargs)r’   r[  r°   Úarg_specs       r   r^  r^  E  s�   € õ „_�YÑÔð Ý	$ YÑ	/Ô	/€B€Bà	€Bå��MÑ"Ô"ð Ø	Œ€Bõ 	��MÑ"Ô"ð å! "Ñ%Ô%€(Ø„^ð Øˆ4Ø	�X”]Ð	"Ð	E h°(Ô2EÐ&EÐEr   c                 óŠ   — |pg D ]=}t          | |¦  «        s+d}t          |                     ||| j        ¦  «        ¦  «        ‚Œ>d S )Nz,Argument '{}' in {} not a parameter of '{}'.)r^  r^   rP   r(   )r’   Úarg_name_listÚ
err_prefixr[  rþ   s        r   Ú_validate_parametersr�  _  sc   € ØÐ% 2ð Qð Q€hÝ  ¨HÑ5Ô5ð QØ>€gÝ�w—~’~ h°
¸IÔ<NÑOÔOÑPÔPÐPðQðQð Qr   c                 óÐ   — t                                | ¦  «        }|€I	 t          j        | ¦  «        }n)# t          $ r t          j        | j        ¦  «        }Y nw xY w|t           | <   |S )zGets cached argspec for `fn`.)Ú_ARG_SPEC_CACHErf   rˆ   ÚgetfullargspecÚ	TypeErrorr´   )r°   r‹  s     r   rˆ  rˆ  f  st   € å× Ò  Ñ$Ô$€(ØÐð5ÝÔ'¨Ñ+Ô+€h€høÝð 5ð 5ð 5åÔ'¨¬Ñ4Ô4€h€h€hð5øøøð #…O�BÑØ	€/s   ž3 ³#AÁAc                 óX   — t          | ¦  «        }|j        dt          |¦  «        …         S )zBReturns the names of the supplied arguments to the given function.N)rˆ  r®   rÇ   )r°   r®   r‹  s      r   Ú(_get_supplied_positional_parameter_namesr•  s  s&   € å! "Ñ%Ô%€(à	Œ�z�˜D™	œ	�zÔ	"Ð"r   c                 óz   — t          | ¦  «        }|j        }|j        r|dt          |j        ¦  «         …         }|S )zDReturns the names of all positional arguments to the given function.N)rˆ  r®   ÚdefaultsrÇ   )r°   r‹  r®   s      r   Ú#_get_all_positional_parameter_namesr˜  z  sD   € å! "Ñ%Ô%€(Ø	Œ€$ØÔð *ØÐ(•#�hÔ'Ñ(Ô(Ð(Ð(Ô)€DØ	€+r   c                 ó  — t          | ¦  «        }|j        rE|j        t          |j        ¦  «         d…         }t	          t          ||j        ¦  «        ¦  «        }ni }|j        r|                     |j        ¦  «         |S )zGReturns a dict mapping kwargs to default values for the given function.N)rˆ  r—  r®   rÇ   Údictrt   Úkwonlydefaultsrå   )r°   r‹  Údefault_kwarg_namesÚarg_valss       r   Ú_get_kwarg_defaultsrž  ƒ  s‚   € å! "Ñ%Ô%€(ØÔð Ø"œ-­¨XÔ->Ñ)?Ô)?Ð(?Ð(@Ð(@ÔAÐÝ•CÐ+¨XÔ->Ñ?Ô?Ñ@Ô@€H€Hà€HàÔð -Ø‡O‚O�HÔ+Ñ,Ô,Ð,à	€/r   c                 óD  — t          | ¦  «        }g }|                     ¦   «         D ]y\  }}|t          u rk|r)||v r%d}t          |                     ||¦  «        ¦  «        ‚|r)||vr%d}t          |                     ||¦  «        ¦  «        ‚|                     |¦  «         Œz|S )zCGets required argument names, and validates against allow/denylist.z3Argument '{}' of {} marked REQUIRED but denylisted.z8Argument '{}' of {} marked REQUIRED but not allowlisted.)rž  rä   ru  r^   rP   r"   )	r°   Úfn_descriptorrô   rõ   Úkwarg_defaultsÚrequired_kwargsÚkwargÚdefaultrþ   s	            r   Ú_get_validated_required_kwargsr¥  ’  s¿   € å& rÑ*Ô*€.à€/Ø&×,Ò,Ñ.Ô.ð $ð $�n€eˆWØ•(ÐÐØ	ð ?�e˜xÐ'Ð'ØGˆÝ˜Ÿš¨¨}Ñ=Ô=Ñ>Ô>Ð>Ø	ð ?�u IÐ-Ð-ØLˆÝ˜Ÿš¨¨}Ñ=Ô=Ñ>Ô>Ð>Ø×Ò˜UÑ#Ô#Ð#øà	Ðr   c                 óœ   — t          | ¦  «        }t          |¦  «        D ],}|o||v}|o||v }t          ||         ¦  «        }|s|s|s||= Œ-|S )aê  Retrieve all default values for configurable parameters of a function.

  Any parameters included in the supplied denylist, or not included in the
  supplied allowlist, are excluded.

  Args:
    fn: The function whose parameter values should be retrieved.
    allowlist: The allowlist (or `None`) associated with the function.
    denylist: The denylist (or `None`) associated with the function.

  Returns:
    A dictionary mapping configurable parameter names to their default values.
  )rž  rC  rp  )r°   rô   rõ   r�  ÚkÚallowlist_failÚdenylist_failÚrepresentables           r   Ú*_get_default_configurable_parameter_valuesr«  ¤  sy   € õ ! Ñ$Ô$€(õ �‰>Œ>ð ð €aØÐ5 1¨IÐ#5€NØÐ.  h €MÝ/°¸´Ñ<Ô<€MØð ˜ð ¨mð Ø
�1ˆ+øà	€/r   c                 óð   ‡‡— t          | ¦  «        }t          |j        ¦  «        }|j        r|                     |j        ¦  «         ˆfd„|D ¦   «         Š‰                     ˆfd„‰D ¦   «         ¦  «         ‰S )zGOrders given `arg_names` based on their order in the signature of `fn`.c                 ó   •— g | ]}|‰v ¯|‘Œ	S r-   r-   )rQ   ÚargÚ	arg_namess     €r   rR   z'_order_by_signature.<locals>.<listcomp>Æ  s#   ø€ Ð9Ð9Ð9�S¨¨yÐ(8Ð(8ˆSÐ(8Ð(8Ð(8r   c                 ó   •— g | ]}|‰v¯|‘Œ	S r-   r-   )rQ   r®  Úordereds     €r   rR   z'_order_by_signature.<locals>.<listcomp>È  s#   ø€ ÐAÐAÐA˜#¨c¸Ð.@Ð.@�#Ð.@Ð.@Ð.@r   )rˆ  rC  r®   rŠ  Úextend)r°   r¯  r‹  Úall_argsr±  s    `  @r   Ú_order_by_signaturer´  À  s…   øø€ å! "Ñ%Ô%€(Ý�(”-Ñ Ô €(ØÔð )Ø‡O‚O�HÔ'Ñ(Ô(Ð(Ø9Ð9Ð9Ð9˜HÐ9Ñ9Ô9€'à	‡.‚.ÐAÐAÐAÐA ÐAÑAÔAÑBÔBÐBØ	€.r   c                  ó   — t           j        S r   )Ú_SCOPE_MANAGERr    r-   r   r   r    r    Ì  s   € Ý	Ô	%Ð%r   c                  óD   — d                      t          ¦   «         ¦  «        S r#  )ru   r    r-   r   r   Úcurrent_scope_strr¸  Ð  s   € Ø	�Š•-‘/”/Ñ	"Ô	"Ð"r   c              #   ó:  K  — 	 d}t          | t          ¦  «        r| }nT| rLt          | t          ¦  «        r7t          ¦   «         }|                     |                      d¦  «        ¦  «         n| dv }g }t                               |¦  «         t          t          j
        j        |¦  «        }|rt          |¦  «        s$d}t          |                     | ¦  «        ¦  «        ‚|V — t                               ¦   «          dS # t                               ¦   «          w xY w)a@  Opens a new configuration scope.

  Provides a context manager that opens a new explicit configuration
  scope. Explicit configuration scopes restrict parameter bindings to only
  certain sections of code that run within the scope. Scopes can be nested to
  arbitrary depth; any configurable functions called within a scope inherit
  parameters defined by higher level scopes.

  For example, suppose a function named `preprocess_images` is called in two
  places in a codebase: Once when loading data for a training task, and once
  when loading data for an evaluation task:

      def load_training_data():
        ...
        with gin.config_scope('train'):
          images = preprocess_images(images)
        ...


      def load_eval_data():
        ...
        with gin.config_scope('eval'):
          images = preprocess_images(images)
        ...

  By using a `config_scope` to wrap each invocation of `preprocess_images` as
  above, it is possible to use Gin to supply specific parameters to each. Here
  is a possible configuration for the above example:

      preprocess_images.crop_size = [64, 64]
      preprocess_images.normalize_image = True

      train/preprocess_images.crop_location = 'random'
      train/preprocess_images.random_flip_lr = True

      eval/preprocess_images.crop_location = 'center'

  The `crop_size` and `normalize_image` parameters above will be shared by both
  the `train` and `eval` invocations; only `train` will receive
  `random_flip_lr`, and the two invocations receive different values for
  `crop_location`.

  Passing `None` or `''` to `config_scope` will temporarily clear all currently
  active scopes (within the `with` block; they will be restored afterwards).

  Args:
    name_or_scope: A name for the config scope, or an existing scope (e.g.,
      captured from `with gin.config_scope(...) as scope`), or `None` to clear
      currently active scopes.

  Raises:
    ValueError: If `name_or_scope` is not a list, string, or None.

  Yields:
    The resulting config scope (a list of all active scope names, ordered from
    outermost to innermost).
  Tr  )NrS   z&Invalid value for `name_or_scope`: {}.N)rµ   rC  r÷   r    r²  r[   r¶  r$   Úmapr   r„  r…  Úallr^   rP   r'   )Úname_or_scopeÚvalid_valueÚ	new_scopeÚscopes_are_validrþ   s        r   r  r  Ô  s  è è € ðv Ø€KÝ�-¥Ñ&Ô&ð Ø€i€iØ	ð �: mµSÑ9Ô9ð Ý‘/”/€iØ×Ò�}×*Ò*¨3Ñ/Ô/Ñ0Ô0Ð0Ð0à! ZÐ/€kØ€iõ ×Ò˜yÑ)Ô)Ð)å�=Ô2Ô8¸)ÑDÔDÐØð 6�cÐ"2Ñ3Ô3ð 6Ø8€gÝ�w—~’~ mÑ4Ô4Ñ5Ô5Ð5à
€O€O€Oå×ÒÑÔÐÐÐø…N×ÒÑÔÐÐøøøs   „C C? Ã?D.Úfn_or_cls_or_selectorc                 ó.  — g }t          | t          ¦  «        r<|                      d¦  «        �^ }}t                               |¦  «        }|r|j        }nt          | ¦  «        }|r|j        nd}|st          ¦   «         }|€t          d| › d�¦  «        ‚||fS )ak  Finds the complete selector corresponding to `fn_or_cls`.

  Args:
    fn_or_cls_or_selector: Configurable function, class or selector `str`.

  Returns:
    A tuple of `(scope_components, selector)`, where `scope_components` is a
    list of the scope elements, either as present in the selector string passed
    as input, or obtained from the current scope.
  r  NzCould not find z in the Gin registry.)	rµ   r÷   r[   r˜   r™   rj   r‚   r    r^   )rÀ  r#   rj   rÂ   s       r   Ú_as_scope_and_selectorrÂ  +  sÀ   € ð €%ÝÐ%¥sÑ+Ô+ð Aà,×2Ò2°3Ñ7Ô7Ñ€UˆHÝ×"Ò" 8Ñ,Ô,€HØð #ØÔ"€høå#Ð$9Ñ:Ô:€MØ)6Ð@ˆ}Ô%Ð%¸D€Hà	ð Ý‰OŒO€EàÐÝ
ØFÐ/ÐFÐFÐFñHô Hð Hð 
�ˆÐr   Trj   Úinherit_scopesc                 ó"  ‡— ‰pt          ¦   «         Ši }|s‰g}n+ˆfd„t          t          ‰¦  «        dz   ¦  «        D ¦   «         }|D ]G}d                     |¦  «        }|                     t
                               || fi ¦  «        ¦  «         ŒH|S )zHReturns the bindings for the current full selector, with optional scope.c                 ó$   •— g | ]}‰d |…         ‘ŒS r   r-   )rQ   Úir  s     €r   rR   z!_get_bindings.<locals>.<listcomp>X  s6   ø€ ð Hð Hð HØ!"Ð˜˜!˜ÔðHð Hð Hr   rK   r  )r    ÚrangerÇ   ru   rå   r…   rf   )rj   r  rÃ  Ú
new_kwargsÚpartial_scopesÚpartial_scopeÚpartial_scope_strs    `     r   Ú_get_bindingsrÌ  L  sÅ   ø€ ð &Ð8­©¬ÐØ€*à	ð HØ&Ð'€N€NðHð Hð Hð HÝ&+­CÐ0@Ñ,AÔ,AÀAÑ,EÑ&FÔ&FðHñ Hô H€Nà%ð Fð F€mØŸš Ñ/Ô/ÐØ×Ò•g—k’kÐ#4°hÐ"?ÀÑDÔDÑEÔEÐEÐEØ	Ðr   Úresolve_referencesc                 óz   — t          | ¦  «        \  }}t          |||¬¦  «        }|rt          j        |¦  «        S |S )ap  Returns the bindings associated with the given configurable.

  Any configurable references in the bindings will be resolved during the call
  (and evaluated references will be evaluated).

  Example:

  ```python
  config.parse_config('MyParams.kwarg0 = 123')

  gin.get_bindings('MyParams') == {'kwarg0': 123}
  ```

  Note: The scope in which `get_bindings` is called will be used.

  Args:
    fn_or_cls_or_selector: Configurable function, class or selector `str`.
    resolve_references: Whether or not references (and macros) should be
      resolved. If `False`, the output may contain instances of Gin's
      `ConfigurableReference` class.
    inherit_scopes: If False, only match the exact scope (so
      `get_bindings('scope1/fn')` do not match `scope1/scope2/fn`, nor `fn` but
      only the exact 'scope1/fn').

  Returns:
    The bindings kwargs injected by Gin.
  )r  rÃ  )rÂ  rÌ  rv  Údeepcopy)rÀ  rÍ  rÃ  r  rj   Úbindings_kwargss         r   Úget_bindingsrÑ  `  sV   € õ@  6Ð6KÑLÔLÑÐ�HÝ!ØØ'Ø#ðñ ô €/ð
 ð ÝŒ=˜Ñ)Ô)Ð)àÐr   c                 ób   — t          | ¦  «        \  }}t          |         }t          ||¬¦  «        S )aÞ  Returns the configurable version of `fn_or_cls_or_selector`.

  If a function or class has been registered with Gin, Gin's configurable
  version (which will have all relevant Gin bindings applied) can be obtained by
  calling this function with any of the following:

    - The original function or class (the "non-configurable" version);
    - The configurable function or class (so this function is effectively a
      no-op for functions annotated with `@gin.configurable`);
    - A selector string that specifies the function or class.

  If passing a selector string, a scope may be supplied, in which case the
  returned configurable will have the scope applied. If a function or class is
  passed, or no scope is supplied as part of the selector string, the current
  active scope will be used instead.

  Args:
    fn_or_cls_or_selector: Configurable function, class or selector `str`.

  Returns:
    The configurable function or class corresponding to `fn_or_cls_or_selector`.
  r  )rÂ  r˜   r
  )rÀ  r  rj   rÂ   s       r   r›   r›   Œ  s6   € õ0  6Ð6KÑLÔLÑÐ�HÝ˜HÔ%€-Ý	˜mÐ>NÐ	OÑ	OÔ	OÐOr   c                 ó  ‡ ‡‡‡‡‡	‡
— d                      ‰‰¦  «        }‰Š	t          j        ‰¦  «        rt          ‰¦  «        Š	t	          ‰	|||¦  «        Š
t          ‰	||¦  «        Št          j        ‰ ¦  «        ˆ ˆˆˆˆˆ	ˆ
fd„¦   «         }|S )aÇ  Creates the final Gin wrapper for the given function.

  Args:
    fn: The function that will be wrapped.
    fn_or_cls: The original function or class being made configurable. This will
      differ from `fn` when making a class configurable, in which case `fn` will
      be the constructor/new function (or when proxying a class, the type's
      `__call__` method), while `fn_or_cls` will be the class.
    name: The name given to the configurable.
    selector: The full selector of the configurable (name including any module
      components).
    allowlist: An allowlist of configurable parameters.
    denylist: A denylist of non-configurable parameters.

  Returns:
    The Gin wrapper around `fn`.
  z'{}' ('{}')c            
      ó¦	  •— t                                ‰"‰"¦  «        }t          |¦  «        }t          |                     ¦   «         ¦  «        }d                     t          ¦   «         ¦  «        }t          ‰#| ¦  «        }| t          |¦  «        d…         D ]}|t          u rt          d¦  «        ‚Œg }g }	t          | dt          |¦  «        …         ¦  «        D ]>\  }
}|t          u r0|                     ||
         ¦  «         |	                     |
¦  «         Œ?g }|                     ¦   «         D ]#\  }}|t          u r|                     |¦  «         Œ$|D ]}||vr|                     |d¦  «         Œ‰                      ¦   «         }|                     |¦  «         |D ]}||vr|                     |d¦  «         Œ|D ]}||vr|                     |d¦  «         Œt"          5  t$                               ||fi ¦  «        }|                     |¦  «         ddd¦  «         n# 1 swxY w Y   t          j        |¦  «        }g }t          | ¦  «        }t+          |	|¦  «        D ]7\  }
}||vr|                     |¦  «         Œ|                     |¦  «        ||
<   Œ8‰$D ]#}||vr||vr||vr|                     |¦  «         Œ$|D ]1}||vr|                     |¦  «         Œ|                     |¦  «         Œ2|rQt-          ‰#|¦  «        }d}t.                               |¦  «        }|                     ||¦  «        }t5          |¦  «        ‚|                     |¦  «         	  ‰|i |¤ŽS # t6          $ �re}d}t9          |t:          ¦  «        rùt=          ‰#¦  «        }t          |¦  «        t          |¦  «        k     rÊt          t?          |t          |¦  «        d…         ¦  «        t?          |¦  «        z
  ¦  «        }|r‡t          t?          |t          |¦  «        z   ¦  «        t?          |t          |¦  «        z   ¦  «        z
  ¦  «        }d}d„ }||                      ||¦  «         ||¦  «         ||¦  «        ¬¦  «        z  }|d	z  }|rd
                     |¦  «        nd}|                     ‰!‰|¦  «        }tA          j!        ||¦  «         Y d}~dS d}~ww xY w)z9Supplies fn with parameter values from the configuration.r  Nz¿gin.REQUIRED is not allowed for unnamed (vararg) parameters. If the function being called is wrapped by a non-Gin decorator, try explicitly providing argument names for positional parameters.z5Required bindings for `{}` not provided in config: {}rS   zš
  No values supplied by Gin or caller for arguments: {}
  Gin had values bound for: {gin_bound_args}
  Caller supplied values for: {caller_supplied_args}c                 ó`   — t          t          t          t          | ¦  «        ¦  «        ¦  «        S r   )rC  rº  r÷   Úsorted©Úxs    r   r±   z8_make_gin_wrapper.<locals>.gin_wrapper.<locals>.<lambda>=  s   € ¥T­#­cµ6¸!±9´9Ñ*=Ô*=Ñ%>Ô%>€ r   )Úgin_bound_argsÚcaller_supplied_argsz&
  In call to configurable '{}' ({}){}z in scope '{}')"rÍ   rf   rÌ  rC  Úkeysru   r    r•  rÇ   ru  r^   Ú	enumerater"   rä   r&   rv  rå   rx  ry  r  rÏ  rt   r´  r˜   r5  rP   r—   Ú	Exceptionrµ   r“  r˜  rE  r   Ú%augment_exception_message_and_reraise)%r®   r¯   Úcurrent_selectorrÈ  rÙ  Ú	scope_strr¯  r®  Úrequired_arg_namesÚrequired_arg_indexesrÆ  Úcaller_required_kwargsr£  rk  r[  Úoperative_parameter_valuesr§  Úop_cfgÚmissing_required_paramsÚnew_argsÚrequired_kwargrþ   r5  ÚeÚall_arg_namesÚunbound_positional_argsrÚ  ÚfmtÚcanonicalizeÚ
scope_infor°   r’   Úinitial_configurable_defaultsrb   rj   Úsignature_fnÚsignature_required_kwargss%                                 €€€€€€€r   Úgin_wrapperz&_make_gin_wrapper.<locals>.gin_wrapperÆ  sÛ  ø€ õ *×-Ò-¨h¸ÑAÔAÐÝÐ/Ñ0Ô0€JÝ˜*Ÿ/š/Ñ+Ô+Ñ,Ô,€NØ—’�™œÑ)Ô)€Iå8¸ÀtÑLÔL€Ià•C˜	‘N”N�O�OÔ$ð ð ˆØ	•ˆˆÝðñô ð 	ð 
ð ÐØÐÝ˜D ¥# i¡.¤. Ô1Ñ2Ô2ð 'ð '‰ˆˆ3Ø	•ˆˆØ×!Ò! )¨A¤,Ñ/Ô/Ð/Ø×#Ò# AÑ&Ô&Ð&øàÐØŸš™œð -ð -‰ˆˆuØ	•(Ð	Ð	Ø×%Ò% eÑ,Ô,Ð,øð ð 'ð 'ˆØ	Ð+Ð	+Ð	+Ø�Š�x Ñ&Ô&Ð&øð "?×!CÒ!CÑ!EÔ!EÐà×%Ò% jÑ1Ô1Ð1ð
 ð 0ð 0ˆØ	
Ð$Ð	$Ð	$Ø"×&Ò& q¨$Ñ/Ô/Ð/øØð 0ð 0ˆØ	
Ð(Ð	(Ð	(Ø"×&Ò& q¨$Ñ/Ô/Ð/øõ 
 ð 0ð 0Ý ×+Ò+¨YÐ8HÐ,IÈ2ÑNÔN€fØ‡m‚mÐ.Ñ/Ô/Ð/ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0õ ”˜zÑ*Ô*€Jð !ÐÝ�D‰zŒz€HÝÐ/Ð1CÑDÔDð /ð /‰ˆˆ8Ø	˜Ð	#Ð	#Ø×&Ò& xÑ0Ô0Ð0Ð0à —n’n XÑ.Ô.ˆ�‰ˆð 4ð 7ð 7ˆØ
 	Ð
)Ð
)Ø
 Ð
&Ð
&Ø
 
Ð
*Ð
*Ø×&Ò& ~Ñ6Ô6Ð6øØ0ð #ð #ˆØ	˜zÐ	)Ð	)Ø×&Ò& ~Ñ6Ô6Ð6Ð6ð 	�
Š
�>Ñ"Ô"Ð"Ð"àð "å
˜lÐ,CÑ
DÔ
Dð àG€gÝ"×3Ò3Ð4DÑEÔEÐØ—’Ð/Ð1HÑIÔI€gÝ˜Ñ!Ô!Ð!ð ×Ò�fÑÔÐð>ØˆR�Ð(˜ZÐ(Ð(Ð(øÝð >ñ >ð >Ø€gÝ	�A•yÑ	!Ô	!ð IÝ;¸LÑIÔIˆÝˆx‰=Œ=�3˜}Ñ-Ô-Ò-Ð-Ý$(Ý�-¥ H¡¤  Ô/Ñ0Ô0µ3°z±?´?ÑBñ%Dô %DÐ
!à$ð IÝ#'Ý�I¥ V¡¤Ñ,Ñ-Ô-ÝÐ&­Ð.DÑ)EÔ)EÑEÑFÔFñGñ$Hô $HÐ ðLˆCð ?Ð>ˆLØ�s—z’zØ�Ð4Ñ5Ô5Ø+˜|¨NÑ;Ô;Ø%1 \Ð2FÑ%GÔ%Gð "ñ Iô Iñ IˆGð Ð:Ñ:€gØ9BÐJÐ#×*Ò*¨9Ñ5Ô5Ð5È€jØ—’˜t Y°
Ñ;Ô;€gÝÔ1°!°WÑ=Ô=Ð=Ð=Ð=Ð=Ð=Ð=Ð=øøøøð->øøøs+   Ç3HÈH!È$H!ÍM  Í SÍ+ESÓS)rP   rˆ   rŠ   r«   r¥  r«  rÚ   rÛ   )r°   r’   rb   rj   rô   rõ   r   rò  rï  rð  rñ  s   ````    @@@r   Ú_make_gin_wrapperró  ©  sÖ   øøøøøøø€ ð(  ×&Ò& t¨YÑ7Ô7€-Ø€,Ý„_�YÑÔð :Ý.¨yÑ9Ô9€LÝ<Ø�M 9¨hñ8ô 8Ðå"LØ�I˜xñ#)ô #)Ðõ „?�2ÑÔð~>ð ~>ð ~>ð ~>ð ~>ð ~>ð ~>ð ~>ð ~>ð ~>ñ Ôð~>ð@ 
Ðr   c           
      ó2  ‡ ‡‡‡‡— t          ¦   «         rd}t          |¦  «        ‚‰€‰ j        n‰Št          j                             ‰¦  «        rt          ‰ dd¦  «        }|€|n|}nAt          j                             ‰¦  «        s"t          d 	                    ‰¦  «        ¦  «        ‚|�At          j                             |¦  «        s"t          d 	                    |¦  «        ¦  «        ‚|r|dz   ‰z   n‰Št          sA‰t          v r8t          ‰         j        ‰ ur$d}t          | 	                    ‰¦  «        ¦  «        ‚‰r‰rd}t          |¦  «        ‚‰r+t          ‰t          t          f¦  «        st!          d	¦  «        ‚‰r+t          ‰t          t          f¦  «        st!          d
¦  «        ‚t#          ‰ ‰d¦  «         t#          ‰ ‰d¦  «         ˆˆˆ ˆˆfd„}	t%          |	‰ ‰|¬¦  «        }
t'          |
‰ ‰||‰‰‰¬¦  «        }|t          ‰<   |t(          ‰ <   |
S )a  Wraps `fn_or_cls` to make it configurable.

  Infers the configurable name from `fn_or_cls.__name__` if necessary, and
  updates global state to keep track of configurable name <-> function
  mappings, as well as allowlisted and denylisted parameters.

  Args:
    fn_or_cls: The function or class to decorate.
    name: A name for the configurable. If `None`, the name will be inferred from
      from `fn_or_cls`. The `name` may also include module components to be used
      for disambiguation (these will be appended to any components explicitly
      specified by `module`).
    module: The module to associate with the configurable, to help handle naming
      collisions. If `None`, `fn_or_cls.__module__` will be used (if no module
      is specified as part of `name`).
    allowlist: An allowlisted set of parameter names to supply values for.
    denylist: A denylisted set of parameter names not to supply values for.
    avoid_class_mutation: If `fn_or_cls` is a class and `avoid_class_mutation`
      is `True`, decorate by subclassing `fn_or_cls`'s metaclass and overriding
      its `__call__` method. If `False`, replace the existing `__init__` or
      `__new__` with a decorated version.
    import_source: When using dynamic registration, this provides the import
      source of the registered configurable and consists of a tuple of
      `(source_module, attribute_path)` describing the module fn_or_cls is
      imported from and its attribute path within that module.

  Returns:
    A wrapped version of `fn_or_cls` that will take parameter values from the
    global configuration.

  Raises:
    RuntimeError: If the config is locked.
    ValueError: If a configurable with `name` (or the name of `fn_or_cls`)
      already exists, or if both an allowlist and denylist are specified.
  z@Attempted to add a new configurable after the config was locked.Nr)   z"Configurable name '{}' is invalid.zModule '{}' is invalid.rJ   z§A different configurable matching '{}' already exists.

To allow re-registration of configurables in an interactive environment, use:

    gin.enter_interactive_mode()z:An allowlist or a denylist can be specified, but not both.z$allowlist should be a list or tuple.z#denylist should be a list or tuple.rô   rõ   c                 ó,   •— t          | ‰‰‰‰‰¦  «        S )z@Wraps `fn` so that it obtains parameters from the configuration.)ró  )r°   rô   rõ   r’   rb   rj   s    €€€€€r   rß   z%_make_configurable.<locals>.decorator˜  s"   ø€ å˜R ¨D°(¸IØ%ñ'ô 'ð 'r   )r~   )r†   r¿   rb   rV   r}   rô   rõ   rj   )r~  r—   r(   r   ÚIDENTIFIER_REr…  rh   r„  r^   rP   Ú_INTERACTIVE_MODEr˜   r¿   rµ   rC  rD  r“  r�  rñ   ró   rŒ   )r’   rb   rV   rô   rõ   r~   r}   rþ   Údefault_modulerß   Údecorated_fn_or_clsÚconfigurable_inforj   s   `` ``       @r   rƒ   rƒ   J  s�  øøøøø€ õT ÑÔð  ØP€GÝ
�wÑ
Ô
Ðà#˜|ˆÔ	Ð	°€$ÝÔ ×&Ò& tÑ,Ô,ð HÝ˜Y¨°dÑ;Ô;€NØ%˜~ˆ^ˆ^°6€F€FÝÔ"×(Ò(¨Ñ.Ô.ð HÝ
Ð9×@Ò@ÀÑFÔFÑ
GÔ
GÐGàÐ¥Ô 7× =Ò =¸fÑ EÔ EÐÝ
Ð.×5Ò5°fÑ=Ô=Ñ
>Ô
>Ð>à$*Ð4ˆV�c‰\˜DÑ Ð °€(Ý
ð / ­IÐ 5Ð 5Ý�ÔÔ!¨Ð2Ð2ð2€Gõ �W—^’^ HÑ-Ô-Ñ
.Ô
.Ð.àð �8ð ØJ€GÝ
�WÑ
Ô
Ðàð <•z )­dµE¨]Ñ;Ô;ð <Ý
Ð:Ñ
;Ô
;Ð;àð ;•j ­Dµ%¨=Ñ9Ô9ð ;Ý
Ð9Ñ
:Ô
:Ð:å�y )¨[Ñ9Ô9Ð9Ý�y (¨JÑ7Ô7Ð7ð'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'õ
 ,Ø�˜HÐ;OðQñ Qô QÐõ #Ø!ØØØØ!ØØØðñ ô Ðð *…)ˆHÑØ!2Õ�IÑØ	Ðr   c                 óh   ‡‡‡‡— d}t          | ¦  «        r| }dŠn| Šˆˆˆˆfd„}|r ||¦  «        S |S )a4  Decorator to make a function or class configurable.

  This decorator registers the decorated function/class as configurable, which
  allows its parameters to be supplied from the global configuration (i.e., set
  through `bind_parameter` or `parse_config`). The decorated function is
  associated with a name in the global configuration, which by default is simply
  the name of the function or class, but can be specified explicitly to avoid
  naming collisions or improve clarity.

  If some parameters should not be configurable, they can be specified in
  `denylist`. If only a restricted set of parameters should be configurable,
  they can be specified in `allowlist`.

  The decorator can be used without any parameters as follows:

      @config.configurable
      def some_configurable_function(param1, param2='a default value'):
        ...

  In this case, the function is associated with the name
  `'some_configurable_function'` in the global configuration, and both `param1`
  and `param2` are configurable.

  The decorator can be supplied with parameters to specify the configurable name
  or supply an allowlist/denylist:

      @config.configurable('explicit_configurable_name', allowlist='param2')
      def some_configurable_function(param1, param2='a default value'):
        ...

  In this case, the configurable is associated with the name
  `'explicit_configurable_name'` in the global configuration, and only `param2`
  is configurable.

  Classes can be decorated as well, in which case parameters of their
  constructors are made configurable:

      @config.configurable
      class SomeClass:
        def __init__(self, param1, param2='a default value'):
          ...

  In this case, the name of the configurable is `'SomeClass'`, and both `param1`
  and `param2` are configurable.

  Args:
    name_or_fn: A name for this configurable, or a function to decorate (in
      which case the name will be taken from that function). If not set,
      defaults to the name of the function/class that is being made
      configurable. If a name is provided, it may also include module components
      to be used for disambiguation (these will be appended to any components
      explicitly specified by `module`).
    module: The module to associate with the configurable, to help handle naming
      collisions. By default, the module of the function or class being made
      configurable will be used (if no module is specified as part of the name).
    allowlist: An allowlisted set of kwargs that should be configurable. All
      other kwargs will not be configurable. Only one of `allowlist` or
      `denylist` should be specified.
    denylist: A denylisted set of kwargs that should not be configurable. All
      other kwargs will be configurable. Only one of `allowlist` or `denylist`
      should be specified.

  Returns:
    When used with no parameters (or with a function/class supplied as the first
    parameter), it returns the decorated function or class. When used with
    parameters, it returns a function that can be applied to decorate the target
    function or class.
  Nc                 ó*   •— t          | ‰‰‰‰¦  «        S r   ©rƒ   ©r’   rô   rõ   rV   rb   s    €€€€r   Úperform_decorationz(configurable.<locals>.perform_decorationý  s   ø€ Ý˜i¨¨v°yÀ(ÑKÔKÐKr   ©Úcallable©Ú
name_or_fnrV   rô   rõ   Údecoration_targetrÿ  rb   s    ```  @r   r  r  ®  sƒ   øøøø€ ðP ÐÝˆjÑÔð Ø"ÐØ€D€Dà€DðLð Lð Lð Lð Lð Lð Lð Lð ð 1ØÐÐ/Ñ0Ô0Ð0Ø	Ðr   c                 ó,   — t          | ||||d¬¦  «        S )a’  Allow referencing/configuring an external class or function.

  This alerts Gin to the existence of the class or function `fn_or_cls` in the
  event that it can't be easily annotated with `@configurable` (for instance, if
  it is from another project). This allows `fn_or_cls` to be configured and
  referenced (using the `@name` notation) via parameter binding strings.

  Note that only calls to the return value of this function or resulting from
  references to `fn_or_cls` made through binding strings (configurations) will
  have their parameters injected by Gin---explicit calls to `fn_or_cls` directly
  won't have any parameter bindings applied.

  Args:
    fn_or_cls: The external function or class that should be made configurable.
    name: The configurable name to be associated with `fn_or_cls`. The name may
      also include module components to be used for disambiguation (these will
      be appended to any components explicitly specified by `module`).
    module: The module to associate with the configurable, to help handle naming
      collisions. By default, `fn_or_cls.__module__` will be used (if no module
      is specified as part of the name).
    allowlist: An allowlist of parameter names to allow configuration for.
    denylist: A denylist of parameter names to deny configuration for.

  Returns:
    A decorated version of `fn_or_cls` that permits parameter binding. For
    functions, this is just a wrapped version of the function. For classes, this
    is a carefully constructed subclass of `fn_or_cls` designed to behave nearly
    identically (even under many type inspection operations) save for the
    addition of parameter binding.
  T©rb   rV   rô   rõ   r~   rý  )r’   rb   rV   rô   rõ   s        r   Úexternal_configurabler    s.   € õF 
ØØØØØØð
!ñ 
!ô 
!ð !r   c                 óh   ‡‡‡‡— d}t          | ¦  «        r| }dŠn| Šˆˆˆˆfd„}|r ||¦  «        S |S )añ  Decorator to register a function or class configurable.

  This decorator only registers the decorated function/class with Gin, so it can
  be passed to other configurables in `bind_parameter` or `parse_config`.
  This decorator doesn't change the decorated function/class, so any direct
  calls from within Python code are not affected by the configuration.

  If some parameters should not be configurable, they can be specified in
  `denylist`. If only a restricted set of parameters should be configurable,
  they can be specified in `allowlist`.

  The decorator can be used without any parameters as follows:

      @config.register
      def some_configurable_function(param1, param2='a default value'):
        ...

  In this case, the function is associated with the name
  `'some_configurable_function'` in the configuration, and both `param1`
  and `param2` are configurable.

  The decorator can be supplied with parameters to specify the name used to
  register or supply an allowlist/denylist:

      @config.register('explicit_name', allowlist='param2')
      def some_configurable_function(param1, param2='a default value'):
        ...

  In this case, the function is registered with the name `'explicit_name'` in
  the configuration registry, and only `param2` is configurable.

  Classes can be decorated as well, in which case parameters of their
  constructors are made configurable:

      @config.register
      class SomeClass:
        def __init__(self, param1, param2='a default value'):
          ...

  In this case, the name of the configurable is `'SomeClass'`, and both `param1`
  and `param2` are configurable.

  Args:
    name_or_fn: A name for this configurable, or a function to decorate (in
      which case the name will be taken from that function). If not set,
      defaults to the name of the function/class that is being made
      configurable. If a name is provided, it may also include module components
      to be used for disambiguation (these will be appended to any components
      explicitly specified by `module`).
    module: The module to associate with the configurable, to help handle naming
      collisions. By default, the module of the function or class being made
      configurable will be used (if no module is specified as part of the name).
    allowlist: An allowlisted set of kwargs that should be configurable. All
      other kwargs will not be configurable. Only one of `allowlist` or
      `denylist` should be specified.
    denylist: A denylisted set of kwargs that should not be configurable. All
      other kwargs will be configurable. Only one of `allowlist` or `denylist`
      should be specified.

  Returns:
    When used with no parameters as a decorator (or with a function/class
    supplied as the first parameter), it returns the target function or class
    unchanged. When used with parameters, it returns a function that can be
    applied to register the target function or class with Gin (this function
    also returns the target function or class unchanged).
  Nc                 ó2   •— t          | ‰‰‰‰d¬¦  «         | S )NTr  rý  rþ  s    €€€€r   rÿ  z$register.<locals>.perform_decoration~  s4   ø€ åØØØØØØ!ð#ñ #ô #ð #ð Ðr   r   r  s    ```  @r   Úregisterr
  1  s{   øøøø€ ðL ÐÝˆjÑÔð Ø"ÐØ€D€Dà€Dð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð ð 1ØÐÐ/Ñ0Ô0Ð0Ø	Ðr   c                 ó¬   — |pd„ }t          ¦   «         }g }| D ];} ||¦  «        }||vr*|                     |¦  «         |                     |¦  «         Œ<|S )Nc                 ó   — | S r   r-   r×  s    r   r±   z_make_unique.<locals>.<lambda>�  s   € ˜!€ r   )rE  Úaddr"   )ÚsequenceÚkeyÚseenÚoutputrØ  Úkey_vals         r   Ú_make_uniquer  Ž  sm   € ØÐ��€#Ý	‰Œ€$Ø€&Øð ð €aØˆc�!‰fŒf€GØ�dÐÐØ
‡h‚hˆwÑÔÐØ‡m‚m�AÑÔÐøØ	€-r   Úcandidate_nameÚexisting_namesc                 óL   — d}| }||v r| t          |¦  «        z   }|dz  }||v °|S )Né   rK   )r÷   )r  r  rÆ  Úunique_names       r   Ú_uniquify_namer  š  sE   € Ø€!Ø€+Ø�~Ð%Ð%Ø ¥3 q¡6¤6Ñ)€KØˆ�F€Að 	�~Ð%Ð%ð 
Ðr   c                   ó`   — e Zd ZdZd„ Zed„ ¦   «         Zdej        fd„Z	de
fd„Zde
defd	„Zd
S )ÚImportManagerzÕManages imports required when writing out a full config string.

  This class does bookkeeping to ensure each import is only output once, and
  that each import receives a unique name/alias to avoid collisions.
  c                 óØ   — t          d„ |D ¦   «         ¦  «        | _        g | _        i | _        t	          ¦   «         | _        t          |d„ ¬¦  «        D ]}|                      |¦  «         ŒdS )a×  Initializes the `ImportManager` instance.

    Args:
      imports: An iterable of `ImportStatement` instances, providing existing
        imports to manage. Every effort will be taken here to respect the
        existing structure and format of the imports (e.g., any aliases
        provided, and whether the imports use the `from` syntax). Note that if
        dynamic registration is enabled, it should be included here as one of
        the provided statements.
    c              3   ó,   K  — | ]}|j         d k    V — ŒdS )ú__gin__.dynamic_registrationNrs   ©rQ   rH   s     r   ú	<genexpr>z)ImportManager.__init__.<locals>.<genexpr>µ  s?   è è € ð $"ð $"àð 	ÔÐ:Ò:ð$"ð $"ð $"ð $"ð $"ð $"r   c                 ó    — | j         | j         fS r   )rV   rU   ©Úss    r   r±   z(ImportManager.__init__.<locals>.<lambda>¼  s   € °A´HÀ!Ä)¸mÐ3L€ r   ©r  N)ÚanyrM   rC   Úmodule_selectorsrE  ÚnamesrÖ  Ú
add_import)r   rC   rH   s      r   r5   zImportManager.__init__ª  s�   € õ !$ð $"ð $"à ð$"ñ $"ô $"ñ !"ô !"€DÔð €D„LØ€DÔÝ‘”€D„Jå˜GÐ)LÐ)LÐMÑMÔMð !ð !ˆ	Ø
‡o‚o�iÑ Ô Ð Ð ð!ð !r   c                 ó0   — t          | j        d„ ¬¦  «        S )Nc                 ó   — | j         S r   rs   r"  s    r   r±   z.ImportManager.sorted_imports.<locals>.<lambda>Á  s   € ¨a¬h€ r   r$  )rÖ  rC   r   s    r   r>   zImportManager.sorted_imports¿  s   € å�$”,Ð$6Ð$6Ð7Ñ7Ô7Ð7r   rH   c                 óÎ  — |j         | j        v rdS t          |                     ¦   «         | j        ¦  «        }||                     ¦   «         k    r|                     |¬¦  «        }|j        s|j        r|                     ¦   «         }n|j         }|| j        |j         <   | j                             |                     ¦   «         ¦  «         | j	         
                    |¦  «         dS )zØAdds a single import to this `ImportManager` instance.

    The provided statement is deduped and possibly re-aliased to ensure it has a
    unique name.

    Args:
      statement: The `ImportStatement` to add.
    N)rX   )rV   r&  r  r]   r'  rv   rU   rX   r  rC   r"   )r   rH   r  rj   s       r   r(  zImportManager.add_importÃ  sß   € ð Ô˜4Ô0Ð0Ð0Ø€fÝ  ×!5Ò!5Ñ!7Ô!7¸¼ÑDÔD€KØ�i×*Ò*Ñ,Ô,Ò,Ð,Ø×$Ò$¨;Ð$Ñ7Ô7€iØÔð "˜IœOð "Ø×%Ò%Ñ'Ô'€h€hàÔ!€hØ.6€DÔ˜)Ô*Ñ+Ø„J‡N‚N�9×'Ò'Ñ)Ô)Ñ*Ô*Ð*Ø„L×Ò˜	Ñ"Ô"Ð"Ð"Ð"r   rÂ   c                 óö  — | j         sdS |j        t          k    rdS |j        r"|                      |j        d         ¦  «         dS t          |j        d¦  «        rR|j        j        }t          j        |d|v dt          j	        dddd¦  «        ¬¦  «        }|                      |¦  «         dS t          j        d|¦  «         | j        D ])}|j        dk    r| j                             |¦  «          nŒ*d	| _         dS )
z½Adds the import required for `configurable_`, if not already present.

    Args:
      configurable_: The specific `Configurable` whose corresponding module
        should be imported.
    Nr   r)   rJ   rS   )rV   rU   rX   rZ   a  Configurable %r was not imported using dynamic registration and has no __module__ attribute; dynamic registration will not be used in the resulting config string. This is likely because the initial set of parsed Gin files included a mix of files with and without dynamic registration.r  F)rM   r¿   r1   r}   r(  r   r)   r   rœ   ÚLocationÚloggingÚwarningrC   rV   Úremove)r   rÂ   rV   rw   rH   s        r   Úrequire_configurablez"ImportManager.require_configurableÙ  s6  € ð Ô$ð Ø€fØÔ¥Ò%Ð%Ø€fØÔ"ð (Ø
‡o‚o�mÔ1°!Ô4Ñ5Ô5Ð5Ð5Ð5Ý	�Ô&¨Ñ	5Ô	5ð (ØÔ$Ô/€fÝ&Ô6ØØ˜�-ØÝ Ô)¨$°°4¸Ñ<Ô<ð	>ñ >ô >Ðð
 ‡o‚oÐ&Ñ'Ô'Ð'Ð'Ð'å„oð"ð $1ñ2ô 2ð 2ð ”|ð ð ˆ)ØÔÐ=Ò=Ð=Ø
Œ,×
Ò
˜iÑ
(Ô
(Ð
(Ø
ˆ%ð >ð #(€dÔÐÐr   r�   c                 óX  — | j         rC|j        r|j        \  }}|j        }n|j        j        }|j        j        }| j        |         › d|› �S t                               |j	        ¦  «        }|j
        r9d|vr5d                     |j	                             d¦  «        dd…         ¦  «        }|S )a  Returns a minimal selector corresponding to `configurable_`.

    This method has different behavior depending on whether dynamic registration
    has been enabled (see `__init__`). If dynamic registration is enabled, then
    the minimal selector is a full '.'-seperated attribute chain beginning with
    the name of an imported module. If dynamic registration is not enabled, then
    the returned selector is the minimal string required to uniquely identify
    `configurable_` (this includes the function/class name, and enough
    components of its module name to make the resulting selector unique).

    Args:
      configurable_: The `Configurable` to return a minimal selector for.

    Returns:
      The minimal selector for `configurable_` as a string.
    rJ   rÆ   N)rM   r}   rV   r¿   r)   r*   r&  r˜   r5  rj   rÊ   ru   r[   )r   rÂ   rw   rb   rV   r5  s         r   r5  zImportManager.minimal_selectorû  sÅ   € ð" Ô ð Ø	Ô	$ð 2Ø!.Ô!<ÑÐ˜$Ø!Ô(ˆˆàÔ&Ô1ˆØÔ$Ô1ˆØÔ% fÔ-Ð6Ð6°Ð6Ð6Ð6å"×3Ò3°MÔ4JÑKÔKÐØ	Ô	 ð NàÐ&Ð&Ð&Ø ŸXšX mÔ&<×&BÒ&BÀ3Ñ&GÔ&GÈÈÈÔ&LÑMÔMÐ
ØÐr   N)r(   r)   r*   r+   r5   r,   r>   r   rœ   r(  ró   r1  r÷   r5  r-   r   r   r  r  £  s¤   € € € € € ðð ð!ð !ð !ð* ð8ð 8ñ „8ð8ð# -Ô"?ð #ð #ð #ð #ð, (°ð  (ð  (ð  (ð  (ðD¨Lð ¸Sð ð ð ð ð ð r   r  éP   é   c           	      ó  ‡‡— ˆˆfd„}d„ }t          t          ¦  «        }|j        rT| D ]%\  }}|                     t          |         ¦  «         Œ&t          | ¦  «        D ]}|                     |j        ¦  «         Œd„ |j        D ¦   «         }	|	r|	                     d¦  «         t          |¬¦  «        5  i }
|  
                    ¦   «         D ]*\  \  }}}t          |         j        t          k    r||
||f<   Œ+|
r3|	                     d¦  «         |	                     dd‰d	z
  z  z   ¦  «         t          |
 
                    ¦   «         |¬
¦  «        D ]/\  \  }}} |||d         ¦  «        }|	                     |¦  «         Œ0|
r|	                     d¦  «         t          |  
                    ¦   «         |¬
¦  «        }|D �]'\  \  }}}t          |         }|j        t          t          fv rŒ,|                     |¦  «        }|r|dz   nd|z   }d„ | 
                    ¦   «         D ¦   «         }|	                     d                     |¦  «        ¦  «         |	                     dd‰d	z
  z  z   ¦  «         t          |¦  «        D ]:\  }} |d                     ||¦  «        |¦  «        }|	                     |¦  «         Œ;|s|	                     d¦  «         |	                     d¦  «         �Œ)	 ddd¦  «         n# 1 swxY w Y   d                     |	¦  «        S )a>  Print the configuration specified in configuration object.

  Args:
    configuration_object: Either _OPERATIVE_CONFIG (operative config) or _CONFIG
      (all config, bound and unbound).
    max_line_length: A (soft) constraint on the maximum length of a line in the
      formatted string. Large nested structures will be split across lines, but
      e.g. long strings won't be split into a concatenation of shorter strings.
    continuation_indent: The indentation for continued lines.

  Returns:
    A config string capturing all parameter values set by the object.
  c                 óR  •— t          j        |‰‰z
  ¬¦  «        }|                     d¦  «        }t          |¦  «        dk    r-t          | |z   ¦  «        ‰k    rd                     | |¦  «        }n7d                     ˆfd„|D ¦   «         ¦  «        }d                     | |¦  «        }|S )z&Pretty print the given key/value pair.)Úwidthú
rK   z{} = {}c                 ó    •— g | ]
}d ‰z  |z   ‘ŒS )ú r-   )rQ   ÚlineÚcontinuation_indents     €r   rR   z7_config_str.<locals>.format_binding.<locals>.<listcomp>8  s$   ø€ Ð
LÐ
LÐ
L°ˆ3Ð$Ñ$ tÑ+Ð
LÐ
LÐ
Lr   z	{} = \
{})ÚpprintÚpformatr[   rÇ   rP   ru   )r  rk  Úformatted_valÚformatted_val_linesr  Úindented_formatted_valr<  Úmax_line_lengths         €€r   Úformat_bindingz#_config_str.<locals>.format_binding.  sÄ   ø€ å”NØ�oÐ(;Ñ;ð>ñ >ô >€Mà'×-Ò-¨dÑ3Ô3ÐÝÐÑ Ô  AÒ%Ð%ÝˆC�-ÑÑ Ô  OÒ3Ð3Ø×Ò  ]Ñ3Ô3€f€fà#ŸyšyØ
LÐ
LÐ
LÐ
LÐ8KÐ
LÑ
LÔ
Lñ Nô  NÐà×#Ò# CÐ)?Ñ@Ô@€fØ€Mr   c                 óR  — | d         \  }}|                      ¦   «                              d¦  «        ddd…         |                      ¦   «                              d¦  «        ddd…         z   }t          |         j        r(|                     d¦  «        }|dxx         d|› �z  cc<   |S )z;Sort configurable selector/innermost scopes, ignoring case.r   rJ   Nr   r  )Úlowerr[   r˜   rÊ   r&   )Ú	key_tupler#   rj   ÚpartsÚmethod_names        r   Úsort_keyz_config_str.<locals>.sort_key<  s    € à ”l�O€Eˆ8Ø�NŠNÑÔ×"Ò" 3Ñ'Ô'¨¨¨"¨Ô-°·²±´×0CÒ0CÀCÑ0HÔ0HÈÈÈ2ÈÔ0NÑN€EÝ�ÔÔ$ð $Ø—I’I˜a‘L”L€kØˆA€h€h„hÐ#�kÐ#Ð#Ñ#€h€h�hØ€Lr   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r-   rO   r  s     r   rR   z_config_str.<locals>.<listcomp>O  s1   € ð ð ð Ø&€i×ÒÑÔðð ð r   rS   r¢   z	# Macros:z# ú=r  r$  rk  r  c                 ó:   — g | ]\  }}t          |¦  «        ¯||f‘ŒS r-   )rp  )rQ   r§  Úvs      r   rR   z_config_str.<locals>.<listcomp>o  s>   € ð ð ð Ù�Q˜Õ/JÈ1Ñ/MÔ/MðØˆaˆ&ðð ð r   z# Parameters for {}:ú{}.{}z# None.Nr8  )r  rw  rM   r1  r˜   r„   r  r>   r"   r£   rä   r¿   r1   rÖ  r2   r5  rP   ru   )Úconfiguration_objectrB  r<  rC  rI  r@   r_   rj   r•   Úformatted_statementsÚmacrosr#   Úconfigrb   ÚbindingÚsorted_itemsrÂ   r5  r  Ú
parametersr®  Úvals    ``                   r   Ú_config_strrW    sð  øø€ ð"ð ð ð ð ð ðð ð õ !¥Ñ*Ô*€.ØÔ(ð BØ+ð ?ð ?‰ˆˆ8Ø×)Ò)­)°HÔ*=Ñ>Ô>Ð>Ð>Ý'Ð(<Ñ=Ô=ð Bð Bˆ	Ø×)Ò)¨)Ô*@ÑAÔAÐAÐAð
ð Ø*8Ô*Gðñ ô Ðð ð $Ø×Ò Ñ#Ô#Ð#õ  >Ð2Ñ2Ô2ð !&ð !&Ø€FØ%9×%?Ò%?Ñ%AÔ%Að )ð )Ñ!Ñˆ�˜6Ý	�8Ô	Ô	$­Ò	-Ð	-Ø"(ˆˆu�hˆÑøØð FØ×!Ò! +Ñ.Ô.Ð.Ø×!Ò! $¨°À!Ñ0CÑ)DÑ"DÑEÔEÐEÝ# F§L¢L¡N¤N¸ÐAÑAÔAð +ð +Ñ‰	ˆˆq�6Ø�˜t V¨G¤_Ñ5Ô5€gØ×!Ò! 'Ñ*Ô*Ð*Ð*Øð &Ø×!Ò! "Ñ%Ô%Ð%åÐ.×4Ò4Ñ6Ô6¸HÐEÑEÔE€LØ%1ð &ñ &Ñ!Ñˆ�˜6Ý Ô)€mØ	Ô	¥5Õ*<Ð"=Ð	=Ð	=Øà'×8Ò8¸ÑGÔGÐØ(-Ð5˜ ™˜°2Ð9IÑI€oðð Ø#Ÿ\š\™^œ^ðñ ô €jð ×!Ò!Ø
 ×
'Ò
'¨Ñ
8Ô
8ñ:ô :ð :à×!Ò! $¨°À!Ñ0CÑ)DÑ"DÑEÔEÐEÝ˜ZÑ(Ô(ð -ð -‰(ˆ#ˆsØ �. §¢°ÀÑ!EÔ!EÀsÑKÔKˆØ×#Ò# GÑ,Ô,Ð,Ð,Øð /Ø×#Ò# IÑ.Ô.Ð.Ø×!Ò! "Ñ%Ô%Ð%Ñ%ð%&ð!&ð !&ð !&ñ !&ô !&ð !&ð !&ð !&ð !&ð !&ð !&øøøð !&ð !&ð !&ð !&ðF 
�ŠÐ'Ñ	(Ô	(Ð(s   Â3H/K/Ë/K3Ë6K3c                 óp   — t           5  t          t          | |¦  «        }ddd¦  «         n# 1 swxY w Y   |S )a€  Retrieve the "operative" configuration as a config string.

  The operative configuration consists of all parameter values used by
  configurable functions that are actually called during execution of the
  current program. Parameters associated with configurable functions that are
  not called (and so can have no effect on program execution) won't be included.

  The goal of the function is to return a config that captures the full set of
  relevant configurable "hyperparameters" used by a program. As such, the
  returned configuration will include the default values of arguments from
  configurable functions (as long as the arguments aren't denylisted or missing
  from a supplied allowlist), as well as any parameter values overridden via
  `bind_parameter` or through `parse_config`.

  Any parameters that can't be represented as literals (capable of being parsed
  by `parse_config`) are excluded. The resulting config string is sorted
  lexicographically and grouped by configurable name.

  Args:
    max_line_length: A (soft) constraint on the maximum length of a line in the
      formatted string. Large nested structures will be split across lines, but
      e.g. long strings won't be split into a concatenation of shorter strings.
    continuation_indent: The indentation for continued lines.

  Returns:
    A config string capturing all parameter values set in the current program.
  N)rx  rW  ry  )rB  r<  Úresults      r   Úoperative_config_strrZ    s�   € õ8 ð Að AÝÝ˜?Ð,?ñAô A€FðAð Að Añ Aô Að Að Að Að Að Að Aøøøð Að Að Að Að 
€-s   ˆ+«/²/c                 ó.   — t          t          | |¦  «        S )aL  Retrieve the interpreted configuration as a config string.

  This is not the _operative configuration_, in that it may include parameter
  values which are unused by by the program.

  Args:
    max_line_length: A (soft) constraint on the maximum length of a line in the
      formatted string. Large nested structures will be split across lines, but
      e.g. long strings won't be split into a concatenation of shorter strings.
    continuation_indent: The indentation for continued lines.

  Returns:
    A config string capturing all parameter values used by the current program.
  )rW  r…   )rB  r<  s     r   Ú
config_strr\  ¡  s   € õ 
•W˜oÐ/BÑ	CÔ	CÐCr   c                   óF   — e Zd ZU eed<   ee         ed<   ed          ed<   dS )Ú"ParsedConfigFileIncludesAndImportsÚfilenamerC   ÚincludesN)r(   r)   r*   r÷   rö   r   r-   r   r   r^  r^  ³  s=   € € € € € € Ø€-€-�-Ø�CŒ=ÐÐÑØÐ9Ô:Ð:Ð:Ñ:Ð:Ð:r   r^  c                 ó  — t          | t          t          f¦  «        rd                     | ¦  «        } t	          |¦  «         t          |t          t          f¦  «        rt          |¦  «        }t          j        | t          |¦  «        ¦  «        }g }g }t          ¦   «         5 }|D �]†}t          |t          j
        ¦  «        r´|\  }}}	}
}|	sZ|rd                     ||¦  «        n|}t          j        |¦  «        5  t          |ddf|
¦  «         ddd¦  «         n# 1 swxY w Y   Œ�t          ||¦  «        s?t          j        |¦  «        5  t          |||	f|
¦  «         ddd¦  «         n# 1 swxY w Y   ŒÑt          |t          j        ¦  «        rvt          |j        |¦  «        s_t          j        |j        ¦  «        5  |                     |j        ¦  «        st)          |j        ¦  «         ddd¦  «         n# 1 swxY w Y   �Œat          |t          j        ¦  «        rtt          j        |j        ¦  «        5  	 |                     |¦  «         n*# t.          $ r}|s‚ t1          ||¦  «         Y d}~nd}~ww xY wddd¦  «         n# 1 swxY w Y   �Œït          |t          j        ¦  «        r]t          j        |j        ¦  «        5  t5          |j        |¦  «        }|                     |¦  «         ddd¦  «         n# 1 swxY w Y   �Œft;          d                     |¦  «        ¦  «        ‚|                     d„ |j        D ¦   «         ¦  «         t@           !                    |j        ¦  «         ddd¦  «         n# 1 swxY w Y   ||fS )a¤  Parse a file, string, or list of strings containing parameter bindings.

  Parses parameter binding strings to set up the global configuration.  Once
  `parse_config` has been called, any calls to configurable functions will have
  parameter values set according to the values specified by the parameter
  bindings in `bindings`.

  An individual parameter binding has the format

      maybe/some/scopes/configurable_name.parameter_name = value

  Multiple binding strings can be passed either in the form of a file-like
  object supporting the `readline` method, a single string with each individual
  parameter binding separated by a newline, or as a list of individual parameter
  binding strings.

  Any Python literal (lists, tuples, dicts, strings, etc.) is acceptable to the
  right of the equals sign, and follows standard Python rules for line
  continuation. Additionally, a value starting with '@' is interpreted as a
  (possibly scoped) reference to another configurable function, in which case
  this value is replaced by a reference to that function. If the value
  furthermore ends in `()` (e.g., `@configurable_name()`), then the value
  returned when calling the function is used (it will be called *just before*
  the function consuming the output is called).

  See the module documentation for a more detailed description of scoping
  mechanisms and a complete example.

  Reading from a file could be done as follows:

      with open('/path/to/file.config') as bindings:
        gin.parse_config(bindings)

  Passing a newline separated string of parameter bindings might look like:

      bindings = '''
          my_class.param_one = 'asdf'
          my_class_param_two = 9.7
      '''
      gin.parse_config(bindings)

  Alternatively, one can declare a list of parameter bindings and pass it in:

      bindings = [
          'my_class.param_one = "asdf"',
          'my_class.param_two = 9.7',
      ]
      gin.parse_config(bindings)

  Can skip unknown configurables. For example, if no module containing a
  'training' configurable was imported, errors can be avoided by specifying
  `skip_unknown=True`:

      bindings = [
          'my_class.param_one = "asdf"',
          'my_class.param_two = 9.7',
          'training.learning_rate = 0.1',
      ]
      gin.parse_config(bindings, skip_unknown=True)

  Args:
    bindings: A file-like object supporting the readline method, a newline
      separated string of parameter bindings, or a list of individual parameter
      binding strings.
    skip_unknown: A boolean indicating whether unknown configurables and imports
      should be skipped (instead of causing an error). Configurable references
      to unknown configurables will cause errors if they are present in a
      binding that is not itself skipped due to an unknown configurable. This
      can also be a list of configurable names: any unknown configurables that
      do not match an item in the list will still cause errors. Note that
      bindings for known configurables will always be parsed.

  Returns:
    includes: List of ParsedConfigFileIncludesAndImports describing the result
      of loading nested include statements.
    imports: List of names of imported modules.
  r8  z{}/{}z	gin.macrork  NzUnrecognized statement type {}.c              3   ó$   K  — | ]}|j         V — Œd S r   rs   r  s     r   r   zparse_config.<locals>.<genexpr>2	  s%   è è € ÐKÐK¨	�9Ô#ÐKÐKÐKÐKÐKÐKr   )"rµ   rC  rD  ru   rG  rE  r   ÚConfigParserrL  r£   ÚBindingStatementrP   r   Útry_with_locationr‚  rJ  ÚBlockDeclarationrj   rZ   r›   r  rœ   r?   ÚImportErrorÚ_print_unknown_import_messageÚIncludeStatementÚparse_config_filer_  r"   ÚAssertionErrorr²  rC   rw  rå   )ÚbindingsrF  Úparserr`  rC   Úparse_contextrH   r#   rj   r[  rk  rZ   Ú
macro_nameré  Únested_includess                  r   Úparse_configrq  ¹  s)  € õ\ ��4¥˜-Ñ(Ô(ð #Ø�yŠy˜Ñ"Ô"€Hå˜Ñ&Ô&Ð&Ý��t¥U˜mÑ,Ô,ð %Ý�|Ñ$Ô$€LåÔ% hµ¸|Ñ0LÔ0LÑMÔM€&Ø€(Ø€'Ý�~„~ð "+˜Øð Añ Aˆ	Ý	�I�}Ô=Ñ	>Ô	>ð AØ5>Ñ2ˆˆx˜ 5¨(Øð 	?Ø:?ÐM�w—~’~ e¨XÑ6Ô6Ð6ÀXˆ*ÝÔ& xÑ0Ô0ð Fð FÝ˜J¨°WÐ=¸uÑEÔEÐEðFð Fð Fñ Fô Fð Fð Fð Fð Fð Fð Føøøð Fð Fð Fð Føå˜h¨Ñ5Ô5ð 	?ÝÔ& xÑ0Ô0ð ?ð ?Ý˜E 8¨XÐ6¸Ñ>Ô>Ð>ð?ð ?ð ?ñ ?ô ?ð ?ð ?ð ?ð ?ð ?ð ?øøøð ?ð ?ð ?ð ?øå�i¥Ô!?Ñ@Ô@ð AÝ˜IÔ.°Ñ=Ô=ð 	DÝÔ& yÔ'9Ñ:Ô:ð Dð DØ ×1Ò1°)Ô2DÑEÔEð DÝ/°	Ô0BÑCÔCÐCðDð Dð Dñ Dô Dð Dð Dð Dð Dð Dð Døøøð Dð Dð Dð Dùõ �i¥Ô!>Ñ?Ô?ð AÝÔ$ YÔ%7Ñ8Ô8ð 	8ð 	8ð8Ø×(Ò(¨Ñ3Ô3Ð3Ð3øÝð 8ð 8ð 8Øð ØÝ)¨)°QÑ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7øøøøð8øøøð	8ð 	8ð 	8ñ 	8ô 	8ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8øøøð 	8ð 	8ð 	8ð 	8ùõ �i¥Ô!?Ñ@Ô@ð AÝÔ$ YÔ%7Ñ8Ô8ð 	+ð 	+Ý-¨iÔ.@À,ÑOÔOˆ/Ø
�/Š/˜/Ñ
*Ô
*Ð
*ð	+ð 	+ð 	+ñ 	+ô 	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+øøøð 	+ð 	+ð 	+ð 	+ùõ Ø-×4Ò4°YÑ?Ô?ñAô Að 	Að ‡N‚NÐKÐK°]Ô5JÐKÑKÔKÑKÔKÐKÝ‡O‚O�MÔ)Ñ*Ô*Ð*ðE"+ð "+ð "+ñ "+ô "+ð "+ð "+ð "+ð "+ð "+ð "+øøøð "+ð "+ð "+ð "+ðF 
�7Ð	Ðsó   Â AM:Ã8DÄM:ÄDÄM:ÄDÄ (M:ÅE(ÅM:Å(E,Å,M:Å/E,Å0AM:Æ</G7Ç+M:Ç7G;Ç;M:Ç>G;Ç?8M:È7JÈ9IÉJÉ
I6	ÉI1	É,JÉ1I6	É6JÉ9M:ÊJ	Ê	M:ÊJ	Ê8M:Ë+K<Ë0M:Ë<L Ì M:ÌL ÌA*M:Í:M>ÎM>c                 ó6  — d}| j         g}| j                              d¦  «        }|j                             d¦  «        }|dt          |¦  «        …         |k    }|s+|dz  }|                     t          j        ¦   «         ¦  «         t          j        |g|¢R Ž  dS )zGPrints a properly formatted info message when skipping unknown imports.z;Skipping import of unknown module `%s` (skip_unknown=True).rJ   Nz
%s)	rV   r[   rb   rÇ   r"   Ú	tracebackÚ
format_excr.  Úinfo)rH   Ú	exceptionÚlog_strÚlog_argsÚimported_modulesÚexception_modulesÚmodules_matchs          r   rh  rh  7	  s«   € àI€'ØÔÐ€(ØÔ%×+Ò+¨CÑ0Ô0ÐØ”n×*Ò*¨3Ñ/Ô/ÐØ"Ð#:¥CÐ(9Ñ$:Ô$:Ð#:Ô;Ð?PÒP€-Ø	ð ,ð ˆvÑ€GØ‡O‚O•IÔ(Ñ*Ô*Ñ+Ô+Ð+Ý	„,ˆwÐ"˜Ð"Ð"Ð"Ð"Ð"Ð"r   c                  óü   — d„ }t          | ¦  «        dk    rt          j        || d         ¬¦  «        S t          | ¦  «        dk    r || Ž  dS d}t          |                     t          | ¦  «        ¦  «        ¦  «        ‚)a	  Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @register_file_reader(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.
  c                 óˆ   — | t          t          t          Ž ¦  «        d         vrt                               | |f¦  «         d S d S )Nr   )rC  rt   Ú_FILE_READERSr"   )Úfile_reader_fnÚis_readable_fns     r   Údo_registrationz-register_file_reader.<locals>.do_registrationa	  sF   € Ø�T¥#¥}Ð"5Ñ6Ô6°qÔ9Ð9Ð9Ý×Ò˜N¨NÐ;Ñ<Ô<Ð<Ð<Ð<ð :Ð9r   rK   r   )r€  r  z8register_file_reader() takes 1 or 2 arguments ({} given)N)rÇ   rÚ   Úpartialr“  rP   )r®   r�  rþ   s      r   Úregister_file_readerrƒ  G	  sƒ   € ð4=ð =ð =õ 	ˆ�Y„Y�!‚^€^ÝÔ˜_¸TÀ!¼WÐEÑEÔEÐEÝ
ˆ4�y„y�A‚~€~Ø€O�TÐÐÐÐàH€GÝ
�G—N’N¥3 t¡9¤9Ñ-Ô-Ñ
.Ô
.Ð.r   c                 ó:   — t                                | ¦  «         dS )zHAdds a path that will be searched for config files by parse_config_file.N)Ú_LOCATION_PREFIXESr"   )Úlocation_prefixs    r   Úadd_config_file_search_pathr‡  n	  s   € å×Ò˜OÑ,Ô,Ð,Ð,Ð,r   Úconfig_filerF  Úprint_includes_and_importsc                 óØ  — t           j                             | ¦  «        st          ndg}|D ]š}t           j                             || ¦  «        }t
          D ]p\  }} ||¦  «        r` ||¦  «        5 }t          ||¬¦  «        \  }	}
t          | |
|	¬¦  «        }|rt          |¦  «         |cddd¦  «         c c S # 1 swxY w Y   ŒqŒ›d}t          | 
                    | |¦  «        ¦  «        ‚)a  Parse a Gin config file.

  Args:
    config_file: The path to a Gin config file.
    skip_unknown: A boolean indicating whether unknown configurables and imports
      should be skipped instead of causing errors (alternatively a list of
      configurable names to skip if unknown). See `parse_config` for additional
      details.
    print_includes_and_imports: Whether to print the resulting nested includes
      and imports.

  Returns:
    results: An instance of ParsedConfigFileIncludesAndImports containing the
      filename of the parse files, a list of names of imported modules and a
      list of ParsedConfigFileIncludesAndImports created from including nested
      gin files.

  Raises:
    IOError: If `config_file` cannot be read using any register file reader.
  rS   )rF  )r_  rC   r`  Nz3Unable to open file: {}. Searched config paths: {}.)ÚosÚpathÚisabsr…  ru   r~  rq  r^  Úlog_includes_and_importsÚIOErrorrP   )rˆ  rF  r‰  Úprefixesr†  Úconfig_file_with_prefixÚreaderÚexistence_checkr¼   r`  rC   Úresultsrþ   s                r   rj  rj  s	  sd  € õ2 (*¤w§}¢}°[Ñ'AÔ'AÐKÕÐÈÀt€(Ø!ð 
ð 
€oÝ œgŸlšl¨?¸KÑHÔHÐÝ#0ð ð Ñˆ�Ø	ˆÐ0Ñ	1Ô	1ð ØˆVÐ+Ñ,Ô,ð 	°Ý*¨1¸<ÐHÑHÔHÑ
ˆ(�GÝ6Ø"¨G¸hðHñ Hô Hˆ'à'ð .Ý$ WÑ-Ô-Ð-Øð	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	øðð B€'Ý�—’˜{¨HÑ5Ô5Ñ6Ô6Ð6s   Á09B:Â:B>ÃB>Úconfig_filesrl  Úfinalize_configc                 ó:  — | €g } |€d}g }| D ]'}t          ||¦  «        }|                     |¦  «         Œ(t          ||¦  «         |rt          ¦   «          |rD|D ]}t	          |¦  «         Œ|r.t          j        d¦  «         |D ]}t          j        d|¦  «         Œ|S )aé  Parse a list of config files followed by extra Gin bindings.

  This function is equivalent to:

      for config_file in config_files:
        gin.parse_config_file(config_file, skip_configurables)
      gin.parse_config(bindings, skip_configurables)
      if finalize_config:
        gin.finalize()

  Args:
    config_files: A list of paths to the Gin config files.
    bindings: A list of individual parameter binding strings.
    finalize_config: Whether to finalize the config after parsing and binding
      (defaults to True).
    skip_unknown: A boolean indicating whether unknown configurables and imports
      should be skipped instead of causing errors (alternatively a list of
      configurable names to skip if unknown). See `parse_config` for additional
      details.
    print_includes_and_imports: If true, print a summary of the hierarchy of
      included gin config files and imported modules.

  Returns:
    includes_and_imports: List of ParsedConfigFileIncludesAndImports.
  NrS   zAdditional Gin bindings:z  %s)rj  r"   rq  ÚfinalizerŽ  r.  ru  )	r•  rl  r–  rF  r‰  Únested_includes_and_importsrˆ  Úincludes_and_importsrS  s	            r   Úparse_config_files_and_bindingsr›  œ	  så   € ð> ÐØ€LØÐØ€HØ "ÐØ!ð =ð =€kÝ,¨[¸,ÑGÔGÐØ×&Ò&Ð';Ñ<Ô<Ð<Ð<Ýˆx˜Ñ&Ô&Ð&Øð Ý�J„J€Jàð &Ø ;ð 5ð 5ÐÝÐ3Ñ4Ô4Ð4Ð4Øð &Ý„lÐ-Ñ.Ô.Ð.Øð &ð &ˆ'ÝŒ�V˜WÑ%Ô%Ð%Ð%Ø	$Ð$r   Úfile_includes_and_importsÚfirst_line_prefixÚprefixc                 ól  — t          j        d|| j        ¦  «         | j        rdnd}| j        r!| j        D ]}t          j        d|||¦  «         Œ| j        r\t          | j        ¦  «        D ]I\  }}|t          | j        ¦  «        dz
  k     r|dz   }|dz   }n
|dz   }|d	z   }t          |||¬
¦  «         ŒHdS dS )zGLogs a ParsedConfigFileIncludesAndImports and its includes and imports.z%s%su    â”‚z  z%s%s import %srK   u    â”œâ”€ u    â”‚ u    â””â”€ z   )r�  rž  N)r.  ru  r_  r`  rC   rÜ  rÇ   rŽ  )	rœ  r�  rž  ÚinfixÚimported_modulerÆ  Únested_resultÚnested_first_line_prefixÚnested_prefixs	            r   rŽ  rŽ  Ñ	  s  € õ
 
„,ˆvÐ(Ð*CÔ*LÑMÔMÐMØ-Ô6Ð
@ˆ&ˆ&¸D€%ØÔ&ð EØ4Ô<ð Eð EˆÝ„lÐ# V¨U°OÑDÔDÐDÐDØÔ'ð  Ý%Ð&?Ô&HÑIÔIð 
 ð 
 Ñˆˆ=Ø	
�SÐ*Ô3Ñ4Ô4°qÑ8Ò	8Ð	8Ø#)¨JÑ#6Ð Ø Ñ(ˆˆà#)¨JÑ#6Ð Ø ™ˆÝØ
Ø4Øð ñ  ô  ð  ð  ð ð  ð
 ð 
 r   c                 óÖ   — t          | t          ¦  «        s"t          d                     | ¦  «        ¦  «        ‚t	          j        | t          ¦   «         ¦  «                             ¦   «         S )z$Parse and return a single Gin value.z#value ({}) should be a string type.)rµ   r÷   r^   rP   r   rc  rL  rj  ro  s    r   rj  rj  é	  sW   € å	�E�3Ñ	Ô	ð JÝ
Ð:×AÒAÀ%ÑHÔHÑ
IÔ
IÐIÝ	Ô	# E­>Ñ+;Ô+;Ñ	<Ô	<×	HÒ	HÑ	JÔ	JÐJr   c                  ó   — t           S r   ©Ú_CONFIG_IS_LOCKEDr-   r   r   r~  r~  ð	  s   € Ý	Ðr   c                 ó
   — | a d S r   r§  )Ú	is_lockeds    r   rr  rr  ô	  s   € àÐÐÐr   c               #   ój   K  — t          ¦   «         } t          d¦  «         dV — t          | ¦  «         dS )a™  A context manager that temporarily unlocks the config.

  Once the config has been locked by `gin.finalize`, it can only be modified
  using this context manager (to make modifications explicit). Example:

      with gin.unlock_config():
        ...
        gin.bind_parameter(...)

  In the case where the config is already unlocked, this does nothing (the
  config remains unlocked).

  Yields:
    None.
  FN)r~  rr  )Úconfig_was_lockeds    r   Úunlock_configr­  ù	  s@   è è € õ" 'Ñ(Ô(ÐÝ˜ÑÔÐØ€%€%€%ÝÐ)Ñ*Ô*Ð*Ð*Ð*r   c                  ó
   — da d S ©NT©r÷  r-   r   r   Úenter_interactive_moder±  
  s   € àÐÐÐr   c                  ó
   — da d S r(  r°  r-   r   r   Úexit_interactive_moder³  
  s   € àÐÐÐr   c               #   ór   K  — 	 t          ¦   «          d V — t          ¦   «          d S # t          ¦   «          w xY wr   )r±  r³  r-   r   r   Úinteractive_moderµ  
  sE   è è € ðÝÑÔÐØ	€E€E€EåÑÔÐÐÐøÕÑÔÐÐøøøs   „& ¦6c                  ó°  — t          ¦   «         rt          d¦  «        ‚i } t          D ]u} |t          ¦  «        }|�a|                     ¦   «         D ]L\  }}t
                               |¦  «        }|| v r$d}t          |                     |¦  «        ¦  «        ‚|| |<   ŒMŒv|                      ¦   «         D ]\  }}t          ||¦  «         Œt          d¦  «         dS )aè  A function that should be called after parsing all Gin config files.

  Calling this function allows registered "finalize hooks" to inspect (and
  potentially modify) the Gin config, to provide additional functionality. Hooks
  should not modify the configuration object they receive directly; instead,
  they should return a dictionary mapping Gin binding keys to (new or updated)
  values. This way, all hooks see the config as originally parsed.

  Raises:
    RuntimeError: If the config is already locked.
    ValueError: If two or more hooks attempt to modify or introduce bindings for
      the same key. Since it is difficult to control the order in which hooks
      are registered, allowing this could yield unpredictable behavior.
  z.Finalize called twice (config already locked).Nz-Received conflicting updates when running {}.T)r~  r—   Ú_FINALIZE_HOOKSr…   rä   rX  ra  r^   rP   r‚  rr  )rl  ÚhookÚnew_bindingsr  rk  r€  rþ   s          r   r˜  r˜  #
  só   € õ ÑÔð IÝ
ÐGÑ
HÔ
HÐHà€(Ýð ð €dØ�4�‘=”=€LØÐØ$×*Ò*Ñ,Ô,ð ð ‰*ˆ#ˆuÝ×$Ò$ SÑ)Ô)ˆØ�(ˆ?ˆ?ØCˆ'Ý˜7Ÿ>š>¨$Ñ/Ô/Ñ0Ô0Ð
0Øˆ�‰ˆøà—N’NÑ$Ô$ð ð �j€cˆ5Ý�3˜ÑÔÐÐå˜ÑÔÐÐÐr   c                 ó:   — t                                | ¦  «         | S )a–  Registers `fn` as a hook that will run during `gin.finalize`.

  All finalize hooks should accept the current config, and return a dictionary
  containing any additional parameter bindings that should occur in the form of
  a mapping from (scoped) configurable names to values.

  Args:
    fn: The function to register.

  Returns:
    `fn`, allowing `register_finalize_hook` to be used as a decorator.
  )r·  r"   )r°   s    r   Úregister_finalize_hookr»  F
  s   € õ ×Ò˜ÑÔÐØ	€)r   c              #   ó8  K  — t          | t          ¦  «        r| V — dS t          | t          j        j        ¦  «        rt          j                             | ¦  «        } t          | t          j        j        ¦  «        r| D ]}t          |¦  «        D ]}|V — ŒŒ| V — dS )z;Provides an iterator over all values in a nested structure.N)rµ   r÷   ÚcollectionsÚabcÚMappingÚ
ValuesViewÚIterableÚ_iterate_flattened_values)rk  Únested_valueÚnested_nested_values      r   rÂ  rÂ  W
  s³   è è € å�•sÑÔð Ø
€K€K€KØ
€Få�•{”Ô.Ñ/Ô/ð .ÝŒO×&Ò& uÑ-Ô-€Eå�•{”Ô/Ñ0Ô0ð "Øð "ð "ˆÝ!:¸<Ñ!HÔ!Hð "ð "Ð
Ø!Ð!Ð!Ð!Ð!ð"ð 	€+€+€+€+€+r   c              #   ó„   K  — t          | ¦  «        D ]-}t          |t          ¦  «        r|�|j        j        |k    r|V — Œ.dS )av  Provides an iterator over references in the given config.

  Args:
    config: A dictionary mapping scoped configurable names to argument bindings.
    to: If supplied, only yield references whose `configurable_fn` matches `to`.

  Yields:
    `ConfigurableReference` instances within `config`, maybe restricted to those
    matching the `to` parameter if it is supplied.
  N)rÂ  rµ   r  r  r†   )rR  r€   rk  s      r   r„   r„   h
  s[   è è € õ )¨Ñ0Ô0ð ð €eÝ�%Õ.Ñ/Ô/ð Ø	ˆ�uÔ)Ô1°RÒ7Ð7Øˆˆˆøðð r   c                 ó
  — |rD| j         t          vr6d}t          |                     | j        t          ¦   «         ¦  «        ¦  «        ‚|r8| j        s3d}t          |                     | t          ¦   «         ¦  «        ¦  «        ‚d S d S )Nz4No bindings specified for '{}' in config string: 
{}zBReference '{}' must be evaluated (add '()') in config string: 
{}.)r$  r…   r^   rP   r  r\  rû   )rü   Úrequire_bindingsÚrequire_evaluationrþ   s       r   Úvalidate_referencerÉ  y
  s‹   € Øð H˜#œ.µÐ7Ð7ØE€GÝ
�W—^’^ CÔ$7½¹¼ÑFÔFÑ
GÔ
GÐGàð 8 ¤ð 8ð)€Gå
�W—^’^ C­©¬Ñ6Ô6Ñ
7Ô
7Ð7ð8ð 8ð 8ð 8r   rF   rs   c                 ó   — | S )zA Gin macro.r-   ro  s    r   r1   r1   „
  s	   € ð 
€,r   r3   c                  ó4   — t           t          ¦   «                  S )z7Fetches and returns a constant from the _CONSTANTS map.)rU  r¸  r-   r   r   r2   r2   Š
  s   € õ 
Õ%Ñ'Ô'Ô	(Ð(r   c                 ó:   — t          t          ¦   «         | ¦  «        S r   )Úsingleton_valuer¸  )Úconstructors    r   r4   r4   �
  s   € å	Õ*Ñ,Ô,¨kÑ	:Ô	:Ð:r   c                 ó  — | t           vrk|s$d}t          |                     | ¦  «        ¦  «        ‚t          |¦  «        s$d}t          |                     | ¦  «        ¦  «        ‚ |¦   «         t           | <   t           |          S )Nz>No singleton found for key '{}', and no constructor was given.z3The constructor for singleton '{}' is not callable.)rt  r^   rP   r  )r  rÎ  rþ   s      r   rÍ  rÍ  •
  s~   € Ø•ÐÐØð ,ØP€gÝ�w—~’~ cÑ*Ô*Ñ+Ô+Ð+Ý�KÑ Ô ð ,ØE€gÝ�w—~’~ cÑ*Ô*Ñ+Ô+Ð+Ø"�{‘}”}…K�ÑÝ	�SÔ	Ðr   c                 óJ  — t           j                             | ¦  «        s"t          d                     | ¦  «        ¦  «        ‚t
                               | ¦  «        r=d}t          |                     | t
                               | ¦  «        ¦  «        ¦  «        ‚|t
          | <   dS )a  Creates a constant that can be referenced from gin config files.

  After calling this function in Python, the constant can be referenced from
  within a Gin config file using the macro syntax. For example, in Python:

      gin.constant('THE_ANSWER', 42)

  Then, in a Gin config file:

      meaning.of_life = %THE_ANSWER

  Note that any Python object can be used as the value of a constant (including
  objects not representable as Gin literals). Values will be stored until
  program termination in a Gin-internal dictionary, so avoid creating constants
  with values that should have a limited lifetime.

  Optionally, a disambiguating module may be prefixed onto the constant
  name. For instance:

      gin.constant('some.modules.PI', 3.14159)

  Args:
    name: The name of the constant, possibly prepended by one or more
      disambiguating module components separated by periods. An macro with this
      name (including the modules) will be created.
    value: The value of the constant. This can be anything (including objects
      not representable as Gin literals). The value will be stored and returned
      whenever the constant is referenced.

  Raises:
    ValueError: If the constant's selector is invalid, or a constant with the
      given selector already exists.
  zInvalid constant selector '{}'.z4Constants matching selector '{}' already exist ({}).N)r   r„  r…  r^   rP   rU  rI  )rb   rk  rþ   s      r   r3   r3   ¡
  s’   € õD 
Ô	 ×	&Ò	& tÑ	,Ô	,ð EÝ
Ð6×=Ò=¸dÑCÔCÑ
DÔ
DÐDå×"Ò" 4Ñ(Ô(ð PØD€GÝ
�W—^’^ D­*×*GÒ*GÈÑ*MÔ*MÑNÔNÑ
OÔ
OÐOà…*ˆTÑÐÐr   c                 ó*   — |fd„}| €|S  || ¦  «        S )aÕ  Decorator for an enum class that generates Gin constants from values.

  Generated constants have format `module.ClassName.ENUM_VALUE`. The module
  name is optional when using the constant.

  Args:
    cls: Class type.
    module: The module to associate with the constants, to help handle naming
      collisions. If `None`, `cls.__module__` will be used.

  Returns:
    Class type (identity function).

  Raises:
    TypeError: When applied to a non-enum class.
  c           	      ó  — t          | t          j        ¦  «        s't          d                     | j        ¦  «        ¦  «        ‚|€| j        }| D ]3}t          d                     |t          |¦  «        ¦  «        |¦  «         Œ4| S )Nz#Class '{}' is not subclass of enum.rN  )	Ú
issubclassÚenumÚEnumr“  rP   r(   r)   r3   r÷   )r©   rV   rk  s      r   rß   z&constants_from_enum.<locals>.decoratorß
  s‰   € Ý�c�4œ9Ñ%Ô%ð ÝÐ;×BÒBØ
Œ,ñô ñ ô ð ð €~ØŒ~€fØð :ð :ˆÝˆw�~Š~˜f¥c¨%¡j¤jÑ1Ô1°5Ñ9Ô9Ð9Ð9Ø€Jr   r-   )r©   rV   rß   s      r   Úconstants_from_enumrÖ  Í
  s6   € ð$ #ð 	ð 	ð 	ð 	ð 	€[ØÐØ	ˆ�3‰ŒÐr   c                 ót   — t          | t          t          ¦  «        ¬¦  «        D ]}t          |d¬¦  «         Œd S )Nr   T)rÈ  )r„   r›   r1   rÉ  )rR  rü   s     r   Úvalidate_macros_hookrØ  ï
  sG   € å Õ+;½EÑ+BÔ+BÐCÑCÔCð 5ð 5€cÝ�s¨tÐ4Ñ4Ô4Ð4Ð4ð5ð 5r   c                 óT   — t                                |¦  «        }| › | rdnd› |› d|› �S )Nr  rS   rJ   )r˜   r5  )r#   rj   Ú
param_nameÚmin_selectors       r   Ú_format_binding_keyrÜ  õ
  s<   € Ý×+Ò+¨HÑ5Ô5€,ØÐ	D˜%Ð'�3�3 RÐ	D¨Ð	DÐ	D¸
Ð	DÐ	DÐDr   c                 ó2  — d}|                       ¦   «         D ]\  \  }}}|                      ¦   «         D ]b\  }}t          |¦  «        D ]M}t          |t          ¦  «        r6t	          |||¦  «        }|                     |¦  «        }	t          ||	¦  «         ŒNŒcŒ€dS )zBHook to find/raise errors for references to unknown configurables.z In binding for '{}'.N)rä   rÂ  rµ   r<  rÜ  rP   r   )
rR  Úadditional_msg_fmtr#   rj   Úparam_bindingsrÚ  Úparam_valueÚmaybe_unknownr_  rý   s
             r   Úfind_unknown_references_hookrâ  ú
  sÉ   € ð /ÐØ+1¯<ª<©>¬>ð Hð HÑ'Ñ€uˆh˜Ø#1×#7Ò#7Ñ#9Ô#9ð Hð HÑˆ
�KÝ4°[ÑAÔAð Hð Hˆ-Ý�mÕ%BÑCÔCð 	HÝ+¨E°8¸ZÑHÔHˆ+Ø-×4Ò4°[ÑAÔAˆ.Ý
(¨¸Ñ
GÔ
GÐ
Gøð	HðHðHð Hr   c                 ól  — |                       ¦   «         D ]ž\  \  }}}|                      ¦   «         D ]�\  }}t          |t          ¦  «        rg|j        j        t
          k    rR|                     ¦   «         }|t          u r5t          |||¦  «        }d}t          | 
                    |¦  «        ¦  «        ‚Œ‚ŒŸdS )z>Hook to find/raise errors for config bindings marked REQUIRED.z:{} set to `%gin.REQUIRED` but not subsequently overridden.N)rä   rµ   r  r  r¿   r2   r  ru  rÜ  r^   rP   )	rR  r#   rj   rß  rÚ  rà  Úconstant_valuer_  rì  s	            r   Úfind_missing_overrides_hookrå    sÆ   € ð ,2¯<ª<©>¬>ð 	6ð 	6Ñ'Ñ€uˆh˜Ø#1×#7Ò#7Ñ#9Ô#9ð 6ð 6Ñˆ
�KÝ	�KÕ!6Ñ	7Ô	7ð 6ØÔ#Ô+Õ/AÒAÐAà&×=Ò=Ñ?Ô?ˆ.Ø�xÐ'Ð'Ý-¨e°X¸zÑJÔJˆKØNˆCÝ˜SŸZšZ¨Ñ4Ô4Ñ5Ô5Ð5øð6ð	6ð 	6r   c                 ó¨   — d„ }g }|                       ¦   «         D ]$} ||¦  «        }|�|                     |¦  «         Œ%d                     |¦  «        S )a-  Convert a config string to Markdown format.

  This can be useful for rendering the config string (or operative config
  string) in dashboards that support Markdown format. Comments in the config
  string are left as Markdown headers; other lines are indented by four spaces
  to indicate they are code blocks.

  Args:
    string: The configuration string to convert to Markdown format. This should
      be the output of `gin.config_str()` or `gin.operative_config_str()`.

  Returns:
    The given configuration string in a Markdown-compatible format.
  c                 óÞ   — |                       d¦  «        sd| z   S | dd…         } |                       d¦  «        rdS |                       d¦  «        rdS |                      d	¦  «        rd
| z   S | S )z)Convert a single line to markdown format.ú#z    r  Nz====rS   ÚNonez    # None.ú:z#### )rW   Úendswith)r;  s    r   Úprocesszmarkdown.<locals>.process&  s‚   € à�?Š?˜3ÑÔð Ø�d‰]Ðà���Œ8€DØ‡‚�vÑÔð ØˆRØ‡‚�vÑÔð Øˆ]Ø‡}‚}�SÑÔð Ø�t‰^ÐØ€Kr   Nr8  )Ú
splitlinesr"   ru   )Ústringrì  Úoutput_linesr;  Ú
procd_lines        r   Úmarkdownrñ    sm   € ð ð ð ð €,Ø×ÒÑ!Ô!ð &ð &€dØ�˜‘”€JØÐØ×Ò˜*Ñ%Ô%Ð%øà	�Š�<Ñ	 Ô	 Ð r   r   rV  )FF)rS   r¯  )TT)NNNNFN)NNNN)r3  r4  )TFF)rS   rS   )TF)NN)�r+   r½  Ú
contextlibrv  rÔ  rÚ   rˆ   r.  r‹  r=  Ú	threadingrs  Útypingr   r   r   r   r   r   r	   r
   r   rF   r   r   r   Úlocalr   r/   r7   r    Úcontextmanagerr£   ÚSelectorMapr˜   rŒ   rÍ   r…   rE  rw  ry  ÚLockrx  r¶  r·  r¨  r÷  rU  rŸ   rt  ÚopenrŒ  Úisfiler~  r‘  r…  re   ru  r«   r¹   r‚   rÓ   rÜ   rñ   Ú
NamedTupleró   r   r  r
  r  r<  rG  rJ  rL  rX  rm  rp  r|  r‚  r†  r^  r�  rˆ  r•  r˜  rž  r¥  r«  r´  r    r¸  r  r÷   Ú_FnOrClsOrSelectorrÂ  rø   rÌ  rÑ  r›   ró  rƒ   r  r  r
  r  r  r  rW  rZ  r\  r^  rq  rh  rƒ  r‡  rj  r›  rŽ  rj  r~  rr  r­  r±  r³  rµ  r˜  r»  rÂ  r„   rÉ  r1   r2   r4   rÍ  r3   rÖ  rØ  rÜ  râ  rå  rñ  r-   r   r   ú<module>rý     s†  ðð Bð BðH Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ Sà Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð"ð "ð "ð "ð "�I”Oñ "ô "ð "ðJð ð ð ð ñ ô ð ðp+ð p+ð p+ð p+ð p+ñ p+ô p+ð p+ðf˜ð ð ð ð ð Ôðð ð ñ Ôðð %ˆLÔ$Ñ&Ô&€	ð Ð ð Ð ð
 €ð ˆ3‰5Œ5€ð Ð Ø'˜œÑ)Ô)Ð ð �‘”€ð €àÐ ð Ð ð &ˆ\Ô%Ñ'Ô'€
ð  �<‘>”>Ð"€ð €ð ˜œœÐ'Ð(€ð €ð �TÐ ð ˆ6‰8Œ8€à%€
ˆ>Ñ ðð ð ðð ð ð$ð ð ð ð)ð )ð )ðX!ð !ð !ðN .3Ø).ð	ið ið ið iðX	ð 	ð 	ð 	ð 	�6Ô$ñ 	ô 	ð 	ðOð Oð Oð Oð>ð >ð >ð!ð !ð !ðD^(ð ^(ð ^(ð ^(ð ^(ñ ^(ô ^(ð ^(ðB!3ð !3ð !3ð !3ð !3ñ !3ô !3ð !3ðH3ð 3ð 3ðð ð ð<ð <ð <ð <ð <�]Ô1ñ <ô <ð <ð.\)ð \)ð \)ð \)ð \)�vÔ(ñ \)ô \)ð \)ð~ð ð ð0
*ð 
*ð 
*ðð ð ð ð6% ð % ð % ðP"/ð "/ð "/ðJFð Fð Fð4Qð Qð Qð
ð 
ð 
ð#ð #ð #ðð ð ðð ð ðð ð ð$ð ð ð8	ð 	ð 	ð&ð &ð &ð#ð #ð #ð ÔðP ð P ñ ÔðP ðf ˜8 C¨ HÔ-¨t°C¬y¸#Ð=Ô>Ð ðØ-ðØ27¸À¼ÀsÐ8JÔ2Kðð ð ð ðF Øðð Øðð ðð 
ˆ#ˆsˆ(„^ð	ð ð ð ð,  $Øð)ð )Ø-ð)àð)ð ð)ð 
ˆ#ˆsˆ(„^ð	)ð )ð )ð )ðXPØ-ðPØ2:¸3À¸8Ô2DðPð Pð Pð Pð:^ð ^ð ^ðD !Ø"Ø!%Ø $Ø,1Ø%)ðað að að aðH !ØØØðTð Tð Tð Tðp  $Ø!%Ø$(Ø#'ð	)!ð )!ð )!ð )!ðX ØØØðZð Zð Zð Zðz	ð 	ð 	ð 	ð 3ð ¸¸C¼ð ð ð ð ðwð wð wð wð wñ wô wð wðv !#Ø$%ð_)ð _)ð _)ð _)ðDð ð ð ðDDð Dð Dð Dð$;ð ;ð ;ð ;ð ;¨Ô):ñ ;ô ;ð ;ð{ð {ð {ð {ð|#ð #ð #ð $/ð $/ð $/ðN-ð -ð -ð 05Ø',ð&7ð &7Øð&7à˜˜h sœmÐ+Ô,ð&7ð !%ð&7ð (ð	&7ð &7ð &7ð &7ðX !Ø/4Ø',ð2%ð 2%Ø˜8 Cœ=Ô)ð2%à�x ”}Ô%ð2%ð ð2%ð ˜˜h sœmÐ+Ô,ð	2%ð
 !%ð2%ð 2%ð 2%ð 2%ðn  Øð ð  ØAð àð ð ð ð  ð  ð  ð0Kð Kð Kðð ð ð ð  ð  ð
 Ôð+ð +ñ Ôð+ð,ð ð ð
ð ð ð
 Ôðð ñ Ôðð ð  ð  ðFð ð ð"ð ð ð"ð ð ð ð"8ð 8ð 8ð 8ð 
€�ÐÑÔðð ñ Ôðð
 
€ˆ*˜UÐ#Ñ#Ô#ð)ð )ñ $Ô#ð)ð
 
€�ÐÑÔð;ð ;ñ Ôð;ð	ð 	ð 	ð 	ð)ð )ð )ðXð ð ð ðD ð5ð 5ñ Ôð5ð
Eð Eð Eð
 ð	Hð 	Hñ Ôð	Hð ð6ð 6ñ Ôð6ð$!ð $!ð $!ð $!ð $!r   