U
    %dʏ                     @   s@  d dl Z d dlmZ d dlZd dlZd dlmZ dddddd	d
dddg
Zeeej	j
ZdZdZdZdZdZdZeeeeegZdd ZeedddZeeeeedddZeee	ejeedddZeee	edd d!Zeee	e	e	ee	eeeeef d"d#d$Zeeeeee	eee	e	ee	eeef d%d&d'Zeeed(d)d*Zd+d,d-d.d/d0d-d1d2d2d2d3d2d4efee	ee	e	e	e	e	e	eeee	eeeed5d6d	Ze	e	d7d8dZ eed7d9dZ!e	e	d:d;dZ"eed:d<dZ#e	e	e	e	e	eed=d>dZ$e	e	e	e	eed?d@dZ%eee	e	e	e	e	e	eeef dA	dBdZ&d+d,d-d.d/d0d-d4dCd-dDd1d2d2d2d3d2d4d4d2d2dEdFd.efee	ee	e	e	e	e	ee	e	ee	eeee	eeeeee	e	e	eedGdHd
Z'eeedIdJdKZ(ee	edLdMdNZ)d+dOd,d-d.d/d0d-d4dCdPd-dDd1d2d2d2d3d2d4d4dEdFd.efee	e	ee	e	e	e	e	ee	ee	ee	eeee	eeee	e	e	eedQdRdZ*dS )S    N)Tuple)Tensorget_mel_banksinverse_mel_scaleinverse_mel_scale_scalar	mel_scalemel_scale_scalarspectrogramfbankmfccvtln_warp_freqvtln_warp_mel_freqgMbP?ZhammingZhanningZpoveyZrectangularZblackmanc                 C   s   t j| |dS )Ndevicedtype)EPSILONtor    r   ?/tmp/pip-unpacked-wheel-lbdmvq91/torchaudio/compliance/kaldi.py_get_epsilon#   s    r   )xreturnc                 C   s   | dkrdS d| d    S )z6Returns the smallest power of 2 that is greater than xr         )
bit_length)r   r   r   r   _next_power_of_2'   s    r   )waveformwindow_sizewindow_shift
snip_edgesr   c                 C   s   |   dkst| d}|| d | df}|rd||k rRtjd| j| jdS d|| |  }nzt| dg}||d  | }|d |d  }|}	|dkr|| d }
tj	|
| |	fdd} ntj	| | d |	fdd} ||f}| 
||S )a  Given a waveform (1D tensor of size ``num_samples``), it returns a 2D tensor (m, ``window_size``)
    representing how the window is shifted along the waveform. Each row is a frame.

    Args:
        waveform (Tensor): Tensor of size ``num_samples``
        window_size (int): Frame length
        window_shift (int): Frame shift
        snip_edges (bool): If True, end effects will be handled by outputting only frames that completely fit
            in the file, and the number of frames depends on the frame_length.  If False, the number of frames
            depends only on the frame_shift, and we reflect the data at the ends.

    Returns:
        Tensor: 2D tensor of size (m, ``window_size``) where each row is a frame
    r   r   )r   r   r   r   r   Ndim)r"   AssertionErrorsizeZstridetorchemptyr   r   ZflipcatZ
as_strided)r   r   r   r   Znum_samplesstridesmZreversed_waveformpadZ	pad_rightZpad_leftZsizesr   r   r   _get_strided,   s"    
r+   )window_typer   blackman_coeffr   r   r   c                 C   s   | t krtj|d||dS | tkr8tj|ddd||dS | tkrXtj|d||ddS | tkrptj|||dS | t	krdt
j |d	  }tj|||d}|d
t||   d
| td| |   j||dS td|  dS )z6Returns a window function with the given type and sizeF)periodicr   r   gHzG?gq=
ףp?)r.   alphabetar   r   g333333?r   r   r         ?zInvalid window type N)HANNINGr%   Zhann_windowHAMMINGZhamming_windowPOVEYpowRECTANGULARZonesBLACKMANmathpiarangecosr   	Exception)r,   r   r-   r   r   awindow_functionr   r   r   _feature_window_functionV   s*     r?   )strided_inputepsilonenergy_floorr   c                 C   sT   | j | j }}t| dd| }|dkr6|S t|tjt|||dS )z<Returns the log energy of size (m) for a strided_input (m,*)r   r           r   )	r   r   r%   maxr5   sumlogtensorr8   )r@   rA   rB   r   r   Z
log_energyr   r   r   _get_log_energyt   s
    rH   )r   channelsample_frequencyframe_shiftframe_lengthround_to_power_of_twopreemphasis_coefficientr   c           
      C   s   t |d}|| dk s.td|| d| |ddf } t|| t }t|| t }|rjt|n|}	d|  krt| ksn td|t| d|k std|	d dkstdd|  krd	ksn td
