�
M�gi) � �� � d Z dZdZdZdZddlZddlZddlmZm Z ddl
mZmZ e
� � Zdd
�Zefd�Zd� Z G d
� de� � Z G d� de
� � Z G d� de
� � Zd� Zd� ZdS )z7 Identify specific nodes in a JSON document (RFC 6901) u Stefan Kögl <stefan@skoegl.net>z3.0.0z2https://github.com/stefankoegl/python-json-pointerzModified BSD License� N)�Mapping�Sequence)�tee�chainTc �N � t |� � }|� | ||� � S )a� Resolves a pointer against doc and sets the value of the target within doc.
With inplace set to true, doc is modified as long as pointer is not the
root.
>>> obj = {'foo': {'anArray': [ {'prop': 44}], 'another prop': {'baz': 'A string' }}}
>>> set_pointer(obj, '/foo/anArray/0/prop', 55) == {'foo': {'another prop': {'baz': 'A string'}, 'anArray': [{'prop': 55}]}}
True
>>> set_pointer(obj, '/foo/yet another prop', 'added prop') == {'foo': {'another prop': {'baz': 'A string'}, 'yet another prop': 'added prop', 'anArray': [{'prop': 55}]}}
True
>>> obj = {'foo': {}}
>>> set_pointer(obj, '/foo/a%20b', 'x') == {'foo': {'a%20b': 'x' }}
True
)�JsonPointer�set)�doc�pointer�value�inplaces �[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/jsonpointer.py�set_pointerr 1 s'