
    kh                         d dl Z d dlZddZy)    Nc                    t        | t              rt        sJ d       | S | }t        j                  j	                  |      sIt        j                  j                  ||      }t        j                  j	                  |      s
J d| z         t        j                  j                  |       d   j                         }|dk(  rBt        |      5 }t        |      D ci c]  \  }}|j                         | }}}d d d        |S |dk(  r,t        |d      5 }t        j                  |      }d d d        |S J d| d       c c}}w # 1 sw Y   S xY w# 1 sw Y   S xY w)	Nz class_map dict must be non-emptyz+Cannot locate specified class map file (%s)z.txtz.pklrbz&Unsupported class map file extension (z).)
isinstancedictospathexistsjoinsplitextloweropen	enumeratestrippickleload)map_or_filenamerootclass_map_pathclass_map_extfkvclass_to_idxs           W/var/www/teggl/fontify/venv/lib/python3.12/site-packages/timm/data/readers/class_map.pyload_class_mapr      sG   /4(777t$N77>>.)dN;ww~~n-n/\_n/nn-GG$$_5b9??AM.! 	CQ5>q\BTQAGGIqLBLB	C  
&	 .$' 	*1!;;q>L	*  	Q>}oRPPu C	C 		* s*   
ED=4EE=EEE) )r   r   r        r   <module>r       s    	 r   