U
    Ph                     @  sz  d dl mZ d dlZd dlmZmZ d dlmZmZm	Z	m
Z
mZ d dlmZ d dlmZ d dlZd dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZmZ d dlmZ d dlmZm Z  d dl!m"Z"m#Z#m$Z$m%Z%m&Z& d dl'm(Z(m)Z)m*Z* ee+Z,dddddddgZ-G dd deZ.G dd de.Z/G dd de.Z0G dd de.Z1G dd de1Z2G dd de.Z3G dd de1Z4dS )    )annotationsN)ABCabstractmethod)CallableIterableIteratorMappingSequence)locate)Any)
get_logger)
MetaTensor)ThreadBuffer)	AvgMergerMerger)Splitter)compute_importance_mapsliding_window_inference)	BlendMode	PatchKeysPytorchPadModeensure_tupleoptional_import)CAMGradCAM	GradCAMppInfererPatchInfererSimpleInfererSlidingWindowInfererSaliencyInfererSliceInfererSlidingWindowInfererAdaptc                   @  s*   e Zd ZdZeddddddddZdS )	r   a  
    A base class for model inference.
    Extend this class to support operations during inference, e.g. a sliding window method.

    Example code::

        device = torch.device("cuda:0")
        transform = Compose([ToTensor(), LoadImage(image_only=True)])
        data = transform(img_path).to(device)
        model = UNet(...).to(device)
        inferer = SlidingWindowInferer(...)

        model.eval()
        with torch.no_grad():
            pred = inferer(inputs=data, network=model)
        ...

    torch.Tensorr   r   inputsnetworkargskwargsreturnc                 O  s   t d| jj ddS )a  
        Run inference on `inputs` with the `network` model.

        Args:
            inputs: input of the model inference.
            network: model for inference.
            args: optional args to be passed to ``network``.
            kwargs: optional keyword args to be passed to ``network``.

        Raises:
            NotImplementedError: When the subclass does not override this method.

        z	Subclass z must implement this method.N)NotImplementedError	__class____name__selfr%   r&   r'   r(    r/   K/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/inferers/inferer.py__call__A   s    zInferer.__call__N)r,   
__module____qualname____doc__r   r1   r/   r/   r/   r0   r   -   s   c                   @  s   e Zd ZdZdeddddddfdddd	d	d
ddddd
ddZdddddZdddddZddddddddZdd  Z	d!d" Z
d#d$ Zdd%dddd&d'd(ZdS ))r   a&  
    Inference on patches instead of the whole image based on Splitter and Merger.
    This splits the input image into patches and then merge the resulted patches.

    Args:
        splitter: a `Splitter` object that split the inputs into patches. Defaults to None.
            If not provided or None, the inputs are considered to be already split into patches.
            In this case, the output `merged_shape` and the optional `cropped_shape` cannot be inferred
            and should be explicitly provided.
        merger_cls: a `Merger` subclass that can be instantiated to merges patch outputs.
            It can also be a string that matches the name of a class inherited from `Merger` class.
            Defaults to `AvgMerger`.
        batch_size: batch size for patches. If the input tensor is already batched [BxCxWxH],
            this adds additional batching [(Bp*B)xCxWpxHp] for inference on patches.
            Defaults to 1.
        preprocessing: a callable that process patches before the being fed to the network.
            Defaults to None.
        postprocessing: a callable that process the output of the network.
            Defaults to None.
        output_keys: if the network output is a dictionary, this defines the keys of
            the output dictionary to be used for merging.
            Defaults to None, where all the keys are used.
        match_spatial_shape: whether to crop the output to match the input shape. Defaults to True.
        buffer_size: number of patches to be held in the buffer with a separate thread for batch sampling. Defaults to 0.
        merger_kwargs: arguments to be passed to `merger_cls` for instantiation.
            `merged_shape` is calculated automatically based on the input shape and
            the output patch shape unless it is passed here.
    N   Tr   zSplitter | Noneztype[Merger] | strintzCallable | NonezSequence | Noneboolr   None)
