�
��g� � �T � d dl mZ d dlmZ d dlmZ d dlZd� Zd� Zd� Z dd
�Z
dd�ZdS )
� )�Float)�Dummy)�lambdifyNc � � | �dS t | t � � rdS t j | � � ot j | � � S )z)Check if a floating point number is validNF)�
isinstance�complex�math�isinf�isnan)�xs �g/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/plotting/textplot.py�is_validr sD � ��y��u��!�W��� ��u��z�!�}�}��2�T�Z��]�]�!2�2� c � � g }||z
}||z dz }t |� � D ]�}t | | � � r�| | |z
|z } t | � � s|� d� � �Jt | |z |dz z |dz
z |z � � � � � }
t |
� � }
|� |
� � ��|� d� � ��|S )z�Rescale the given array `y` to fit into the integer values
between `0` and `H-1` for the values between ``mi`` and ``ma``.
� N� )�ranger �appendr �round�int)�y�W�H�mi�ma�y_new�norm�offsetr �
normalized�rescaleds r
�rescaler! s� � �
�E�
��7�D��2�g��]�F�
�1�X�X�
�
���A�a�D�>�>� ��A�$��-�4�/�J��J�'�'�
'����T�"�"�"�"� �*�Q�,��1��"4��1��!=�a�!?�@�@�F�F�H�H���x�=�=�����X�&�&�&�&��L�L�������Lr c �B � ��� �� �fd�t �� � D � � S )Nc �2 �� g | ]}���z
|z �d z
z z ��S )r � )�.0r �num�start�stops ���r
�
<listcomp>zlinspace.<locals>.<listcomp>) s0 �� �E�E�E�Q�E�T�E�\�Q�&�#�a�%�0�0�E�E�Er )r )r'