o
    [h?                     @   sT   d dl Z d dlZd dlZd dlZddlmZ dedefddZdedefd	d
Z	dS )    N   )WINDOWSpathreturnc                 C   s.   t jt j| } tjdtj| }|S )zh
    Convert a path to a file: URL.  The path will be made absolute and have
    quoted path parts.
    file:)	osr   normpathabspathurllibparseurljoinrequestpathname2url)r   url r   /home/ubuntu/experiments/live_experiments/Pythonexperiments/Otree/venv/lib/python3.10/site-packages/pip/_internal/utils/urls.pypath_to_url	   s   r   r   c                 C   s   |  dsJ d| dtj| \}}}}}|r|dkr!d}ntr(d| }ntd| tj|| }tr\|s\t|dkr\|d	 d
kr\|d t	j
v r\|dd dv r\|dd }|S )z(
    Convert a file: URL to a path.
    r   z1You can only turn file: urls into filenames (not )	localhost z\\z8non-local file URIs are not supported on this platform:    r   /r         ):z:/N)
startswithr
   r   urlsplitr   
ValueErrorr   url2pathnamelenstringascii_letters)r   _netlocr   r   r   r   url_to_path   s0   

r$   )
r   r    urllib.parser
   urllib.requestcompatr   strr   r$   r   r   r   r   <module>   s    
