
    Sܶiv                         d dl Z d dlZd dlZd dlZd dlmZmZmZmZm	Z	 d dl
Zd dlZd dlZddlmZmZmZmZmZmZmZ ddlmZmZ ddlmZ ddlmZmZmZ ddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' erdd	l(m)Z) dd
ddddddddddddddde	e*ej+        ej,        f         dee-         de	e.ee.df         f         dee.         dee.         dee.         de-dee*         de-d e-d!e*d"e*d#e	e*ee.         f         d$ee.         fd%Z/d& Z0e1d'k    r e0             dS dS )(    N)TYPE_CHECKINGListOptionalTupleUnion   )FRAMES_PER_SECOND
HOP_LENGTHN_FRAMES	N_SAMPLESSAMPLE_RATElog_mel_spectrogrampad_or_trim)DecodingOptionsDecodingResult)add_word_timestamps)	LANGUAGESTO_LANGUAGE_CODEget_tokenizer)	exact_divformat_timestampget_end
get_writer	make_safeoptional_floatoptional_intstr2bool)Whisper)        皙?g?333333?g?      ?333333@      r!   TF   "'“¿([{-   "'.。,，!！?？:：”)]}、0)verbosetemperaturecompression_ratio_thresholdlogprob_thresholdno_speech_thresholdcondition_on_previous_textinitial_promptcarry_initial_promptword_timestampsprepend_punctuationsappend_punctuationsclip_timestampshallucination_silence_thresholdmodelr   audior(   r)   .r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   c                D   STUV                      dd          rt          j        nt          j        } j        t          j        d          k    rbt          j                                        rt          j        d           |t          j        k    r t          j        d           t          j        }|t          j        k    rdd<   t          | j
        j        t                    }|j        d         t          z
  }t          |t           z  t"          z            }                     d	d
          Ɖ j        sdd	<   n|rt'          d           t)          |t                                         j                                      |          }                     |          \  }}t/          ||j                   d	<   |5t'          dt0          d	                                                              d	         }                     dd          }t5           j         j        ||          Ut9          |t:                    r#d |r|                    d          ng D             }d |D             }t?          |          dk    r|                     d           t?          |          dz  dk    r|                     |           tC          tE          |d
d
d         |dd
d                             }dS|
r|dk    rt          j        d           dt          j#        dtH          f fd}d}||         d         TtK          t           j
        j&                  }|t           z  t"          z  }g }g } d}! j
        j'        dz  dz
  }"|RU(                    d|)                                z             }#|*                    |#           |"t?          |#          z  }"ng }#dt          d t          d!t          j#        d"tH          fTUfd#}$tW          j+        |d$|du%          5 }%d&}&|t?          |          k     r||         \  }'}(T|'k     r|'TT|(k    r'|dz  }|t?          |          k     r||         d         TTt          Tt           z  t"          z            })t          Tt          z   t           z  t"          z            }*tY          t          |Tz
  |(Tz
            }+|d
d
TT|+z   f         }|+t           z  t"          z  },t)          |t                                         j                                      |          }|	r9t/          t?          |#          |!          }-||-d
         |" d
         }.|#|.z   d'<   n||!d
         d'<    ||          }/t          j-        |/j.                  }0#|/j/        k    }1|/j0        k    rd}1|1rT|+z  TT}2g }3d(tb          dt          fd)Vdtd          tb                   dtf          fSVfd*}4d+th          tb                   dtd          tb                   fd,}5|05                    Uj6                  }6|6d-d
         7                                ddgk    }7t          j8        |6d
d         |6dd
         z            d         }8|89                    d           t?          |8          dk    r|87                                }9|7r"|9                     t?          |0                     d}:|9D ]};|0|:|;         }<|<d         :                                Uj6        z
  }=|<d         :                                Uj6        z
  }>|3                      |$|)|=|z  z   |)|>|z  z   |<|/.                     |;}:|7rT|+z  Tn|0|:dz
           :                                Uj6        z
  }?T|?|z  z  Tn|,}@|0|6;                                <                                         }At?          |A          dk    rJ|Ad         :                                Uj6        k    r'|Ad         :                                Uj6        z
  }?|?|z  }@|3                      |$|)|)|@z   |0|/.                     T|+z  T|
