a
    ߙfbl	                     @   s(   d Z ddlZg Zd	ddZd
ddZdS )z0Utility functions for ``constants`` sub-package.    NTc                 c   sb   ddl m} ttt|  tt| D ],\}}t||sFq0q0|rV|j|j	vr0|V  q0dS )a  
    Generator to return a Constant object.

    Parameters
    ----------
    codata, iaudata : obj
        Modules containing CODATA and IAU constants of interest.

    module : obj
        Namespace module of interest.

    not_in_module_only : bool
        If ``True``, ignore constants that are already in the
        namespace of ``module``.

    Returns
    -------
    _c : Constant
        Constant object to process.

       )ConstantN)
Zconstantr   	itertoolschainsortedvarsitems
isinstanceabbrev__dict__)codataiaudatamodulenot_in_module_onlyr   Z_nm_c r   6lib/python3.9/site-packages/astropy/constants/utils.py_get_c   s    
r   Fc              	   C   sx   t | |||dD ]b}|r:||j|j|j|j|j|j}n|}t||j| |dur|	d
|j|j|j|j qdS )a  
    Set constants in a given module namespace.

    Parameters
    ----------
    codata, iaudata : obj
        Modules containing CODATA and IAU constants of interest.

    module : obj
        Namespace module to modify with the given ``codata`` and ``iaudata``.

    not_in_module_only : bool
        If ``True``, constants that are already in the namespace
        of ``module`` will not be modified.

    doclines : list or None
        If a list is given, this list will be modified in-place to include
        documentation of modified constants. This can be used to update
        docstring of ``module``.

    set_class : bool
        Namespace of ``module`` is populated with ``_c.__class__``
        instead of just ``_c`` from :func:`_get_c`.

    )r   Nz{:^10} {:^14.9g} {:^16} {})r   	__class__r
   namevalueZ_unit_stringZuncertaintyZ	referencesetattrappendformat)r   r   r   r   ZdoclinesZ	set_classr   r   r   r   r   _set_c(   s    
r   )T)TNF)__doc__r   __all__r   r   r   r   r   r   <module>   s   
   