+
    i/                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt R tRR ltR tRR ltR tR tR tR# )    Tuple)Basic)Expr)AppliedUndef)
Relational)Dummy)sympify)BooleanFunction)ImageSet)	FiniteSet)Indexedc                >   \        V \        \        \        34      '       g   V .p \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       d   \        4       # \        4       P
                  ! V  Uu. uF  qP                  \        4      NK  	  up!  pVP
                  ! V  Uu. uF  qP                  \        4      NK  	  up!  pT;'       g2    \        4       P
                  ! V  Uu. uF  qP                  NK  	  up!  # u upi u upi u upi )zReturns the free symbols of a symbolic expression.

If the expression contains any of these elements, assume that they are
the "free symbols" of the expression:

* indexed objects
* applied undefined function (useful for sympy.physics.mechanics module)
c              3   8   "   T F  p\        V4      x  K  	  R # 5iNcallable).0es   & t/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/plotting/utils.py	<genexpr>$_get_free_symbols.<locals>.<genexpr>   s     
&18A;;s   FT)

isinstancelisttuplesetallunionatomsr   r   free_symbols)exprsr   frees   &  r   _get_free_symbolsr#      s     edE3/00
s
&
&sss
&
&&&u5;;595a)59:D::u=u!-u=>D@@35;; ?A ?@@ := ?s   D3D7Dc           	         V P                  \        4      pV FK  p\        V4      p\        \	        ^ X4       Uu. uF  p\        V4      NK  	  up!  pV P                  W54      p KM  	  V # u upi )ao  Extract numerical solutions from a set solution (computed by solveset,
linsolve, nonlinsolve). Often, it is not trivial do get something useful
out of them.

Parameters
==========

n : int, optional
    In order to replace ImageSet with FiniteSet, an iterator is created
    for each ImageSet contained in `set_sol`, starting from 0 up to `n`.
    Default value: 10.
)findr   iterr   rangenextsubs)set_solnimagesimitss   &&    r   extract_solutionr0   !   sb     \\(#F"X%1+6+QR+67,,r%  N 7s   A)
c                   \        V \        4      '       d   V # \        V 4      p \        V 4       F  w  r\        V\        \        34      '       d   \        \        V4      RR/ W&   K9  \        V\        \        34      '       d   KW  \        V4      '       d   Kj  VP                  P                  R8X  d   \        V\        4      '       g   K  \        V4      W&   K  	  V # )a  This function recursively loop over the arguments passed to the plot
functions: the sympify function will be applied to all arguments except
those of type string/dict.

Generally, users can provide the following arguments to a plot function:

expr, range1 [tuple, opt], ..., label [str, opt], rendering_kw [dict, opt]

`expr, range1, ...` can be sympified, whereas `label, rendering_kw` can't.
In particular, whenever a special character like $, {, }, ... is used in
the `label`, sympify will raise an error.
r
   FVector)r   r   r   	enumerater   r   _plot_sympifystrdictr   	__class____name__r   r
   )argsias   &  r   r4   r4   6   s     $:D$a$'']1-=u=DGQd,,
 %%1:a;O;OajDG   K    Nc                h   R p\        V 4      pVe    VP                  VP                  4       4      p\        V4      V8  dB   \	        RRP                  V4      ,           RP                  \        V4      V4      ,           4      h\        V4      V8  d   \	        R\        V4      : RV: 24      h\        4       P                  V Uu. uF  qw^ ,          NK  	  up4      p\        V4      \        V4      8w  d   \	        R4      h\        V4      V8  d   VP                  V4      p	V	\        4       8w  d!   V	 F  p
VP                  V! V
4      4       K  	  \        V\        V4      ,
          4       F"  pVP                  V! \        4       4      4       K$  	  \        V4      V8X  d   \        4       P                  V Uu. uF  qw^ ,          NK  	  up4      p\        VP                  V4      4      ^ 8  d8   \	        RR	P                  V4      ,           R
P                  V4      ,           4      hV# u upi u upi )a  This function does two things:

1. Check if the number of free symbols is in agreement with the type of
   plot chosen. For example, plot() requires 1 free symbol;
   plot3d() requires 2 free symbols.
2. Sometime users create plots without providing ranges for the variables.
   Here we create the necessary ranges.

Parameters
==========

exprs : iterable
    The expressions from which to extract the free symbols
ranges : iterable
    The limiting ranges provided by the user
npar : int
    The number of free symbols required by the plot functions.
    For example,
    npar=1 for plot, npar=2 for plot3d, ...
