a
    �Ï?e  ã                   @   sr   d Z ddlZddlZddlZddœdd„Zejeejf ddœdd„Zej	d	ej
f ej	d	ej
f d
œdd„ZdS )z5Provides utility functions in anyconfig.backend.base.é    N)Úreturnc                  O   s
   t ƒ ‚dS )zRaise NotImplementedError.N)ÚNotImplementedError)Ú_argsÚ_kwargs© r   ú_/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/anyconfig/backend/base/utils.pyÚnot_implemented   s    r   )Úfilepathr   c                 C   s   t  | ¡jjddd� dS )zgMake dir to dump 'filepath' if that dir does not exist.

    :param filepath: path of file to dump
    T)ÚparentsÚexist_okN)ÚpathlibÚPathÚparentÚmkdir)r	   r   r   r   Úensure_outdir_exists   s    r   .)Úfuncr   c                    s   t  ˆ ¡‡ fdd„ƒ}|S )zˆLift :func:`func` to a method.

    It will be called with the first argument 'self' ignored.

    :param func: Any callable object
    c                     s   ˆ | dd… i |¤ŽS )zOriginal function decorated.é   Nr   )ÚargsÚkwargs©r   r   r   Úwrapper    s    zto_method.<locals>.wrapper)Ú	functoolsÚwraps)r   r   r   r   r   Ú	to_method   s    r   )Ú__doc__r   r   Útypingr   ÚUnionÚstrr   r   ÚCallableÚAnyr   r   r   r   r   Ú<module>   s   ÿ