splitter
merger_cls
batch_sizepreprocessingpostprocessingoutput_keysmatch_spatial_shapebuffer_sizemerger_kwargsr)   c	                 K  s2  t |  t|ttd fs:t|ts:tdt| d|| _t|trtd|d\}
}|sft	|}
|
d kr~t
d| d|
}t|tstd| d|| _|	| _|d k	rt|stdt| d|| _|d k	rt|std	t| d|| _|d
k rt
d| d|| _|| _|| _|| _d S )Nz'splitter' should be a `Splitter` object that returns: an iterable of pairs of (patch, location) or a MetaTensor that has `PatchKeys.LOCATION` metadata).z
 is given.zmonai.inferers.merger)namezThe requested `merger_cls` ['z'] does not exist.z+'merger' should be a subclass of `Merger`, z-'preprocessing' should be a callable object, z.'postprocessing' should be a callable object, r5   z(`batch_size` must be a positive number, )r   __init__
isinstancer   type	TypeErrorr9   strr   r
   
ValueError
issubclassr   r:   rA   callabler<   r=   r;   r>   r?   r@   )r.   r9   r:   r;   r<   r=   r>   r?   r@   rA   Zvalid_merger_clsZmerger_foundr/   r/   r0   rC   q   s<    




zPatchInferer.__init__z9Iterable[tuple[torch.Tensor, Sequence[int]]] | MetaTensorz,Iterator[tuple[torch.Tensor, Sequence, int]])patchesr)   c           
      c  s*  t |trdt|}td|| jD ]@}t| j|| }||||  ||||  jtj |fV  q n| j	dkrt
|| j	dd}n|}dg| j }dg| j }d}|D ]\}	|	d ||< |	d ||< |d7 }|| jkrt|||fV  dg| j }dg| j }d}q|dkr&t|d| ||fV  dS )zGenerate batch of patches and locations

        Args:
            patches: a tensor or list of tensors

        Yields:
            A batch of patches (torch.Tensor or MetaTensor), a sequence of location tuples, and the batch size
        r   g?)r@   timeoutNr5   )rD   r   lenranger;   minmetar   LOCATIONr@   r   torchcat)
r.   rK   
total_sizeir;   bufferZpatch_batchZlocation_batchidx_in_batchsampler/   r/   r0   _batch_sampler   s,    
0


