
    ^i,                        d Z ddlmZ ddZy)z3Binary search function for Unicode interval tables.    )annotationsc                    d}t        |      dz
  }| |d   d   k  s| ||   d   kD  ry||k\  r1||z   dz  }| ||   d   kD  r|dz   }n| ||   d   k  r|dz
  }ny||k\  r1y)a  
    Binary search in interval table.

    :param ucs: Ordinal value of unicode character.
    :param table: Tuple of starting and ending ranges of ordinal values,
        in form of ``((start, end), ...)``.
    :returns: 1 if ordinal value ucs is found within lookup table, else 0.
    r         )len)ucstablelbounduboundmids        V/home/ubuntu/crypto_trading_bot/.venv/lib/python3.12/site-packages/wcwidth/bisearch.pybisearchr      s     FZ!^F
U1Xa[C%-"22
F
1$sA1WF5:a= 1WF F
     N)r   intr	   ztuple[tuple[int, int], ...]returnr   )__doc__
__future__r   r    r   r   <module>r      s    9 "r   