Ë
    /�DjE  ã                   óÆ   — d dgZ ddlmZmZmZmZmZmZ e g d¢z  Z ddlm	Z	 e dgz  Z ddl
mZmZmZ e g d¢z  Z ddlmZ e dgz  Z dd	lmZmZmZ e g d	¢z  Z d
„ Zd„ Zd„ Zd„ Zy)ÚIÚQé    )ÚContrastMatrixÚ	TreatmentÚPolyÚSumÚHelmertÚDiff)ÚCr   )ÚcenterÚstandardizeÚscale)Úbsr   )ÚcrÚccÚtec                 ó   — | S )a�  The identity function. Simply returns its input unchanged.

    Since Patsy's formula parser ignores anything inside a function call
    syntax, this is useful to 'hide' arithmetic operations from it. For
    instance::

      y ~ x1 + x2

    has ``x1`` and ``x2`` as two separate predictors. But in::

      y ~ I(x1 + x2)

    we instead have a single predictor, defined to be the sum of ``x1`` and
    ``x2``.© )Úxs    úRC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\patsy/builtins.pyr   r   "   s	   € ð €Hó    c                  ó>   — t        d«      dk(  sJ ‚t        d «      �J ‚y )Né   )r   r   r   r   Útest_Ir   4   s   € ÜˆQ‹4�1Š9ÑÜˆT‹7ˆ?Ñˆ?r   c                 óˆ   — ddl m} |j                  d«      }	 |j                  |    S # t        $ r t        d| ›d�«      ‚w xY w)a<  A way to 'quote' variable names, especially ones that do not otherwise
    meet Python's variable name rules.

    If ``x`` is a variable, ``Q("x")`` returns the value of ``x``. (Note that
    ``Q`` takes the *string* ``"x"``, not the value of ``x`` itself.) This
    works even if instead of ``x``, we have a variable name that would not
    otherwise be legal in Python.

    For example, if you have a column of data named ``weight.in.kg``, then you
    can't write::

      y ~ weight.in.kg

    because Python will try to find a variable named ``weight``, that has an
    attribute named ``in``, that has an attribute named ``kg``. (And worse
    yet, ``in`` is a reserved word, which makes this example doubly broken.)
    Instead, write::

      y ~ Q("weight.in.kg")

    and all will be well. Note, though, that this requires embedding a Python
    string inside your formula, which may require some care with your quote
    marks. Some standard options include::

      my_fit_function("y ~ Q('weight.in.kg')", ...)
      my_fit_function('y ~ Q("weight.in.kg")', ...)
      my_fit_function("y ~ Q(\"weight.in.kg\")", ...)

    Note also that ``Q`` is an ordinary Python function, which means that you
    can use it in more complex expressions. For example, this is a legal
    formula::

      y ~ np.sqrt(Q("weight.in.kg"))
    r   )ÚEvalEnvironmentr   zno data named z found)Ú
patsy.evalr   ÚcaptureÚ	namespaceÚKeyErrorÚ	NameError)Únamer   Úenvs      r   r   r   9   sI   € õF +à
×
!Ñ
! !Ó
$€Cð<Ø�}‰}˜TÑ"Ð"øÜò <Ý²DÐ:Ó;Ð;ð<ús	   ™( ¨Ac                  óŒ   — d} t        d«      dk(  sJ ‚t        d«      t         u sJ ‚dd l}|j                  t        t         d«       y )Nr   Úar   r   Úasdfsadfdsad)r   ÚpytestÚraisesr!   )r%   r'   s     r   Útest_Qr)   e   s6   € Ø	€AÜˆS‹6�QŠ;ÑÜˆS‹6”Q‰;ÑÛà
‡M�M”)œQ Õ/r   N)Ú__all__Úpatsy.contrastsr   r   r   r   r	   r
   Úpatsy.categoricalr   Úpatsy.stater   r   r   Úpatsy.splinesr   Úpatsy.mgcv_cubic_splinesr   r   r   r   r   r   r)   r   r   r   ú<module>r0      sv   ðð �ˆ*€ç O× Oà ÒLÑ L€å à ˆCˆ5Ñ €ç 2Ñ 2à Ò-Ñ -€å à ˆDˆ6Ñ €ç /Ñ /à ÒÑ €òò$ò
)<óX0r   