|dkstd| |||	fS )z'Gets the waveform and window propertiesr   zInvalid channel {} for size {}Nr   z'choose a window size {} that is [2, {}]z%`window_shift` must be greater than 0zgthe padded `window_size` must be divisible by two. use `round_to_power_of_two` or change `frame_length`rC         ?z/`preemphasis_coefficient` must be between [0,1]z,`sample_frequency` must be greater than zero)rD   r$   r#   formatintMILLISECONDS_TO_SECONDSr   len)
r   rI   rJ   rK   rL   rM   rN   r   r   padded_window_sizer   r   r   #_get_waveform_and_window_properties}   s"    

$  rU   )r   rT   r   r   r,   r-   r   
raw_energyrB   ditherremove_dc_offsetrN   r   c                 C   s^  | j | j }}t||}t| |||}|	dkrzt|tj|j||d}td|	  t
dtj |  }|||	  }|
rtj|ddd}|| }|rt|||}|dkrtjjj|ddd	d
d}|||ddddf   }t|||||d}|| }||krD|| }tjjj|dd|fdddd}|sVt|||}||fS )zGets a window and its log energy

    Returns:
        (Tensor, Tensor): strided_input of size (m, ``padded_window_size``) and signal_log_energy of size (m)
    rC   r   r   r   r!   r   )r   r   Z	replicate)modeNconstantrZ   value)r   r   r   r+   r%   rD   ZrandshapesqrtrF   r;   r8   r9   mean	unsqueezerH   nn
