
    _}dg                     *    d dl mZ d dlmZ d Zd ZdS )    )parse)	force_strc                 X   t          j        t          |                     \  }}}}}t          j        |d          }t          |          g|t          |          <   t          j        t          |                                          d          }t          j        |||||f          S )z
    Given a URL and a key/val pair, set or replace an item in the query
    parameters of the URL, and return the new URL.
    Tkeep_blank_valuesdoseq)r   urlsplitr   parse_qs	urlencodesorteditems
urlunsplit)	urlkeyvalschemenetlocpathqueryfragment
query_dicts	            X/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/rest_framework/utils/urls.pyreplace_query_paramr      s    
 /4nYs^^.L.L+VVT5(>>>J"+C..!1Jy~~OF:#3#3#5#566dCCCEVVT5(CDDD    c                 D   t          j        t          |                     \  }}}}}t          j        |d          }|                    |d           t          j        t          |                                          d          }t          j        |||||f          S )zx
    Given a URL and a key/val pair, remove an item in the query
    parameters of the URL, and return the new URL.
    Tr   Nr   )	r   r
   r   r   popr   r   r   r   )r   r   r   r   r   r   r   r   s           r   remove_query_paramr      s    
 /4nYs^^.L.L+VVT5(>>>JNN3OF:#3#3#5#566dCCCEVVT5(CDDDr   N)urllibr   django.utils.encodingr   r   r    r   r   <module>r"      sY          + + + + + +	E 	E 	E	E 	E 	E 	E 	Er   