
    i                        d dl mZmZ d dlZd dlZ eej                        Ze ed      k  Ze Z	e ed      k  Z
e ed      k  Ze ed      k  Ze ed      k  Zd Zej                  dfd	Ze
rd
dlmZ nd dlmZ 	 ddddZy)    )VersionparseNz1.4.99z1.5.99z1.6.99z1.8.99z1.15.99c                    | dk  r| S | | dz
  z  s| S t        d      }d}|| k  rb|}|| k  rB|  |z   }d|dz
  j                         z  }||z  }|| k(  r|S ||k  r|}|dz  }|| k(  r|S || k  rB||k  r|}|dz  }|| k(  r|S || k  rb||k  r|}|S )a!  
    Find the next regular number greater than or equal to target.
    Regular numbers are composites of the prime factors 2, 3, and 5.
    Also known as 5-smooth numbers or Hamming numbers, these are the optimal
    size for inputs to FFTPACK.

    Target must be a positive integer.
          inf         )float
bit_length)targetmatchp5p35quotientp2Ns          ^/home/ubuntu/crypto_trading_bot/.venv/lib/python3.12/site-packages/statsmodels/compat/scipy.py_next_regularr      s     { fqj!%LE	
B
v+Fl !C(H10023BSAF{U1HCf}
 Fl ;E
a<I+ v+, 
EzL    c                     t        j                  | t              |z  }||j                  |      }t	        |t         j
                        st        j                  |      }|S )zReturn an array of all value.)dtype)nponesboolastype
isinstancendarrayasarray)shapevaluetypecodeouts       r   	_valarrayr%   <   sM     ''%t
$u
,Cjj"c2::&jjoJr   r   )multivariate_t
fill_valuec                   	 ddl mc m} |j                  | ||||      S # t        t
        f$ r ddlm}  || ||||      cY S w xY w)a  
    Run one of two elementwise functions depending on a condition.

    Equivalent to ``f1(*args) if cond else fill_value`` performed elementwise
    when `fill_value` is defined, otherwise to ``f1(*args) if cond else f2(*args)``.

    Parameters
    ----------
    cond : array
        The condition, expressed as a boolean array.
    args : Array or tuple of Arrays
        Argument(s) to `f1` (and `f2`). Must be broadcastable with `cond`.
    f1 : callable
        Elementwise function of `args`, returning a single array.
        Where `cond` is True, output will be ``f1(arg0[cond], arg1[cond], ...)``.
    f2 : callable, optional
        Elementwise function of `args`, returning a single array.
        Where `cond` is False, output will be ``f2(arg0[cond], arg1[cond], ...)``.
        Mutually exclusive with `fill_value`.
    fill_value : Array or scalar, optional
        If provided, value with which to fill output array where `cond` is False.
        It does not need to be scalar; it needs however to be broadcastable with
        `cond` and `args`.
        Mutually exclusive with `f2`. You must provide one or the other.
    xp : array_namespace, optional
        The standard-compatible namespace for `cond` and `args`. Default: infer.

    Returns
    -------
    Array
        An array with elements from the output of `f1` where `cond` is True and either
        the output of `f2` or `fill_value` where `cond` is False. The returned array has
        data type determined by type promotion rules between the output of `f1` and
        either `fill_value` or the output of `f2`.

    Notes
    -----
    Falls back to _lazywhere if xpx.apply_where is not available.

    ``xp.where(cond, f1(*args), f2(*args))`` requires explicitly evaluating `f1` even
    when `cond` is False, and `f2` when cond is True. This function evaluates each
    function only for their matching condition, if the backend allows for it.

    On Dask, `f1` and `f2` are applied to the individual chunks and should use functions
    from the namespace of the chunks.

    r   Nr'   )
_lazywhere)scipy._lib.array_api_extra_libarray_api_extraapply_whereImportErrorAttributeErrorscipy._lib._utilr*   )condargsf1f2r(   xpxr*   s          r   r.   r.   N   sQ    d:00tT2rjII( :/$b*b99:s   ! !AA)N)packaging.versionr   r   numpyr   scipy__version__
SP_VERSIONSP_LT_15SCIPY_GT_14SP_LT_16SP_LT_17SP_LT_19	SP_LT_116r   nanr%   _scipy_multivariate_tr&   scipy.statsr.    r   r   <module>rF      s    ,  5$$%
))l))))))++	*Z 66D  5* 9:.29:r   