functionalr*   Zsqueezer?   )r   rT   r   r   r,   r-   r   rV   rB   rW   rX   rN   r   r   rA   r@   r   Z
rand_gaussZ	row_meanssignal_log_energyZoffset_strided_inputr>   Zpadding_rightr   r   r   _get_window   sD    
&
   rf   )rG   subtract_meanr   c                 C   s$   |r t j| ddd}| | } | S )Nr   r!   )r%   ra   rb   )rG   rg   Z	col_meansr   r   r   _subtract_column_mean   s    rh   gzG?r[   rC   rO   g      9@g      $@g
ףp=
?Tg     @@F)r   r-   rI   rW   rB   rL   rK   min_durationrN   rV   rX   rM   rJ   r   rg   r,   r   c                 C   s   | j | j }}t||}t| ||||||\} }}}t| || k rNtdS t| |||||||	|||
|\}}tj	|}t
| d| }||dddf< t||}|S )a
  Create a spectrogram from a raw audio signal. This matches the input/output of Kaldi's
    compute-spectrogram-feats.

    Args:
        waveform (Tensor): Tensor of audio of size (c, n) where c is in the range [0,2)
        blackman_coeff (float, optional): Constant coefficient for generalized Blackman window. (Default: ``0.42``)
        channel (int, optional): Channel to extract (-1 -> expect mono, 0 -> left, 1 -> right) (Default: ``-1``)
        dither (float, optional): Dithering constant (0.0 means no dither). If you turn this off, you should set
            the energy_floor option, e.g. to 1.0 or 0.1 (Default: ``0.0``)
        energy_floor (float, optional): Floor on energy (absolute, not relative) in Spectrogram computation.  Caution:
            this floor is applied to the zeroth component, representing the total signal energy.  The floor on the
            individual spectrogram elements is fixed at std::numeric_limits<float>::epsilon(). (Default: ``1.0``)
        frame_length (float, optional): Frame length in milliseconds (Default: ``25.0``)
        frame_shift (float, optional): Frame shift in milliseconds (Default: ``10.0``)
        min_duration (float, optional): Minimum duration of segments to process (in seconds). (Default: ``0.0``)
        preemphasis_coefficient (float, optional): Coefficient for use in signal preemphasis (Default: ``0.97``)
        raw_energy (bool, optional): If True, compute energy before preemphasis and windowing (Default: ``True``)
        remove_dc_offset (bool, optional): Subtract mean from waveform on each frame (Default: ``True``)
        round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input
            to FFT. (Default: ``True``)
        sample_frequency (float, optional): Waveform data sample frequency (must match the waveform file, if
            specified there) (Default: ``16000.0``)
        snip_edges (bool, optional): If True, end effects will be handled by outputting only frames that completely fit
            in the file, and the number of frames depends on the frame_length.  If False, the number of frames
            depends only on the frame_shift, and we reflect the data at the ends. (Default: ``True``)
        subtract_mean (bool, optional): Subtract mean of each feature file [CMS]; not recommended to do
            it this way.  (Default: ``False``)
        window_type (str, optional): Type of window ('hamming'|'hanning'|'povey'|'rectangular'|'blackman')
         (Default: ``'povey'``)

    Returns:
        Tensor: A spectrogram identical to what Kaldi would output. The shape is
        (m, ``padded_window_size // 2 + 1``) where m is calculated in _get_strided
    r          @N)r   r   r   rU   rS   r%   r&   rf   fftrfftrD   absr5   rF   rh   )r   r-   rI   rW   rB   rL   rK   ri   rN   rV   rX   rM   rJ   r   rg   r,   r   r   rA   r   r   rT   r@   re   rk   Zpower_spectrumr   r   r   r	      s@    4
      

)mel_freqr   c                 C   s   dt | d d  S N     @     @rO   )r8   exprn   r   r   r   r   @  s    c                 C   s   d| d   d  S ro   )rr   rs   r   r   r   r   D  s    )freqr   c                 C   s   dt d| d   S Nrq   rO   rp   )r8   rF   rt   r   r   r   r   H  s    c                 C   s   dd| d     S ru   )rF   rv   r   r   r   r   L  s    )vtln_low_cutoffvtln_high_cutofflow_freq	high_freqvtln_warp_factorrt   r   c                 C   s  | |kst d||k s t d| td| }|td| }d| }|| }	|| }
||krd||k sht |	| ||  }||
 ||  }t|}t||t||B }t||}t||}t||}|||| |   ||< |||  ||< |||| |   ||< || ||< |S )a*  This computes a VTLN warping function that is not the same as HTK's one,
    but has similar inputs (this function has the advantage of never producing
    empty bins).

    This function computes a warp function F(freq), defined between low_freq
    and high_freq inclusive, with the following properties:
        F(low_freq) == low_freq
        F(high_freq) == high_freq
    The function is continuous and piecewise linear with two inflection
        points.
    The lower inflection point (measured in terms of the unwarped
        frequency) is at frequency l, determined as described below.
    The higher inflection point is at a frequency h, determined as
        described below.
    If l <= f <= h, then F(f) = f/vtln_warp_factor.
    If the higher inflection point (measured in terms of the unwarped
        frequency) is at h, then max(h, F(h)) == vtln_high_cutoff.
        Since (by the last point) F(h) == h/vtln_warp_factor, then
        max(h, h/vtln_warp_factor) == vtln_high_cutoff, so
        h = vtln_high_cutoff / max(1, 1/vtln_warp_factor).
          = vtln_high_cutoff * min(1, vtln_warp_factor).
    If the lower inflection point (measured in terms of the unwarped
        frequency) is at l, then min(l, F(l)) == vtln_low_cutoff
        This implies that l = vtln_low_cutoff / min(1, 1/vtln_warp_factor)
                            = vtln_low_cutoff * max(1, vtln_warp_factor)
    Args:
        vtln_low_cutoff (float): Lower frequency cutoffs for VTLN
        vtln_high_cutoff (float): Upper frequency cutoffs for VTLN
        low_freq (float): Lower frequency cutoffs in mel computation
        high_freq (float): Upper frequency cutoffs in mel computation
        vtln_warp_factor (float): Vtln warp factor
        freq (Tensor): given frequency in Hz

    Returns:
        Tensor: Freq after vtln warp
    z7be sure to set the vtln_low option higher than low_freqzFbe sure to set the vtln_high option lower than high_freq [or negative]rO   )r#   rD   minr%   Z