rt{          |3 U||+|||&/           |7s.t}          |3          }B|B|B|)k    rt          |Bt          z            T||}C|7s?t}          |3          }B|B.|B|)k    r(|*|Bz
  }D|D|Ck    rt          |Bt          z            Tn|2|+z   T |5|3          }E|E8 |4|E          r-|Ed         |)z
  }F|F|Ck    r|2t          |Ft          z            z   T|&}Gt          t?          |3                    D ]}H|3|H         }I|Id0         s |4|I          r |5|3|Hdz   d
                   }J|J|Jd0         d         d         }Kn|)|,z   }K|Id         |Gz
  |Ck    p|Id         |Ck     p|Id         |)z
  d1k     }L|K|Id          z
  |Ck    p |4|J          p|*|Id          z
  d1k     }M|LrJ|MrHt          t/          |)dz   |Id                   t          z            T||Id          z
  |Ck     r|Tg |3|Hd
<    n	|Id          }Gt}          |3          }B|B|B}&|r^|3D ][}I|Id         |Id          |Id2         }P}O}Nd3t          |N           d4t          |O           d5|P }Qt'          t          |Q                     \t          |3          D ]D\  }R}I|Id         |Id          k    s|Id2         )                                d6k    rd6|Id2<   g |Id!<   g |Id0<   E| *                    d7 t          |3t?          |           8          D                        |*                    d9 |3D                        |r|/jE        d:k    rt?          |          }!|%F                    tY          |T          |2z
             |t?          |          k     d
d
d
           n# 1 swxY w Y   tc          UG                    |t?          |#          d
                   | |;          S )<a  
    Transcribe an audio file using Whisper

    Parameters
    ----------
    model: Whisper
        The Whisper model instance

    audio: Union[str, np.ndarray, torch.Tensor]
        The path to the audio file to open, or the audio waveform

    verbose: bool
        Whether to display the text being decoded to the console. If True, displays all the details,
        If False, displays minimal details. If None, does not display anything

    temperature: Union[float, Tuple[float, ...]]
        Temperature for sampling. It can be a tuple of temperatures, which will be successively used
        upon failures according to either `compression_ratio_threshold` or `logprob_threshold`.

    compression_ratio_threshold: float
        If the gzip compression ratio is above this value, treat as failed

    logprob_threshold: float
        If the average log probability over sampled tokens is below this value, treat as failed

    no_speech_threshold: float
        If the no_speech probability is higher than this value AND the average log probability
        over sampled tokens is below `logprob_threshold`, consider the segment as silent

    condition_on_previous_text: bool
        if True, the previous output of the model is provided as a prompt for the next window;
        disabling may make the text inconsistent across windows, but the model becomes less prone to
        getting stuck in a failure loop, such as repetition looping or timestamps going out of sync.

    word_timestamps: bool
        Extract word-level timestamps using the cross-attention pattern and dynamic time warping,
        and include the timestamps for each word in each segment.

    prepend_punctuations: str
        If word_timestamps is True, merge these punctuation symbols with the next word

    append_punctuations: str
        If word_timestamps is True, merge these punctuation symbols with the previous word

    initial_prompt: Optional[str]
        Optional text to provide as a prompt for the first window. This can be used to provide, or
        "prompt-engineer" a context for transcription, e.g. custom vocabularies or proper nouns
        to make it more likely to predict those word correctly.

    carry_initial_prompt: bool
        If carry_initial_prompt is True, `initial_prompt` is prepended to the prompt of each internal
        `decode()` call. If there is not enough context space at the start of the prompt, it is
        left-sliced to make space.

    decode_options: dict
        Keyword arguments to construct `DecodingOptions` instances

    clip_timestamps: Union[str, List[float]]
        Comma-separated list start,end,start,end,... timestamps (in seconds) of clips to process.
        The last end timestamp defaults to the end of the file.

    hallucination_silence_threshold: Optional[float]
        When word_timestamps is True, skip silent periods longer than this threshold (in seconds)
        when a possible hallucination is detected

    Returns
    -------
    A dictionary containing the resulting text ("text") and segment-level details ("segments"), and
    the spoken language ("language"), which is detected when `decode_options["language"]` is None.
    fp16Tcpuz2Performing inference on CPU when CUDA is availablez0FP16 is not supported on CPU; using FP32 insteadF)paddinglanguageNenz]Detecting language using up to the first 30 seconds. Use `--language` to specify the language)keyzDetected language: task