params : dict
    A dictionary mapping symbols to parameters for interactive plot.
c                     \        V R^
4      # )
   ir   )symbols   &r   <lambda> _create_ranges.<locals>.<lambda>l   s    uVS"'=r<   zToo many free symbols.
zExpected {} free symbols.
zReceived {}: {}zToo many ranges. Received z, expected z$Multiple ranges with the same symbolz>Incompatible free symbols of the expressions with the ranges.
z$Free symbols in the expressions: {}
zFree symbols in the ranges: {})r#   
differencekeyslen
ValueErrorformatr   r   appendr'   r	   )r!   rangesnparlabelparamsget_default_ranger    rrfssymbolsr/   r:   s   &&&&&       r   _create_rangesrQ   U   s   . >$U+L#..v{{}=
<4&+22489&&s<'8,GH
 	
 6{T;>v;MO 	O %++V,VttV,
-C
3x3v;?@@
6{T))#.ce/23  tc&k)*AMM+EG45 + <D  ekk0AQ4401|&&s+,q0 9@@NO 399#>?  M5 -$ 1s   H*:H/c                   \        V \        4      ;'       d    \        V 4      ^8H  ;'       d    \        V P                  ^,          \        4      '       * ;'       dq    V P                  ^,          P
                  ;'       dL    \        V P                  ^,          \        4      '       * ;'       d    V P                  ^,          P
                  # )zMA range is defined as (symbol, start, end). start and end should
be numbers.
)r   r   rE   r9   r5   	is_number)rN   s   &r   	_is_rangerT      s     	1e 	E 	EVq[	E 	EAFF1Is++	E 	E121D1D	E 	E AFF1Is++	E 	E 231D1D	r<   c                 X   V  Uu. uF  p\        V4      '       g   K  VNK  	  ppV  Uu. uF  p\        V\        4      '       g   K  VNK  	  ppV'       g   RMV^ ,          pV  Uu. uF  p\        V\        4      '       g   K  VNK  	  ppV'       g   RMV^ ,          pV  Uu. uF=  p\        V4      ;'       g#    \        V\        \        34      ;'       g    VRJ '       * NK?  	  pp\	        W4       UUu. uF  w  rhV'       g   K  VNK  	  p	ppWWE3# u upi u upi u upi u upi u uppi )aR  Given a list/tuple of arguments previously processed by _plot_sympify()
and/or _check_arguments(), separates and returns its components:
expressions, ranges, label and rendering keywords.

Examples
========

>>> from sympy import cos, sin, symbols
>>> from sympy.plotting.utils import _plot_sympify, _unpack_args
>>> x, y = symbols('x, y')
>>> args = (sin(x), (x, -10, 10), "f1")
>>> args = _plot_sympify(args)
>>> _unpack_args(*args)
([sin(x)], [(x, -10, 10)], 'f1', None)

>>> args = (sin(x**2 + y**2), (x, -2, 2), (y, -3, 3), "f2")
>>> args = _plot_sympify(args)
>>> _unpack_args(*args)
([sin(x**2 + y**2)], [(x, -2, 2), (y, -3, 3)], 'f2', None)

>>> args = (sin(x + y), cos(x - y), x + y, (x, -2, 2), (y, -3, 3), "f3")
>>> args = _plot_sympify(args)
>>> _unpack_args(*args)
([sin(x + y), cos(x - y), x + y], [(x, -2, 2), (y, -3, 3)], 'f3', None)
N)rT   r   r5   r6   zip)
r9   trI   labelsrK   rendering_kwr;   resultsbr!   s
   *         r   _unpack_argsr\      s    4 .A1aaF.4AAs!3aaF4DF1IE#;t!z!T':AAtL;+4aL Y]]X\STIaLMMJq3+$>MM19NX\G]t-3-41QQ-E3%-- /4; ^3s?   DDDD%DD!D!8D!D!4D&D&c                   V '       g   . # . pVP                  RR4      p\        ;QJ d    R V RV  4       F  '       d   K   RM	  RM! R V RV  4       4      '       d   \        V !  w  rgr\        4       P                  ! V U
u. uF  qP
                  NK  	  up