empty_likeltgtge)rw   rx   ry   rz   r{   rt   lhZscaleZFlZFhZ
scale_leftZscale_rightresZoutside_low_high_freqZbefore_lZbefore_hZafter_hr   r   r   r   P  s(    ,
)rw   rx   rz   r{   rn   r   c              	   C   s   t t| ||||t|S )a  
    Args:
        vtln_low_cutoff (float): Lower frequency cutoffs for VTLN
        vtln_high_cutoff (float): Upper frequency cutoffs for VTLN
        low_freq (float): Lower frequency cutoffs in mel computation
        high_freq (float): Upper frequency cutoffs in mel computation
        vtln_warp_factor (float): Vtln warp factor
        mel_freq (Tensor): Given frequency in Mel

    Returns:
        Tensor: ``mel_freq`` after vtln warp
    )r   r   r   )rw   rx   ry   rz   r{   rn   r   r   r   r     s         )	num_binswindow_length_paddedsample_freqry   rz   vtln_low	vtln_highr{   r   c                 C   sZ  | dkst d|d dks t |d }d| }	|dkr@||	7 }d|  krT|	k rxn n d|  k rl|	krxn n||k st d|||	|| }
t|}t|}|| | d  }|dk r||	7 }|d	ks||  k r|k r
n n$d|  k r|k r
n n
||k st d
||||t| d}|||  }||d	 |  }||d |  }|d	krt||||||}t||||||}t||||||}t|}t|
t| d}|| ||  }|| ||  }|d	kr t	t
dt||}nRt|}t||t||@ }t||t||@ }|| ||< || ||< ||fS )z
    Returns:
        (Tensor, Tensor): The tuple consists of ``bins`` (which is
        melbank of size (``num_bins``, ``num_fft_bins``)) and ``center_freqs`` (which is
        center frequencies of bins of size (``num_bins``)).
       zMust have at least 3 mel binsr   r   r1   rC   zBBad values in options: low-freq {} and high-freq {} vs. nyquist {}r   rO   zXBad values in options: vtln-low {} and vtln-high {}, versus low-freq {} and high-freq {}rj   )r#   rP   r   r%   r:   rb   r   r   r   rD   zerosr|   Z