transcribe)num_languagesr<   r?   c                 ,    g | ]}t          |          S  )float.0tss     U/root/projects/openclaw-proxy/venv/lib/python3.11/site-packages/whisper/transcribe.py
<listcomp>ztranscribe.<locals>.<listcomp>   s+     
 
 
E"II
 
 
    ,c                 <    g | ]}t          |t          z            S rC   )roundr	   rE   s     rH   rI   ztranscribe.<locals>.<listcomp>   s&    VVVeB):$:;;VVVrJ   r      r   u*   "'“¿([{-"'.。,，!！?？:：”)]}、	translatez:Word-level timestamps on translations may not be reliable.segmentreturnc                    t          t          t          f          rgn}d }|D ]}i }|dk    r-|                    dd            |                    dd            n|                    dd            t	          di |d|i}
                    | |          }d}|j        k    rd}	|j        	k     rd}|j        k    r	|j        	k     rd}|s n|S )	Nr   	beam_sizepatiencebest_ofr)   FTrC   )	
isinstanceintrD   popr   decodecompression_ratioavg_logprobno_speech_prob)rP   temperaturesdecode_resulttkwargsoptionsneeds_fallbackr*   decode_optionsr+   r5   r,   r)   s          rH   decode_with_fallbackz(transcribe.<locals>.decode_with_fallback   sA   'c5\BBS[MM 	   	  	A''F1uu

;---

:t,,,, 

9d+++%>>>>A>>>G!LL'::M"N+7!36QQQ!%!-!-0AAA!%#/!03FFF%1!-0AAA!&!  rJ    startendtokensresultc           
          |                                 }fd|D             }| |                    |          ||j        |j        |j        |j        d	S )Nc                 *    g | ]}|j         k     |S rC   )eot)rF   token	tokenizers     rH   rI   z3transcribe.<locals>.new_segment.<locals>.<listcomp>   s%    JJJEIM4I4Iu4I4I4IrJ   )	seekrf   rg   textrh   r)   r[   rZ   r\   )tolistrY   r)   r[   rZ   r\   )rf   rg   rh   ri   text_tokensro   rn   s        rH   new_segmentztranscribe.<locals>.new_segment   so     JJJJ&JJJ$$[11!-!-!'!9$3

 

 
	
rJ   frames)totalunitdisabler   promptwordc                     |                      dd          }| d         | d         z
  }d}|dk     r|dz  }|dk     r|d|z
  dz  z  }|d	k    r||d	z
  z  }|S )
