o
    ®Ÿ?e9  ã                   @   s(   d Z ddlZddlZdd„ Zdd„ ZdS )zHelper functions for modules.é    Nc                 C   s    t j t j t j | j¡d¡¡S )Nz..)ÚosÚpathÚabspathÚjoinÚdirnameÚ__file__)Úmodule© r	   úd/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/tools/module_util.pyÚget_parent_dir   s    r   c                 C   st   |   d¡}|s	dS z
tj |d ¡}W n
 ty   Y dS w |r#|js%dS tj |j¡}tjj	|g|dd… ¢R Ž S )aj  Get parent directory for module with the given name.

  Args:
    module_name: Module name for e.g.
      tensorflow_estimator.python.estimator.api._v1.estimator.

  Returns:
    Path to the parent directory if module is found and None otherwise.
    Given example above, it should return:
      /pathtoestimator/tensorflow_estimator/python/estimator/api/_v1.
  Ú.Nr   é   éÿÿÿÿ)
ÚsplitÚ	importlibÚutilÚ	find_specÚ
ValueErrorÚoriginr   r   r   r   )Úmodule_nameZ
name_splitÚspecÚ	base_pathr	   r	   r
   Úget_parent_dir_for_name   s   
ÿ
r   )Ú__doc__r   r   r   r   r	   r	   r	   r
   Ú<module>   s
   