Team Ai
Apppublic

MachineLearningReply/docwhiz

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
check_pydantic_version.cpython-39.pyc8 linesDownload Raw Back to __pycache__
1a

2��f3�@s,ddlZddlZddlZdd�Zdd�ZdS)�Nc34Cs�t�|�D]�\}}}|D]r}tj�||�}|�d�s>|�d�rtj|dd��.}|D]}	t|	�||�dd�qRWd�q1s�0Yqq5dS)Nz.txtz.pyT)�inplace�)�end)	�os�walk�path�join�endswith�	fileinputZ	FileInput�print�replace)6Zfolder_pathZold_strZnew_str�subdir�dirs�files�file�	file_path�f�line�r�I/Users/a.madhigirigopinath/search_mlReply/utils/check_pydantic_version.py�replace_string_in_filessrcCsftj}|�d�dd}t|dd��}|��}Wd�n1sD0Yd|vrbt|dd�dS)N�pydanticr�haystackz7/schema.py�rzfrom pydantic.v1z
from pydantic)r�__file__�split�open�readr)Zmodule_file_pathrZhaystack_schema_filerrr�use_pydantic_v1s&r)rrr8rrrrrr�<module>s