Nprobabilityr   rg   rf   g333333?r"   g/$?          @)get)ry   r{   durationscores       rH   word_anomaly_scorez&transcribe.<locals>.word_anomaly_score<  s{    "hh}c::;g6%%SLEe##eh."44Ec>>X^+ErJ   c                     | | d         sdS fd| d         D             }|d d         }t          fd|D                       }|dk    p|dz   t          |          k    S )NwordsFc                 (    g | ]}|d          v|S )ry   rC   )rF   wpunctuations     rH   rI   z:transcribe.<locals>.is_segment_anomaly.<locals>.<listcomp>K  s'    UUUq&	8T8T8T8T8TrJ      c              3   .   K   | ]} |          V  d S )NrC   )rF   r   r   s     rH   	<genexpr>z9transcribe.<locals>.is_segment_anomaly.<locals>.<genexpr>M  s/      AAa..q11AAAAAArJ      g{Gz?)sumlen)rP   r   r   r   r   s      rH   is_segment_anomalyz&transcribe.<locals>.is_segment_anomalyH  s    ?''*:? 5UUUUGG$4UUUbqb	AAAA5AAAAAz?UT\SZZ%??rJ   segmentsc                 6    t          d | D             d           S )Nc              3   *   K   | ]}|d          
|V  dS )r   NrC   )rF   ss     rH   r   z9transcribe.<locals>.next_words_segment.<locals>.<genexpr>Q  s+      ??1AgJ?Q??????rJ   )next)r   s    rH   next_words_segmentz&transcribe.<locals>.next_words_segmentP  s!    ?????FFFrJ   )rf   rg   rh   ri   )r   r5   rn   mel
num_framesr1   r2   last_speech_timestampr   r}   rp   [z --> z]  c                      g | ]\  }}d |i|S )idrC   )rF   irP   s      rH   rI   ztranscribe.<locals>.<listcomp>  s6       "7 1((  rJ   )rf   c                 (    g | ]}|d          D ]}|S )rh   rC   )rF   rP   rm   s      rH   rI   ztranscribe.<locals>.<listcomp>  s*    VVV7GHDUVV5VVVVrJ   g      ?)rp   r   r<   )Hr~   torchfloat16float32devicecudais_availablewarningswarnr   dimsn_melsr   shaper   rD   r
   r   is_multilingualprintr   todetect_languagemaxr   titler   rA   rV   strsplitr   appendlistzipTensorr   r   n_audio_ctx
n_text_ctxencodestripextendtqdmmintensorrh   r\   r[   dictr   boolr   getimestamp_beginrq   whereadd_itemnonzeroflattenr   r   rM   r	   ranger   r   	enumerater)   updaterY   )Wr5   r6   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   rc   dtyper   content_framescontent_durationmel_segment_probsr<   r?   seek_points
seek_clipsrd   clip_idxinput_stridetime_precision
all_tokensall_segmentsprompt_reset_sinceremaining_prompt_lengthinitial_prompt_tokensrs   pbarr   seek_clip_startseek_clip_endtime_offsetwindow_end_timesegment_sizesegment_durationnignoredremaining_promptri   rh   should_skipprevious_seekcurrent_segmentsr   r   timestamp_tokenssingle_timestamp_endingconsecutiveslices
last_slicecurrent_slicesliced_tokensstart_timestamp_posend_timestamp_poslast_timestamp_posr   
timestampslast_word_end	thresholdremaining_durationfirst_segmentgaphal_last_endsirP   next_segmenthal_next_startsilence_beforesilence_afterrf   rg   rp   liner   r   ro   rn   r   sW   `  ````        `                                                                   @@@@rH   r@   r@   &   s    r ,//==PEMM5=E|u|E****:""$$ 	PMNOOOEM!!MLMMMME!&v eUZ%6	
J
J
JCYr]X-N^j8;FGG*d++3$ 	)-N:&& s   &c84477EEHHOOK,,[99HAu),U	)B)B)BN:&"Y)N:4N*O*U*U*W*WYY   #:.H""6<88D)	  I /3'' 

 
?N!V!6!6s!;!;!;TV
 
 
 WVoVVVK
