
    Vh                    b    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	m
Z
 dZ e	i       ad Zd
d	Zy)a|  
Context of the running Ansible.

In the future we *may* create Context objects to allow running multiple Ansible plays in parallel
with different contexts but that is currently out of scope as the Ansible library is just for
running the ansible command line tools.

These APIs are still in flux so do not use them unless you are willing to update them with every Ansible release
    )annotations)MappingSet)is_sequence)CLIArgsGlobalCLIArgs)CLIARGSc                .    t        j                  |       ay)z%Initialize the global context objectsN)r   from_optionsr	   )cli_argss    ?/home/dcms/DCMS/lib/python3.12/site-packages/ansible/context.py_init_global_contextr      s     ((2G    Nc                      fd}|S )aA  Closure over getting a key from CLIARGS with shallow copy functionality

    Primarily used in ``FieldAttribute`` where we need to defer setting the default
    until after the CLI arguments have been parsed

    This function is not directly bound to ``CliArgs`` so that it works with
    ``CLIARGS`` being replaced
    c                     t         j                        } s| S t        |       r| d d  S t        | t        t
        f      r| j                         S | S )N)default)r	   getr   
isinstancer   r   copy)valuer   keyshallowcopys    r   innerz#cliargs_deferred_get.<locals>.inner-   sM    C1L8O~.::<r    )r   r   r   r   s   ``` r   cliargs_deferred_getr   $   s     Lr   )NF)__doc__
__future__r   collections.abcr   r   'ansible.module_utils.common.collectionsr   ansible.utils.context_objectsr   r   __all__r	   r   r   r   r   r   <module>r"      s4    # ( ? @  "+
3r   