!  p\        WgW(V4      pV^8  d   \        V4      V8X  d   \        V4      3pV FE  p\        V\        \        \        34      pV'       d   V3MTp
VP                  . V
OVOVNV	N54       KG  	  V# \        V !  w  rrV'       d   V.M. p\        V4      \        V4      ,           V	e   \        V	4      M^ ,           pV^ 8  d   V RV)  MT p\        V^ ,          \        \        \        34      '       g   V.pV EF  pV Uu. uF  p\        V\         4      '       g   K  VNK  	  ppV'       g   TpV Uu. uF  p\#        V4      '       g   K  VNK  	  ppV'       g   VP%                  4       pV Uu. uF  p\        V\&        4      '       g   K  VNK  	  pp\        V4      ^ 8X  d   T	MV^ ,          p\)        V4       Uu. uF  pVV,          NK  	  pp\        4       p\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d+   VP                  ! V Uu. uF  pVP
                  NK  	  up!  p\        V4      V8w  d   \        VVVRV4      pV'       g   RMV^ ,          pVP                  . VOVOVNVN54       EK  	  V# u up
i u upi u upi u upi u upi u upi )a  Checks the arguments and converts into tuples of the
form (exprs, ranges, label, rendering_kw).

Parameters
==========

args
    The arguments provided to the plot functions
nexpr
    The number of sub-expression forming an expression to be plotted.
    For example:
    nexpr=1 for plot.
    nexpr=2 for plot_parametric: a curve is represented by a tuple of two
        elements.
    nexpr=1 for plot3d.
    nexpr=3 for plot3d_parametric_line: a curve is represented by a tuple
        of three elements.
npar
    The number of free symbols required by the plot functions. For example,
    npar=1 for plot, npar=2 for plot3d, ...
**kwargs :
    keyword arguments passed to the plotting function. It will be used to
    verify if ``params`` has ben provided.

Examples
========

.. plot::
   :context: reset
   :format: doctest
   :include-source: True

   >>> from sympy import cos, sin, symbols
   >>> from sympy.plotting.plot import _check_arguments
   >>> x = symbols('x')
   >>> _check_arguments([cos(x), sin(x)], 2, 1)
   [(cos(x), sin(x), (x, -10, 10), None, None)]

   >>> _check_arguments([cos(x), sin(x), "test"], 2, 1)
   [(cos(x), sin(x), (x, -10, 10), 'test', None)]

   >>> _check_arguments([cos(x), sin(x), "test", {"a": 0, "b": 1}], 2, 1)
   [(cos(x), sin(x), (x, -10, 10), 'test', {'a': 0, 'b': 1})]

   >>> _check_arguments([x, x**2], 1, 1)
   [(x, (x, -10, 10), None, None), (x**2, (x, -10, 10), None, None)]
rL   Nc              3   X   "   T F   p\        V\        \        \        34      x  K"  	  R # 5ir   )r   r   r   r   r   r;   s   & r   r   #_check_arguments.<locals>.<genexpr>  s!     
T|!:a$
O<==|s   (*FTc              3   B   "   T F  p\        V4      '       * x  K  	  R # 5ir   r   r_   s   & r   r   r`   <  s     0Cqx{??Cs    )getr   r\   r   r   r    rQ   rE   r   r   r   r   r   rH   r   r   r5   rT   copyr6   r'   )r9   nexprrJ   kwargsoutputrL   r!   rI   rK   rY   r   r    expris_expr_rX   r+   new_argsargr;   lrN   rend_kwr:   s   &&&,                    r   _check_argumentsro      s   ` 	FZZ$'F
s
TtFU|
Tsss
TtFU|
TTT
 .:4-@*uu{{U$CU^^U$CDtFC19 5zU"uD !j/'JKG"AMM<A<<<|<= d MM +7*='6#& [3v;&".":SC !A4!94
 (1+eU';<< zH C6Cq:a#5CA60Cq9Q<CA0KKM"%=#QAt)<qq#G=&)'la&7lWQZG $)<0<a3q66<C05Ls0C0sss0C000+11C3PCqANNC3PQ1v~"34V< !DqtEMM4C4!4U4G45+ , Mu %DL 7 1 >
 1 4Qs6   L8'L=L=M2MM3M#MM
)r?   )rb   N)sympy.core.containersr   sympy.core.basicr   sympy.core.exprr   sympy.core.functionr   sympy.core.relationalr   sympy.core.symbolr	   sympy.core.sympifyr
   sympy.logic.boolalgr   sympy.sets.fancysetsr   sympy.sets.setsr   sympy.tensor.indexedr   r#   r0   r4   rQ   rT   r\   ro    r<   r   <module>r|      sN    ' "   , , # & / ) % (A&*>CL
#.Lur<   