;11
;!q  >***(,SSSqS1A;qtRStCT-U-U(V(VJ@K T4;..RSSS(el (~ ( ( ( ( ( ( ( ( ( ( (T Hh"D%*( L 	z!K/  JL#j3q81<! ) 0 0~7K7K7M7M1M N N/0003'<#=#== "

#
-2\
CQ
 
 
 
 
 
 
$ 
8WE5I
 
 
 tC	 #
 Z((-7-A*O]o%%&}$$Ac*oo--%h/2Dz 1K ?@@K#TH_
$B[$PQQOx$)>PT@TUULaaa|(;!;;<K+j8;F%k8<<??MMPPQVWWK# Ks#899;MNN#-hii#8:Q9Q9R9R#S +@CS+Sx((+56H6I6I+Jx(%9%9+%F%FF\&-00F".$36II%1*->>> #(K L(D M!
 
% 
 
 
 
@HTN @t @ @ @ @ @ @ @GT$Z GHTN G G G G .4YYy7P-Q-Q&6rss&;&B&B&D&DPT&U#+&6ss&;>Nqrr>R&RSSTUVKQ;!##$++--* /MM#f++...
%+ / /M$*:m+C$DM%a(--//)2KK ( &b)..0093LL & %++#"-0Cn0T"T +.?..P P#0#)	     "/JJ* >L(DD zA~.3355	8QQ ' .==DD+#$4$<$<$>$>$F$F$H$HI

OOa''"2++--1JJJ #2++--	0II '  2NBH ''K)'(2%%	     $ K:#-'#+)=(;*?	 	 	 	 / H$+,<$=$=M$0][5P5P$]5F%FGG 3> ?I2 D(/0@(A(A(49T9T1@=1P.1I==',]=N-N'O'O'4|'C %7$67G$H$HM$05G5G5V5V0+G4{B??#05?P9P3Q3Q#QD$ $9L#C(8$9$9:: 6 6"22"6&w/ %$--g66 &+=+= 0a :, ,L  ,71=g1Fq1I'1R1<?O1O ' 0< ?) K !H#*7#3i#?!H#*7#3k#AC#G + !/ ?) K !J#5#5l#C#C!J#2WU^#Cc#I *
  . &- &',$'a9I$J$J&7%8(" (" $4gen#Dy#P#P+9D8: 0 5 %'.u~ '(8 9 9 ,,9) +/ + +G'.w'7QW3E\/66\\=Mc=R=R\\VZ\\D)D//**** ((899 * *
77#wu~559N9N9P9PTV9V9V&(GFO(*GH%')GG$ &/(L0A0A' ' '     VV&6VVV   . 51Cc1I1I%(__" KKND11MABBBY Z((tC tC tC tC tC tC tC tC tC tC tC tC tC tC tCl j-B)C)C)E)EFGG   s   +^&oo!$o!c                  2   ddl m fd} t          j        t          j                  }|                    ddt          d           |                    d	d
| d           |                    dt          d d           |                    dt          j        	                                rdndd           |                    ddt          dd           |                    ddt          dg dd           |                    dt          d d!           |                    d"t          d#d#d$gd%           |                    d&t          d t          t          j                              t          d' t          j                    D                       z   d(           |                    d)t          d*d+           |                    d,t           d-d.           |                    d/t           d-d0           |                    d1t          d d2           |                    d3t          d d4           |                    d5t          d6d7           |                    d8t          d d9           |                    d:t          d;d<           |                    d=t          d d>           |                    d?t          d d@           |                    dAt"          dBdC           |                    dDt"          dEdF           |                    dGt"          dHdI           |                    dJt"          dKdL           |                    dMt          d;dN           |                    dOt          dPdQ           |                    dRt          dSdT           |                    dUt          d;dV           |                    dWt           d dX           |                    dYt           d dZ           |                    d[t           d d\           |                    d]t           d*d^           |                    d_t          d`da           |                    dbt"          dcd           |                                j                            de          }                    df          }                    dg          }                    dh          }                    di          }t+          j        |d j           |                    dk          r7dl         dmvr-dl          t1          j        | dndl          do           dpdl<                       dq          }                    dr          x}$t5          t7          j        |ds|                    }n|g}                    dt          x}	d*k    rt          j        |	           ddul m}
  |
|||v          }t?          ||          }g dw}dx         s&|D ]#}|         r|                     dy| dz           $d{         rd|         st1          j        d}           d~         rd|         rt1          j        d           fd|D             }                    d          D ]~}	 tC          ||fdq|i} |||fi | # tD          $ rT}tG          j$                     tK          d| dtM          |          j'         dt          |                      Y d }~wd }~ww xY wd S )Nr   )available_modelsc                     |              v st           j                            |           r| S t          d              d          )Nzmodel should be one of z or path to a model checkpoint)ospathexists
ValueError)namer   s    rH   valid_model_namezcli.<locals>.valid_model_name  sZ    ##%%%%)=)=%KX&6&6&8&8XXX
 
 	
rJ   )formatter_classr6   +zaudio file(s) to transcribe)nargstypehelpz--modelturboz name of the Whisper model to use)defaultr  r	  z--model_dirz>the path to save model files; uses ~/.cache/whisper by default)r  r  r	  z--devicer   r9   z#device to use for PyTorch inference)r  r	  z--output_dirz-o.zdirectory to save the outputsz--output_formatz-fall)txtvttsrttsvjsonr  zSformat of the output file; if not specified, all available formats will be produced)r  r  choicesr	  z	--verboseTz4whether to print out the progress and debug messagesz--taskr@   rO   zawhether to perform X->X speech recognition ('transcribe') or X->English translation ('translate')z
--languagec                 6    g | ]}|                                 S rC   )r   )rF   ks     rH   rI   zcli.<locals>.<listcomp>  s>      iU  iU  iUwxijipipirir  iU  iU  iUrJ   zHlanguage spoken in the audio, specify None to perform language detectionz--temperaturer   ztemperature to use for samplingz	--best_of   z<number of candidates when sampling with non-zero temperaturez--beam_sizezHnumber of beams in beam search, only applicable when temperature is zeroz
--patiencezoptional patience value to use in beam decoding, as in https://arxiv.org/abs/2204.05424, the default (1.0) is equivalent to conventional beam searchz--length_penaltyzoptional token length penalty coefficient (alpha) as in https://arxiv.org/abs/1609.08144, uses simple length normalization by defaultz--suppress_tokensz-1zcomma-separated list of token ids to suppress during sampling; '-1' will suppress most special characters except common punctuationsz--initial_promptz:optional text to provide as a prompt for the first window.z--carry_initial_promptFz{if True, prepend initial_prompt to every internal decode() call. May reduce the effectiveness of condition_on_previous_textz--condition_on_previous_textzif True, provide the previous output of the model as a prompt for the next window; disabling may make the text inconsistent across windows, but the model becomes less prone to getting stuck in a failure loopz--fp16z5whether to perform inference in fp16; True by defaultz#--temperature_increment_on_fallbackr    zhtemperature to increase when falling back when the decoding fails to meet either of the thresholds belowz--compression_ratio_thresholdr#   zUif the gzip compression ratio is higher than this value, treat the decoding as failedz--logprob_thresholdr$   zUif the average log probability is lower than this value, treat the decoding as failedz--no_speech_thresholdr!   zif the probability of the <|nospeech|> token is higher than this value AND the decoding has failed due to `logprob_threshold`, consider the segment as silencez--word_timestampszQ(experimental) extract word-level timestamps and refine the results based on themz--prepend_punctuationsr%   zNif word_timestamps is True, merge these punctuation symbols with the next wordz--append_punctuationsr&   zRif word_timestamps is True, merge these punctuation symbols with the previous wordz--highlight_wordszT(requires --word_timestamps True) underline each word as it is spoken in srt and vttz--max_line_widthze(requires --word_timestamps True) the maximum number of characters in a line before breaking the linez--max_line_countzJ(requires --word_timestamps True) the maximum number of lines in a segmentz--max_words_per_linezk(requires --word_timestamps True, no effect with --max_line_width) the maximum number of words in a segmentz	--threadsz]number of threads used by torch for CPU inference; supercedes MKL_NUM_THREADS/OMP_NUM_THREADSz--clip_timestampsr'   zcomma-separated list start,end,start,end,... timestamps (in seconds) of clips to process, where the last end timestamp defaults to the end of the filez!--hallucination_silence_thresholdz(requires --word_timestamps True) skip silent periods longer than this threshold (in seconds) when a possible hallucination is detected)r  r	  r5   	model_dir
output_diroutput_formatr   )exist_okz.enr<   >   r=   Englishz) is an English-only model but receipted 'z'; using English instead.r=   r)   !temperature_increment_on_fallbackgzo ?threads)
load_model)r   download_root)highlight_wordsmax_line_countmax_line_widthmax_words_per_liner0   z--z  requires --word_timestamps Truer!  r"  z7--max_line_count has no effect without --max_line_widthr#  z8--max_words_per_line has no effect with --max_line_widthc                 <    i | ]}|                     |          S rC   )rX   )rF   argargss     rH   
<dictcomp>zcli.<locals>.<dictcomp>d  s%    >>>#3>>>rJ   z	Skipping z due to z: )(r   r   argparseArgumentParserArgumentDefaultsHelpFormatteradd_argumentr   r   r   r   r   sortedr   keysr   rD   r   r   
parse_args__dict__rX   r   makedirsendswithr   r   tuplenparangeset_num_threadsr  r   errorr@   	Exception	traceback	print_excr   r  __name__)r  parser
model_namer  r  r  r   r)   	incrementr  r  r5   writerword_optionsoptionwriter_args
audio_pathri   er&  r   s                      @@rH   clirD    s{	   """"""
 
 
 
 
 $X5[\\\F
s;XYYY
	79IPrsss
C  EE  F  F  F

ej6M6M6O6O,ZFFUZ  bG  H  H  H
3Jijjj
)4c5R}R}R}  EZ  [  [  [
(DG}~~~
sL<YdJe  mP  Q  Q  Q
3fY^M]M]F^F^ag  iU  iU  }M  }R  }T  }T  iU  iU  iU  bV  bV  GV  ]g  h  h  h
eQEfggg
,  IG  H  H  H
L!  KU  V  V  V
5$  F\  ]  ]  ]
*  LS  T  T  T
+#t  KQ  R  R  R
*d  JF  G  G  G
0x  VS  T  T  T
6Xt  [l  m  m  m
xD{|||
=N\_  gQ  R  R  R
7nVY  ax  y  y  y
-ND  Xo  p  p  p
/nc  Yy  z  z  z
+(E  Qd  e  e  e
0sO  [k  l  l  l
/cCf  nB  C  C  C
+(E  Qg  h  h  h
*t  Sz  {  {  {
*t  S_  `  `  `
.\4  WD  E  E  E
,  Ih  i  i  i
+#s  Jb  c  c  c
;.  Xa  b  b  b 'Dhhw''JXXk**Ihh|,,J/22M((8$$FK
T****5!!  d:&6>O&O&O
'MssZHXsss    Z((=))KXXABBB	OBIk:yIIJJ"m88I&&&!++g&&&Jz&	JJJEz22F  L !" L" 	L 	LFF| LJ&JJJKKK Qd+;&< QOPPP ! Rd+;&< RPQQQ>>>>>>>Khhw'' P P
	PzSS{SdSSFF6:555555 	P 	P 	P!!!NjNN$q''2BNNc!ffNNOOOOOOOO	P	P Ps   Z66
\ A
\\__main__)2r(  r   r8  r   typingr   r   r   r   r   numpyr3  r   r   r6   r	   r
   r   r   r   r   r   decodingr   r   timingr   rn   r   r   r   utilsr   r   r   r   r   r   r   r   r5   r   r   ndarrayr   r   rD   r@   rD  r:  rC   rJ   rH   <module>rL     s
    				      > > > > > > > > > > > > > >                        6 5 5 5 5 5 5 5 ' ' ' ' ' ' A A A A A A A A A A	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	   #3Q36)-+.'+$(!&! .A/27;!\ \ \\bj%,./\ d^	\
 ueE3J//0\ "*%\  \ "%\ !%\ SM\ \ \ \ \ 3U+,\  &.e_!\ \ \ \~fP fP fPR zCEEEEE rJ   