
    ^hw                     n    S r SSKJr  S\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS	\SS
4S jrg
)z
Formatting numeric literals.
    )Leaftextreturnc                 <    U SS U SS p!U UR                  5        3$ )z,
Formats a hexadecimal string like "0x12B3"
N   )upperr   beforeafters      H/home/james-whalen/.local/lib/python3.13/site-packages/black/numerics.py
format_hexr      s,     !Hd12hEXekkm_%%    c                     U R                  S5      u  pSnUR                  S5      (       a  USS nSnOUR                  S5      (       a  USS n[        U5      nU SU U 3$ )z6Formats a numeric string utilizing scientific notatione -   N+)split
startswithformat_float_or_int_string)r   r
   r   signs       r   format_scientific_notationr      sr    JJsOMFDab				#		ab	'/FXQtfUG$$r   c                 4    U SS nU S   n[        U5       U 3$ )z#Formats a complex string like `10j`N)r   )r   numbersuffixs      r   format_complex_numberr      s+    #2YF"XF(01&::r   c                 j    SU ;  a  U $ U R                  S5      u  pU=(       d    S SU=(       d    S 3$ )z"Formats a float string like "1.0"..r   )r   r	   s      r   r   r   $   s6    
$JJsOMFk]!EJQ<((r   leafNc                 4   U R                   R                  5       nUR                  S5      (       a  OaUR                  S5      (       a  [        U5      nO?SU;   a  [	        U5      nO-UR                  S5      (       a  [        U5      nO[        U5      nXl         g)z{Normalizes numeric (float, int, and complex) literals.

All letters used in the representation are normalized to lowercase.)0o0b0xr   jN)valuelowerr   r   r   endswithr   r   )r!   r   s     r   normalize_numeric_literalr*   -   sz     ::D|$$			$	)$/	s		$T*)$/Jr   )	__doc__blib2to3.pytreer   strr   r   r   r   r*    r   r   <module>r/      sn    !&S &S &
%S 
%S 
%; ; ;)S )S )D T r   