
    BVh                     $    d Z ddlZddlZd Zd Zy)zHelper functions for modules.    Nc                     t         j                  j                  t         j                  j                  t         j                  j	                  | j
                        d            S )Nz..)ospathabspathjoindirname__file__)modules    S/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/tools/module_util.pyget_parent_dirr      s5    	bggoofoo&FM	NN    c                 D   | j                  d      }|sy	 t        j                  j                  |d         }|r|j
                  syt        j                  j                  |j
                        }t        j                  j                  |g|dd  S # t        $ r Y yw xY w)a  Get parent directory for module with the given name.

  Args:
    module_name: Module name, e.g. tf_keras.api._v2.keras.

  Returns:
    Path to the parent directory if module is found and None otherwise.
    Given example above, it should return:
      /root_path/tf_keras/api/_v2.
  .Nr      )
split	importlibutil	find_spec
ValueErrororiginr   r   r   r   )module_name
name_splitspec	base_paths       r   get_parent_dir_for_namer      s       %*	>>##JqM2D 
T[[ggoodkk*)	i	3*Qr"2	33 
 s   "B 	BB)__doc__r   r   r   r    r   r   <module>r      s    $ 	 O4r   