zeros_liker~   ler}   )r   r   r   ry   rz   r   r   r{   Znum_fft_binsZnyquistZfft_bin_widthZmel_low_freqZmel_high_freqZmel_freq_deltabinZleft_melZ
center_melZ	right_melZcenter_freqsZmelZup_slopeZ
down_slopeZbinsZup_idxZdown_idxr   r   r   r     s     
 

     


g      4@   g     @g      Y@)r   r-   rI   rW   rB   rL   rK   rz   
htk_compatry   ri   num_mel_binsrN   rV   rX   rM   rJ   r   rg   
use_energyuse_log_fbank	use_powerr   r   	vtln_warpr,   r   c           $      C   s:  | j | j }}t| ||||||\} }}}t| |
| k rJtjd||dS t| |||||||||||\}} tj|	 }!|r|!
d}!t||||	||||\}"}#|"j||d}"tjjj|"dddd}"t|!|"j}"|rt|"t|| }"|r,| d} |rtj|"| fdd}"ntj| |"fdd}"t|"|}"|"S )	ab  Create a fbank from a raw audio signal. This matches the input/output of Kaldi's
    compute-fbank-feats.

    Args:
        waveform (Tensor): Tensor of audio of size (c, n) where c is in the range [0,2)
        blackman_coeff (float, optional): Constant coefficient for generalized Blackman window. (Default: ``0.42``)
        channel (int, optional): Channel to extract (-1 -> expect mono, 0 -> left, 1 -> right) (Default: ``-1``)
        dither (float, optional): Dithering constant (0.0 means no dither). If you turn this off, you should set
            the energy_floor option, e.g. to 1.0 or 0.1 (Default: ``0.0``)
        energy_floor (float, optional): Floor on energy (absolute, not relative) in Spectrogram computation.  Caution:
            this floor is applied to the zeroth component, representing the total signal energy.  The floor on the
            individual spectrogram elements is fixed at std::numeric_limits<float>::epsilon(). (Default: ``1.0``)
        frame_length (float, optional): Frame length in milliseconds (Default: ``25.0``)
        frame_shift (float, optional): Frame shift in milliseconds (Default: ``10.0``)
        high_freq (float, optional): High cutoff frequency for mel bins (if <= 0, offset from Nyquist)
         (Default: ``0.0``)
        htk_compat (bool, optional): If true, put energy last.  Warning: not sufficient to get HTK compatible features
         (need to change other parameters). (Default: ``False``)
        low_freq (float, optional): Low cutoff frequency for mel bins (Default: ``20.0``)
        min_duration (float, optional): Minimum duration of segments to process (in seconds). (Default: ``0.0``)
        num_mel_bins (int, optional): Number of triangular mel-frequency bins (Default: ``23``)
        preemphasis_coefficient (float, optional): Coefficient for use in signal preemphasis (Default: ``0.97``)
        raw_energy (bool, optional): If True, compute energy before preemphasis and windowing (Default: ``True``)
        remove_dc_offset (bool, optional): Subtract mean from waveform on each frame (Default: ``True``)
        round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input
            to FFT. (Default: ``True``)
        sample_frequency (float, optional): Waveform data sample frequency (must match the waveform file, if
            specified there) (Default: ``16000.0``)
        snip_edges (bool, optional): If True, end effects will be handled by outputting only frames that completely fit
            in the file, and the number of frames depends on the frame_length.  If False, the number of frames
            depends only on the frame_shift, and we reflect the data at the ends. (Default: ``True``)
        subtract_mean (bool, optional): Subtract mean of each feature file [CMS]; not recommended to do
            it this way.  (Default: ``False``)
        use_energy (bool, optional): Add an extra dimension with energy to the FBANK output. (Default: ``False``)
        use_log_fbank (bool, optional):If true, produce log-filterbank, else produce linear. (Default: ``True``)
        use_power (bool, optional): If true, use power, else use magnitude. (Default: ``True``)
        vtln_high (float, optional): High inflection point in piecewise linear VTLN warping function (if
            negative, offset from high-mel-freq (Default: ``-500.0``)
        vtln_low (float, optional): Low inflection point in piecewise linear VTLN warping function (Default: ``100.0``)
        vtln_warp (float, optional): Vtln warp factor (only applicable if vtln_map not specified) (Default: ``1.0``)
        window_type (str, optional): Type of window ('hamming'|'hanning'|'povey'|'rectangular'|'blackman')
         (Default: ``'povey'``)

    Returns:
        Tensor: A fbank identical to what Kaldi would output. The shape is (m, ``num_mel_bins + use_energy``)
        where m is calculated in _get_strided
    r   r   rj   )r   r   r\   r]   r   r!   )r   r   rU   rS   r%   r&   rf   rk   rl   rm   r5   r   r   rc   rd   r*   mmTrD   r   rF   rb   r'   rh   )$r   r-   rI   rW   rB   rL   rK   rz   r   ry   ri   r   rN   rV   rX   rM   rJ   r   rg   r   r   r   r   r   r   r,   r   r   r   r   rT   r@   re   ZspectrumZmel_energies_r   r   r   r
     sf    K      
       

)num_cepsr   r   c                 C   sF   t j||d}tdt| |d d df< |d d d | f }|S )NZorthor   r   )
torchaudiord   Z
create_dctr8   r`   float)r   r   
dct_matrixr   r   r   _get_dct_matrix  s    r   )r   cepstral_lifterr   c                 C   s*   t | }dd| t tj| |   S )NrO   r1   )r%   r:   sinr8   r9   )r   r   ir   r   r   _get_lifter_coeffs  s    
r   g      6@   )r   r-   r   rI   rW   rB   rL   rK   rz   r   ry   r   ri   r   rN   rV   rX   rM   rJ   r   rg   r   r   r   r   r,   r   c           "      C   s`  ||kst d||f | j| j }}t| ||||||||	|
||||||||d|dd||||d}|r|dd|	rv|ndf }t|	 }|dd||| f }t||j||d}||}|dkrt||	d} || j||d	9 }|r||dddf< |	rR|dddf 	d
}!|ddd
df }|s@|!t
d9 }!tj||!fd
d}t||}|S )aM  Create a mfcc from a raw audio signal. This matches the input/output of Kaldi's
    compute-mfcc-feats.

    Args:
        waveform (Tensor): Tensor of audio of size (c, n) where c is in the range [0,2)
        blackman_coeff (float, optional): Constant coefficient for generalized Blackman window. (Default: ``0.42``)
        cepstral_lifter (float, optional): Constant that controls scaling of MFCCs (Default: ``22.0``)
        channel (int, optional): Channel to extract (-1 -> expect mono, 0 -> left, 1 -> right) (Default: ``-1``)
        dither (float, optional): Dithering constant (0.0 means no dither). If you turn this off, you should set
            the energy_floor option, e.g. to 1.0 or 0.1 (Default: ``0.0``)
        energy_floor (float, optional): Floor on energy (absolute, not relative) in Spectrogram computation.  Caution:
            this floor is applied to the zeroth component, representing the total signal energy.  The floor on the
            individual spectrogram elements is fixed at std::numeric_limits<float>::epsilon(). (Default: ``1.0``)
        frame_length (float, optional): Frame length in milliseconds (Default: ``25.0``)
        frame_shift (float, optional): Frame shift in milliseconds (Default: ``10.0``)
        high_freq (float, optional): High cutoff frequency for mel bins (if <= 0, offset from Nyquist)
         (Default: ``0.0``)
        htk_compat (bool, optional): If true, put energy last.  Warning: not sufficient to get HTK compatible
         features (need to change other parameters). (Default: ``False``)
        low_freq (float, optional): Low cutoff frequency for mel bins (Default: ``20.0``)
        num_ceps (int, optional): Number of cepstra in MFCC computation (including C0) (Default: ``13``)
        min_duration (float, optional): Minimum duration of segments to process (in seconds). (Default: ``0.0``)
        num_mel_bins (int, optional): Number of triangular mel-frequency bins (Default: ``23``)
        preemphasis_coefficient (float, optional): Coefficient for use in signal preemphasis (Default: ``0.97``)
        raw_energy (bool, optional): If True, compute energy before preemphasis and windowing (Default: ``True``)
        remove_dc_offset (bool, optional): Subtract mean from waveform on each frame (Default: ``True``)
        round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input
            to FFT. (Default: ``True``)
        sample_frequency (float, optional): Waveform data sample frequency (must match the waveform file, if
            specified there) (Default: ``16000.0``)
        snip_edges (bool, optional): If True, end effects will be handled by outputting only frames that completely fit
            in the file, and the number of frames depends on the frame_length.  If False, the number of frames
            depends only on the frame_shift, and we reflect the data at the ends. (Default: ``True``)
        subtract_mean (bool, optional): Subtract mean of each feature file [CMS]; not recommended to do
            it this way.  (Default: ``False``)
        use_energy (bool, optional): Add an extra dimension with energy to the FBANK output. (Default: ``False``)
        vtln_high (float, optional): High inflection point in piecewise linear VTLN warping function (if
            negative, offset from high-mel-freq (Default: ``-500.0``)
        vtln_low (float, optional): Low inflection point in piecewise linear VTLN warping function (Default: ``100.0``)
        vtln_warp (float, optional): Vtln warp factor (only applicable if vtln_map not specified) (Default: ``1.0``)
        window_type (str, optional): Type of window ('hamming'|'hanning'|'povey'|'rectangular'|'blackman')
         (Default: ``"povey"``)

    Returns:
        Tensor: A mfcc identical to what Kaldi would output. The shape is (m, ``num_ceps``)
        where m is calculated in _get_strided
    z5num_ceps cannot be larger than num_mel_bins: %d vs %dFT)r   r-   rI   rW   rB   rL   rK   rz   r   ry   ri   r   rN   rV   rX   rM   rJ   r   rg   r   r   r   r   r   r   r,   Nr   r    rC   r   r   r   r!   )r#   r   r   r
   rQ   r   r   matmulr   rb   r8   r`   r%   r'   rh   )"r   r-   r   rI   rW   rB   rL   rK   rz   r   ry   r   ri   r   rN   rV   rX   rM   rJ   r   rg   r   r   r   r   r,   r   r   Zfeaturere   Z
mel_offsetr   Zlifter_coeffsZenergyr   r   r   r     sb    K


)+r8   typingr   r%   r   r   __all__rG   Zfinfor   Zepsr   rR   r3   r2   r4   r6   r7   WINDOWSr   rQ   r   boolr+   strr   r?   rH   rU   rf   rh   r	   r   r   r   r   r   r   r   r
   r   r   r   r   r   r   r   <module>   s  +

DYL
P 