zPatchInferer._batch_samplertuple)outputsr)   c                   sF   t  tr:| jd kr"t  | _t fdd| jD S t ddS )Nc                 3  s   | ]} | V  qd S Nr/   ).0kr[   r/   r0   	<genexpr>   s     z5PatchInferer._ensure_tuple_outputs.<locals>.<genexpr>T)
wrap_array)rD   dictr>   listkeysrZ   r   )r.   r[   r/   r_   r0   _ensure_tuple_outputs   s
    

z"PatchInferer._ensure_tuple_outputsr   r#   )r&   patchr'   r(   r)   c                 O  s:   | j r|  |}||f||}| jr0| |}| |S r\   )r<   r=   re   )r.   r&   rf   r'   r(   r[   r/   r/   r0   _run_inference   s    

zPatchInferer._run_inferencec                 C  s   t ||d }g }g }|D ]}t ||d }	tdd t|jdd  |	jdd  D }
| j }| ||	|
\}}d|kr||d< |d d krtdd|kr||d< | j	f |}|
| |
|
 q||fS )Nr   c                 s  s   | ]\}}|| V  qd S r\   r/   )r]   ipopr/   r/   r0   r`      s     z3PatchInferer._initialize_mergers.<locals>.<genexpr>   merged_shapez `merged_shape` cannot be `None`.cropped_shape)rR   chunkrZ   zipshaperA   copy_get_merged_shapesrH   r:   append)r.   r%   r[   rK   r;   in_patchmergersratiosZout_patch_batch	out_patchratiorA   rl   rk   mergerr/   r/   r0   _initialize_mergers   s$    ,

z PatchInferer._initialize_mergersc                 C  sX   t |||D ]F\}}}t |t||D ](\}	}
dd t |	|D }||
| q(qd S )Nc                 S  s   g | ]\}}t || qS r/   round)r]   lrr/   r/   r0   
<listcomp>  s     z+PatchInferer._aggregate.<locals>.<listcomp>)rn   rR   rm   	aggregate)r.   r[   	locationsr;   rt   ru   Zoutput_patchesrx   rw   Zin_locrv   Zout_locr/   r/   r0   
_aggregate  s    zPatchInferer._aggregatec           
      C  s   | j dkrdS | j |}| j |}tdd t||D }tdd t||D }|jdd | }|jdd | }	| js|	}||	fS )z:Define the shape of merged tensors (non-padded and padded)N)NNc                 s  s   | ]\}}t || V  qd S r\   rz   r]   sr}   r/   r/   r0   r`     s     z2PatchInferer._get_merged_shapes.<locals>.<genexpr>c                 s  s   | ]\}}t || V  qd S r\   rz   r   r/   r/   r0   r`     s     rj   )r9   Zget_input_shapeZget_padded_shaperZ   rn   ro   r?   )
r.   r%   rv   rw   original_spatial_shapeZpadded_spatial_shapeoutput_spatial_shapeZpadded_output_spatial_shaperl   rk   r/   r/   r0   rq     s    
zPatchInferer._get_merged_shapesNCallable[..., torch.Tensor | Sequence[torch.Tensor] | dict[Any, torch.Tensor]]r$   c                 O  s   | j dkrPt|tjrJt|tr6tj|jkrJtdntdt	| d|}n
|  |}g }g }| 
|D ]H\}}	}
| j||f||}|s| ||||
\}}| ||	|
|| qldd |D }| jrtt| j|S t|dkr|d S |S )	a  
        Args:
            inputs: input data for inference, a torch.Tensor, representing an image or batch of images.
                However if the data is already split, it can be fed by providing a list of tuple (patch, location),
                or a MetaTensor that has metadata for `PatchKeys.LOCATION`. In both cases no splitter should be provided.
            network: target model to execute inference.
                supports callables such as ``lambda x: my_torch_model(x, additional_config)``
            args: optional args to be passed to ``network``.
            kwargs: optional keyword args to be passed to ``network``.

        Nz`PatchKey.LOCATION` does not exists in `inputs.meta`. If the inputs are already split into patches, the location of patches needs to be provided as `PatchKey.LOCATION` metadata in a MetaTensor. If the input is not already split, please provide `splitter`.z`splitter` should be set if the input is not already split into patches. For inputs that are split, the location of patches needs to be provided as (image, location) pairs, or as `PatchKey.LOCATION` metadata in a MetaTensor. The provided inputs type is .c                 S  s   g | ]}|  qS r/   )finalize)r]   rx   r/   r/   r0   r~   Z  s     z)PatchInferer.__call__.<locals>.<listcomp>r5   r   )r9   rD   rR   Tensorr   r   rQ   rP   rH   rE   rY   rg   ry   r   r>   rb   rn   rM   )r.   r%   r&   r'   r(   Zpatches_locationsru   rt   rK   r   r;   r[   Zmerged_outputsr/   r/   r0   r1   $  s2    


zPatchInferer.__call__)r,   r2   r3   r4   r   rC   rY   re   rg   ry   r   rq   r1   r/   r/   r/   r0   r   S   s"   "?(c                   @  s4   e Zd ZdZddddZdddddd	d
dZdS )r   z
    SimpleInferer is the normal inference method that run model forward() directly.
    Usage example can be found in the :py:class:`monai.inferers.Inferer` base class.

    r8   )r)   c                 C  s   t |  d S r\   )r   rC   r.   r/   r/   r0   rC   k  s    zSimpleInferer.__init__r#   zCallable[..., torch.Tensor]r   r$   c                 O  s   ||f||S )a  Unified callable function API of Inferers.

        Args:
            inputs: model input data for inference.
            network: target model to execute inference.
                supports callables such as ``lambda x: my_torch_model(x, additional_config)``
            args: optional args to be passed to ``network``.
            kwargs: optional keyword args to be passed to ``network``.

        r/   r-   r/   r/   r0   r1   n  s    zSimpleInferer.__call__Nr,   r2   r3   r4   rC   r1   r/   r/   r/   r0   r   d  s   c                      s|   e Zd ZdZddejdejdddddddddfd	d
dddddddddddd
ddd fddZddddddddZ  Z	S )r   a  
    Sliding window method for model inference,
    with `sw_batch_size` windows for every model.forward().
    Usage example can be found in the :py:class:`monai.inferers.Inferer` base class.

    Args:
        roi_size: the window size to execute SlidingWindow evaluation.
            If it has non-positive components, the corresponding `inputs` size will be used.
            if the components of the `roi_size` are non-positive values, the transform will use the
            corresponding components of img size. For example, `roi_size=(32, -1)` will be adapted
            to `(32, 64)` if the second spatial dimension size of img is `64`.
        sw_batch_size: the batch size to run window slices.
        overlap: Amount of overlap between scans along each spatial dimension, defaults to ``0.25``.
        mode: {``"constant"``, ``"gaussian"``}
            How to blend output of overlapping windows. Defaults to ``"constant"``.

            - ``"constant``": gives equal weight to all predictions.
            - ``"gaussian``": gives less weight to predictions on edges of windows.

        sigma_scale: the standard deviation coefficient of the Gaussian window when `mode` is ``"gaussian"``.
            Default: 0.125. Actual window sigma is ``sigma_scale`` * ``dim_size``.
            When sigma_scale is a sequence of floats, the values denote sigma_scale at the corresponding
            spatial dimensions.
        padding_mode: {``"constant"``, ``"reflect"``, ``"replicate"``, ``"circular"``}
            Padding mode when ``roi_size`` is larger than inputs. Defaults to ``"constant"``
            See also: https://pytorch.org/docs/stable/generated/torch.nn.functional.pad.html
        cval: fill value for 'constant' padding mode. Default: 0
        sw_device: device for the window data.
            By default the device (and accordingly the memory) of the `inputs` is used.
            Normally `sw_device` should be consistent with the device where `predictor` is defined.
        device: device for the stitched output prediction.
            By default the device (and accordingly the memory) of the `inputs` is used. If for example
            set to device=torch.device('cpu') the gpu memory consumption is less and independent of the
            `inputs` and `roi_size`. Output is on the `device`.
        progress: whether to print a tqdm progress bar.
        cache_roi_weight_map: whether to precompute the ROI weight map.
        cpu_thresh: when provided, dynamically switch to stitching on cpu (to save gpu memory)
            when input image volume is larger than this threshold (in pixels/voxels).
            Otherwise use ``"device"``. Thus, the output may end-up on either cpu or gpu.
        buffer_steps: the number of sliding window iterations along the ``buffer_dim``
            to be buffered on ``sw_device`` before writing to ``device``.
            (Typically, ``sw_device`` is ``cuda`` and ``device`` is ``cpu``.)
            default is None, no buffering. For the buffer dim, when spatial size is divisible by buffer_steps*roi_size,
            (i.e. no overlapping among the buffers) non_blocking copy may be automatically enabled for efficiency.
        buffer_dim: the spatial dimension along which the buffers are created.
            0 indicates the first spatial dimension. Default is -1, the last spatial dimension.
        with_coord: whether to pass the window coordinates to ``network``. Defaults to False.
            If True, the ``network``'s 2nd input argument should accept the window coordinates.

    Note:
        ``sw_batch_size`` denotes the max number of windows per network inference iteration,
        not the batch size of inputs.

    r5   g      ?g      ?g        NFzSequence[int] | intr6   zSequence[float] | floatzBlendMode | strzPytorchPadMode | strfloatztorch.device | str | Noner7   
int | Noner8   )roi_sizesw_batch_sizeoverlapmodesigma_scalepadding_modecval	sw_devicedeviceprogresscache_roi_weight_map
cpu_threshbuffer_steps
buffer_dim
with_coordr)   c                   s  t    || _|| _|| _t|| _|| _|| _|| _	|| _
|	| _|
| _|| _|| _|| _|| _d | _zZ|rt|trt|dkr|	d krd}	tt| j|||	d| _|r| jd krtd W nJ tk
r } z*td| j d| d| d|	 d		|W 5 d }~X Y nX d S )
Nr   cpu)r   r   r   zHcache_roi_weight_map=True, but cache is not created. (dynamic roi_size?)z	roi size z, mode=z, sigma_scale=z	, device=z^
Seems to be OOM. Please try smaller patch size or mode='constant' instead of mode='gaussian'.)superrC   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   roi_weight_maprD   r	   rO   r   r   warningswarnBaseExceptionRuntimeError)r.   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   er+   r/   r0   rC     sD    

   zSlidingWindowInferer.__init__r#   r   r   Atorch.Tensor | tuple[torch.Tensor, ...] | dict[Any, torch.Tensor]r$   c                 O  s   | d| j}| d| j}| d| j}|dkrX| jdk	rX|jdd  | jkrXd}t|| j| j	|| j
| j| j| j| j| j|| j| jd||| jf||S )g  

        Args:
            inputs: model input data for inference.
            network: target model to execute inference.
                supports callables such as ``lambda x: my_torch_model(x, additional_config)``
            args: optional args to be passed to ``network``.
            kwargs: optional keyword args to be passed to ``network``.

        r   r   r   Nrj   r   )popr   r   r   r   ro   numelr   r   r   r   r   r   r   r   r   r   r   r   )r.   r%   r&   r'   r(   r   r   r   r/   r/   r0   r1     s8    *zSlidingWindowInferer.__call__)
r,   r2   r3   r4   r   CONSTANTr   rC   r1   __classcell__r/   r/   r   r0   r   ~  s"   :24c                      s.   e Zd ZdZdddddd fddZ  ZS )	r"   a(  
    SlidingWindowInfererAdapt extends SlidingWindowInferer to automatically switch to buffered and then to CPU stitching,
    when OOM on GPU. It also records a size of such large images to automatically
    try CPU stitching for the next large image of a similar size.  If the stitching 'device' input parameter is provided,
    automatic adaptation won't be attempted, please keep the default option device = None for adaptive behavior.
    Note: the output might be on CPU (even if the input was on GPU), if the GPU memory was not sufficient.

    r#   r   r   r   r$   c                   s`  | j dk	r t j||f||S | jdk	o2| jdk}| jdk	oT|jdd  | jk}|jo`| }|jop|op| }| jdk	rtd| jnd}	d}
t	|jdd }|
t|}|j|d  |jd  dkr|}
tdD ]Z}zBt j||f||r|j nt d|r|	nd|
d|W   S  tk
r2 } z|s@|rTd	tt|jkrX|t| |rd
}|jdd  d | _|rd
}td|j d n*d}|	| _td|	 d|
 d|j d nR|	dkr
td|	d }	|	| _td|j d|	 d nd
}td|j d W 5 d}~X Y qX qtd| d| d| d| d|	 
dS )r   Nr   rj   r5   r   
   r   )r   r   r   OutOfMemoryErrorFz3GPU stitching failed, attempting on CPU, image dim r   TzGPU stitching failed, buffer z dim z, image dim z)GPU buffered stitching failed, image dim z reducing buffer to z<GPU buffered stitching failed, attempting on CPU, image dim zSlidingWindowInfererAdapt  )r   r   r1   r   r   ro   r   is_cudamaxrc   indexrN   rR   r   rG   rE   r,   loggerinfowarning)r.   r%   r&   r'   r(   Zskip_bufferZcpu_condZgpu_stitchingZbuffered_stitchingr   r   shmax_dim_r   r   r/   r0   r1   $  sh    
"	 

( z"SlidingWindowInfererAdapt.__call__)r,   r2   r3   r4   r1   r   r/   r/   r   r0   r"     s   	c                   @  s>   e Zd ZdZdddddddddd	Zd
ddddddZdS )r    a  
    SaliencyInferer is inference with activation maps.

    Args:
        cam_name: expected CAM method name, should be: "CAM", "GradCAM" or "GradCAMpp".
        target_layers: name of the model layer to generate the feature map.
        class_idx: index of the class to be visualized. if None, default to argmax(logits).
        args: other optional args to be passed to the `__init__` of cam.
        kwargs: other optional keyword args to be passed to `__init__` of cam.

    NrG   r   r   r8   )cam_nametarget_layers	class_idxr'   r(   r)   c                 O  sD   t |  | dkrtd| | _|| _|| _|| _|| _d S )N)camgradcamZ	gradcamppz4cam_name should be: 'CAM', 'GradCAM' or 'GradCAMpp'.)	r   rC   lowerrH   r   r   r   r'   r(   )r.   r   r   r   r'   r(   r/   r/   r0   rC     s    

zSaliencyInferer.__init__r#   z	nn.Module)r%   r&   r'   r(   c                 O  st   | j dkr$t|| jf| j| j}n<| j dkrHt|| jf| j| j}nt|| jf| j| j}||| jf||S )a  Unified callable function API of Inferers.

        Args:
            inputs: model input data for inference.
            network: target model to execute inference.
                supports callables such as ``lambda x: my_torch_model(x, additional_config)``
            args: other optional args to be passed to the `__call__` of cam.
            kwargs: other optional keyword args to be passed to `__call__` of cam.

        r   r   )r   r   r   r'   r(   r   r   r   )r.   r%   r&   r'   r(   r   r/   r/   r0   r1     s    

zSaliencyInferer.__call__)Nr   r/   r/   r/   r0   r    s  s    c                      s^   e Zd ZdZdddddd fddZd	d
dddd fddZd
d	ddddddZ  ZS )r!   a[  
    SliceInferer extends SlidingWindowInferer to provide slice-by-slice (2D) inference when provided a 3D volume.
    A typical use case could be a 2D model (like 2D segmentation UNet) operates on the slices from a 3D volume,
    and the output is a 3D volume with 2D slices aggregated. Example::

        # sliding over the `spatial_dim`
        inferer = SliceInferer(roi_size=(64, 256), sw_batch_size=1, spatial_dim=1)
        output = inferer(input_volume, net)

    Args:
        spatial_dim: Spatial dimension over which the slice-by-slice inference runs on the 3D volume.
            For example ``0`` could slide over axial slices. ``1`` over coronal slices and ``2`` over sagittal slices.
        args: other optional args to be passed to the `__init__` of base class SlidingWindowInferer.
        kwargs: other optional keyword args to be passed to `__init__` of base class SlidingWindowInferer.

    Note:
        ``roi_size`` in SliceInferer is expected to be a 2D tuple when a 3D volume is provided. This allows
        sliding across slices along the 3D volume using a selected ``spatial_dim``.

    r   r6   r   r8   )spatial_dimr'   r(   r)   c                   s$   || _ t j|| t| j| _d S r\   )r   r   rC   r   r   orig_roi_size)r.   r   r'   r(   r   r/   r0   rC     s    zSliceInferer.__init__r#   r   r   r$   c                   s   j dkrtdtj_tjdkr`t|jdd dkr`tj_jj d nt	dj d|j dt
 j| fd	d
dS )a  
        Args:
            inputs: 3D input for inference
            network: 2D model to execute inference on slices in the 3D input
            args: optional args to be passed to ``network``.
            kwargs: optional keyword args to be passed to ``network``.
        rj   zB`spatial_dim` can only be `0, 1, 2` with `[H, W, D]` respectively.N   r5   zCurrently, only 2D `roi_size` (z!) with 3D `inputs` tensor (shape=z) is supported.c                   s   j | f S r\   )network_wrapper)xr'   r(   r&   r.   r/   r0   <lambda>      z'SliceInferer.__call__.<locals>.<lambda>)r%   r&   )r   rH   r   r   rM   r   ro   rc   insertr   r   r1   r-   r   r   r0   r1     s    
$zSliceInferer.__call__)r&   r   r'   r(   r)   c                   s   |j  jd d}||f||}t|tjr@|j jd dS t|trv| D ]}|| j jd d||< qR|S t fdd|D S )zP
        Wrapper handles inference for 2D models over 3D volume inputs.
        rj   dimc                 3  s    | ]}|j  jd  dV  qdS )rj   r   N)	unsqueezer   )r]   out_ir   r/   r0   r`     s     z/SliceInferer.network_wrapper.<locals>.<genexpr>)	squeezer   rD   rR   r   r   r   rd   rZ   )r.   r&   r   r'   r(   outr^   r/   r   r0   r     s    
zSliceInferer.network_wrapper)r   )r,   r2   r3   r4   rC   r1   r   r   r/   r/   r   r0   r!     s   )5
__future__r   r   abcr   r   collections.abcr   r   r   r   r	   pydocr
   typingr   rR   torch.nnnnmonai.apps.utilsr   monai.data.meta_tensorr   Zmonai.data.thread_bufferr   Zmonai.inferers.mergerr   r   Zmonai.inferers.splitterr   Zmonai.inferers.utilsr   r   monai.utilsr   r   r   r   r   Zmonai.visualizer   r   r   r,   r   __all__r   r   r   r   r"   r    r!   r/   r/   r/   r0   <module>   sD   &   Y/