
    &`ij                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	m
Z
mZmZmZmZmZ d dlmZ d dlmZmZ e	rd dlZd dlZd dlmZ d dlmZ  ej        e          Z ed	           G d
 de                       Z! ed	           G d de j"                              Z#e G d de#e j"                              Z$e$j%        Z%dS )    N)Enum)TYPE_CHECKINGAnyDictListOptionalUnionfinal)BatchFormat)DeveloperAPI	PublicAPI)DataBatchType)Datasetbeta)	stabilityc                       e Zd ZdZdS )PreprocessorNotFittedExceptionz<Error raised when the preprocessor needs to be fitted first.N)__name__
__module____qualname____doc__     i/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/data/preprocessor.pyr   r      s        FFDr   r   c                   p   e Zd ZdZd Z G d dee          ZdZd Z	d7d	Z
d8dZd9dZdefdZdddddd
ddee         dee         dee         dee         ddfdZdddddd
ddee         dee         dee         dee         ddfdZd:dZed8d             Zdefd!Z	 	 	 d;d
ddee         dee         dee         dee         ddfd"Zdeeef         fd#Zd:d$Zed%ee         d&eee                  dee         fd'            Z ed<d*            Z!ed+e"d,eed,f         f         de"d,eed,f         f         fd-            Z#eedefd.                        Z$dee         fd/Z%dee         fd0Z&deeef         fd1Z'd2eeef         fd3Z(edefd4            Z)e*ed5edd fd6                        Z+dS )=Preprocessora  Implements an ML preprocessing operation.

    Preprocessors are stateful objects that can be fitted against a Dataset and used
    to transform both local data batches and distributed data. For example, a
    Normalization preprocessor may calculate the mean and stdev of a field during
    fitting, and uses these attributes to implement its normalization transform.

    Preprocessors can also be stateless and transform data without needed to be fitted.
    For example, a preprocessor may simply remove a column, which does not require
    any state to be fitted.

    If you are implementing your own Preprocessor sub-class, you should override the
    following:

    * ``_fit`` if your preprocessor is stateful. Otherwise, set
      ``_is_fittable=False``.
    * ``_transform_pandas`` and/or ``_transform_numpy`` for best performance,
      implement both. Otherwise, the data will be converted to the match the
      implemented method.
    c                 >    ddl m}  |            | _        i | _        d S Nr   StatComputationPlan)ray.data.preprocessors.utilsr    stat_computation_planstats_)selfr    s     r   __init__zPreprocessor.__init__6   s0    DDDDDD%8%8%:%:"r   c                   "    e Zd ZdZdZdZdZdZdS )Preprocessor.FitStatuszThe fit status of preprocessor.NOT_FITTABLE
NOT_FITTEDPARTIALLY_FITTEDFITTEDN)r   r   r   r   r(   r)   r*   r+   r   r   r   	FitStatusr'   <   s+        --%!
 .r   r,   Tc                 X      fdt                     D             }t          |          S )aG  Checks if the Preprocessor has fitted state.

        This is also used as an indiciation if the Preprocessor has been fit, following
        convention from Ray versions prior to 2.6.
        This allows preprocessors that have been fit in older versions of Ray to be
        used to transform data in newer versions.
        c                 ^    g | ])}|                     d           t          |          '|*S )_)endswithgetattr).0vr$   s     r   
<listcomp>z8Preprocessor._check_has_fitted_state.<locals>.<listcomp>U   s8    UUUQ

3UGDRSDTDTUqUUUr   )varsbool)r$   fitted_varss   ` r   _check_has_fitted_statez$Preprocessor._check_has_fitted_stateL   s3     VUUU$t**UUUK   r   returnr'   c                     | j         st          j        j        S t	          | d          r| j        s|                                 rt          j        j        S t          j        j        S )N_fitted)	_is_fittabler   r,   r(   hasattrr;   r8   r+   r)   r$   s    r   
fit_statuszPreprocessor.fit_statusX   sc      	5)66D)$$	5)-	5))++	5  )00)44r   dsr   c                 \   |                                  }|t          j        j        k    r| S |t          j        j        t          j        j        fv rt          j        d           | j        	                                 | 
                    |                              |          }d| _        |S )a  Fit this Preprocessor to the Dataset.

        Fitted state attributes will be directly set in the Preprocessor.

        Calling it more than once will overwrite all previously fitted state:
        ``preprocessor.fit(A).fit(B)`` is equivalent to ``preprocessor.fit(B)``.

        Args:
            ds: Input dataset.

        Returns:
            Preprocessor: The fitted Preprocessor with state attributes.
        z`fit` has already been called on the preprocessor (or at least one contained preprocessors if this is a chain). All previously fitted state will be overwritten!T)r?   r   r,   r(   r+   r*   warningswarnr"   reset_fit_fit_executer;   )r$   r@   r?   	fitted_dss       r   fitzPreprocessor.fitb   s     __&&
/<<<K")"3
 
 
 MC   	"((***IIbMM..r22	r   datasetc                 V    | xj         | j                            |          z  c_         | S )N)r#   r"   compute)r$   rI   s     r   rF   zPreprocessor._fit_execute   s(    t199'BBBr   c                 R    t          | d          ot          | j                  dk    S )Nr#   r   )r=   lenr#   r>   s    r   	has_statszPreprocessor.has_stats   s&    tX&&?3t{+;+;a+??r   N)transform_num_cpustransform_memorytransform_batch_sizetransform_concurrencyrO   rP   rQ   rR   c                `    |                      |           |                     |||||          S )a$  Fit this Preprocessor to the Dataset and then transform the Dataset.

        Calling it more than once will overwrite all previously fitted state:
        ``preprocessor.fit_transform(A).fit_transform(B)``
        is equivalent to ``preprocessor.fit_transform(B)``.

        Args:
            ds: Input Dataset.
            transform_num_cpus: [experimental] The number of CPUs to reserve for each parallel map worker.
            transform_memory: [experimental] The heap memory in bytes to reserve for each parallel map worker.
            transform_batch_size: [experimental] The maximum number of rows to return.
            transform_concurrency: [experimental] The maximum number of Ray workers to use concurrently.

        Returns:
            ray.data.Dataset: The transformed Dataset.
        )num_cpusmemory
batch_sizeconcurrency)rH   	transform)r$   r@   rO   rP   rQ   rR   s         r   fit_transformzPreprocessor.fit_transform   s=    2 	~~'#+-  
 
 	
r   rV   rT   rU   rW   rV   rT   rU   rW   c                    |                                  }|t          j        j        t          j        j        fv rt          d          |                     |||||          }|S )a  Transform the given dataset.

        Args:
            ds: Input Dataset.
            batch_size: [experimental] Advanced configuration for adjusting input size for each worker.
            num_cpus: [experimental] The number of CPUs to reserve for each parallel map worker.
            memory: [experimental] The heap memory in bytes to reserve for each parallel map worker.
            concurrency: [experimental] The maximum number of Ray workers to use concurrently.

        Returns:
            ray.data.Dataset: The transformed Dataset.

        Raises:
            PreprocessorNotFittedException: if ``fit`` is not called yet.
        zX`fit` must be called before `transform`, or simply use fit_transform() to run both stepsrZ   )r?   r   r,   r*   r)   r   
_transform)r$   r@   rV   rT   rU   rW   r?   transformed_dss           r   rX   zPreprocessor.transform   s    0 __&&
"3"-
 
 
 1B   !# ) 
 
 r   datar   c                     |                                  }|t          j        j        t          j        j        fv rt          d          |                     |          S )a  Transform a single batch of data.

        The data will be converted to the format supported by the Preprocessor,
        based on which ``_transform_*`` methods are implemented.

        Args:
            data: Input data batch.

        Returns:
            DataBatchType:
                The transformed data batch. This may differ
                from the input type depending on which ``_transform_*`` methods
                are implemented.
        z.`fit` must be called before `transform_batch`.)r?   r   r,   r*   r)   r   _transform_batch)r$   r^   r?   s      r   transform_batchzPreprocessor.transform_batch   sd     __&&
"3"-
 
 
 1@   $$T***r   c                     t                      )z2Sub-classes should override this instead of fit().NotImplementedError)r$   r@   s     r   rE   zPreprocessor._fit        "###r   c                     | j         j        t          j        k    }| j         j        t          j        k    }|r|r|                                 S |rt
          j        S |rt
          j        S t          d          )af  Determine which batch format to use based on Preprocessor implementation.

        * If only `_transform_pandas` is implemented, then use ``pandas`` batch format.
        * If only `_transform_numpy` is implemented, then use ``numpy`` batch format.
        * If both are implemented, then use the Preprocessor defined preferred batch
        format.
        zNone of `_transform_numpy` or `_transform_pandas` are implemented. At least one of these transform functions must be implemented for Preprocessor transforms.)		__class___transform_pandasr   _transform_numpypreferred_batch_formatr   NUMPYPANDASrd   )r$   has_transform_pandashas_transform_numpys      r   _determine_transform_to_usez(Preprocessor._determine_transform_to_use   s     N,0NN 	 N+|/LL 	  	#7 	..000  		$$! 	%%%/  r   c                 j   |                                  }|                                 }|||d<   |||d<   |||d<   |||d<   |t          j        k    r |j        | j        fdt          j        i|S |t          j        k    r |j        | j        fdt          j        i|S t          d|           )NrT   rU   rV   rW   batch_formatziInvalid transform type returned from _determine_transform_to_use; "pandas" and "numpy" allowed, but got: )	ro   _get_transform_configr   rl   map_batchesrh   rk   ri   
ValueError)r$   r@   rV   rT   rU   rW   transform_typekwargss           r   r\   zPreprocessor._transform  s    99;; ++--!)F:%F8!#-F< "$/F=![///!2>& 5@5GKQ   {000!2>% 4?4EIO   K:HK K  r   c                     i S )zReturns kwargs to be passed to :meth:`ray.data.Dataset.map_batches`.

        This can be implemented by subclassing preprocessors.
        r   r>   s    r   rr   z"Preprocessor._get_transform_config6  s	    
 	r   c                    dd l }dd l}ddlm}m} 	 dd l}n# t          $ r d }Y nw xY wt          ||j        |j	        t          j        j        |j        f          s t          dt          |           d          |                                 }|t"          j        k    r|                      ||                    S |t"          j        k    r|                      ||                    S d S )Nr   )_convert_batch_type_to_numpy_convert_batch_type_to_pandasz`transform_batch` is currently only implemented for Pandas DataFrames, pyarrow Tables, NumPy ndarray and dictionary of ndarray. Got .)numpypandas"ray.air.util.data_batch_conversionry   rz   pyarrowImportError
isinstance	DataFrameTablecollectionsabcMappingndarrayrt   typero   r   rl   rh   rk   ri   )r$   r^   nppdry   rz   r   ru   s           r   r`   zPreprocessor._transform_batch=  sK   	
 	
 	
 	
 	
 	
 	
 	

	NNNN 	 	 	GGG	 2<0GT
 
 	 . $T

. . .   99;;[///))*G*G*M*MNNN{000(()E)Ed)K)KLLL 10s    &&columnsoutput_columnsc                 l    |r/t          |          t          |          k    rt          d          |p|S )a(  Returns the output columns after validation.

        Checks if the columns are explicitly set, otherwise defaulting to
        the input columns.

        Raises:
            ValueError: If the length of the output columns does not match the
                length of the input columns.
        zuInvalid output_columns: Got len(columns) != len(output_columns). The length of columns and output_columns must match.)rM   rt   )clsr   r   s      r   #_derive_and_validate_output_columnsz0Preprocessor._derive_and_validate_output_columns\  sI      	c'llc..A.AAAG   ((r   dfpd.DataFramec                     t                      )zDRun the transformation on a data batch in a Pandas DataFrame format.rc   )r$   r   s     r   rh   zPreprocessor._transform_pandasq  re   r   np_dataz
np.ndarrayc                     t                      )zARun the transformation on a data batch in a NumPy ndarray format.rc   )r$   r   s     r   ri   zPreprocessor._transform_numpyv  s    
 "###r   c                     t           j        S )aP  Batch format hint for upstream producers to try yielding best block format.

        The preferred batch format to use if both `_transform_pandas` and
        `_transform_numpy` are implemented. Defaults to Pandas.

        Can be overriden by Preprocessor classes depending on which transform
        path is the most optimal.
        )r   rl   r   s    r   rj   z#Preprocessor.preferred_batch_format}  s     !!r   c                 $    t          | dg           S )Nr   r1   r>   s    r   get_input_columnszPreprocessor.get_input_columns  s    tY+++r   c                 $    t          | dg           S )Nr   r   r>   s    r   get_output_columnszPreprocessor.get_output_columns  s    t-r222r   c                 d    | j                                         }|                    dd            |S )Nr"   )__dict__copypop)r$   states     r   __getstate__zPreprocessor.__getstate__  s/    ""$$		)4000r   r   c                 d    ddl m} | j                            |            |            | _        d S r   )r!   r    r   updater"   )r$   r   r    s      r   __setstate__zPreprocessor.__setstate__  sA    DDDDDDU###%8%8%:%:"""r   c                 t    t          j        t          j        |                                         d          S )zReturn this preprocessor serialized as a string.
        Note: This is not a stable serialization format as it uses `pickle`.
        ascii)base64	b64encodepickledumpsdecoder>   s    r   	serializezPreprocessor.serialize  s-     T 2 233::7CCCr   
serializedc                 N    t          j        t          j        |                     S )zALoad the original preprocessor serialized via `self.serialize()`.)r   loadsr   	b64decode)r   s    r   deserializezPreprocessor.deserialize  s     |F,Z88999r   )r9   r'   )r@   r   r9   r   )rI   r   )r^   r   r9   r   )NNN)r   r   r9   r   ),r   r   r   r   r%   strr   r,   r<   r8   r?   rH   rF   r6   rN   r   floatintrY   rX   ra   r   rE   r   ro   r\   r   r   rr   r`   classmethodr   r   rh   r	   ri   rj   r   r   r   r   r   staticmethodr   r   r   r   r   r      s        *      C    L
! 
! 
!5 5 5 5       D   @4 @ @ @ @ /3,0.2/3 
  
  
 
 %UO	 

 #5/ 
 'sm 
  (} 
 
 
  
  
  
L %)$("&%)( ( (( SM	(
 5/( ( c]( 
( ( ( (T+ + + +2 $ $ $ \$[    B %)"&%)" "" SM" 5/	"
 " c]" 
" " " "HtCH~    M M M M> )3i)19$s)1D)	c) ) ) [)( $ $ $ \$ $\4\0A+BBC$	|T#|"344	5$ $ $ \$ 	"{ 	" 	" 	" \ [	",49 , , , ,3DI 3 3 3 3d38n    ;$sCx. ; ; ; ; D3 D D D \D : : : : : \ \: : :r   r   c                      e Zd ZdZe G d de                      ZdZdZe	j
        deeef         fd            Ze	j
        deeef         d	efd
            Zdeeef         fdZdeeef         fdZedefd            Zededdfd            Zedefd            Zed	eddfd            Zeedeeef         fd                        Zeeedeeef         ddfd                                    ZdS )SerializablePreprocessorBasea  Abstract base class for serializable preprocessors.

    This class defines the serialization interface that all preprocessors must implement
    to support saving and loading their state. The serialization system uses CloudPickle
    as the primary format.

    **Architecture Overview:**

    The serialization system is built around two types of methods:

    1. **Final Methods (DO NOT OVERRIDE):**
       - ``serialize()``: Orchestrates the serialization process
       - ``deserialize()``: Orchestrates the deserialization process

       These methods are marked as ``@final`` and should never be overridden by
       subclasses. They handle format detection, factory coordination, and error handling.

    2. **Abstract Methods (MUST IMPLEMENT):**
       - ``_get_serializable_fields()``: Extract instance fields for serialization
       - ``_set_serializable_fields()``: Restore instance fields from deserialization
       - ``_get_stats()``: Extract computed statistics for serialization
       - ``_set_stats()``: Restore computed statistics from deserialization

       These methods must be implemented by each preprocessor subclass to define
       their specific serialization behavior.

    **Format Support:**

    - **CloudPickle** (default):
    - **Pickle** (legacy): Backward compatibility for existing serialized data

    **Important Notes:**

    - Never override ``serialize()`` or ``deserialize()`` in subclasses
    - Always call ``super().__init__()`` in subclass constructors
    - Use ``_fitted`` attribute to track fitting state
    - Store computed statistics in ``stats_`` dictionary
    - Handle version migration and backwards compatibility in ``_set_serializable_fields()`` if needed
    c                       e Zd ZdZdZdS )0SerializablePreprocessorBase.SerializationFormatcloudpickler   N)r   r   r   CLOUDPICKLEPICKLEr   r   r   SerializationFormatr     s        #r   r   s   CPKL:   r9   c                     dS )az  Extract instance fields that should be serialized.

        This method should return a dictionary containing all instance attributes
        that are necessary to restore the preprocessor's configuration state.
        This typically includes constructor parameters and internal state flags.

        Returns:
            Dictionary mapping field names to their values
        Nr   r>   s    r   _get_serializable_fieldsz5SerializablePreprocessorBase._get_serializable_fields  s	     	r   fieldsversionc                     dS )a  Restore instance fields from deserialized data.

        This method should restore the preprocessor's configuration state from
        the provided fields' dictionary. It's called during deserialization to
        recreate the instance state.

        **Version Migration:**

        If the serialized version differs from the current ``VERSION``,
        implement migration logic to handle schema changes:

        .. testcode::

            def _set_serializable_fields(self, fields: Dict[str, Any], version: int):
                # Handle version migration
                if version == 1 and self.VERSION == 2:
                    # Migrate from version 1 to 2
                    if "old_field" in fields:
                        fields["new_field"] = migrate_old_field(fields.pop("old_field"))

                # Set all fields
                for key, value in fields.items():
                    setattr(self, key, value)

                # Reinitialize derived state
                self.stat_computation_plan = StatComputationPlan()

        Args:
            fields: Dictionary of field names to values
            version: Version of the serialized data
        Nr   )r$   r   r   s      r   _set_serializable_fieldsz5SerializablePreprocessorBase._set_serializable_fields  s
    B 	r   c                 $    t          | di           S )a  Extract computed statistics that should be serialized.

        This method should return the computed statistics that were generated
        during the ``fit()`` process. These statistics are typically stored in
        the ``stats_`` attribute and contain the learned parameters needed for
        transformation.

        Returns:
            Dictionary containing computed statistics
        r#   r   r>   s    r   
_get_statsz'SerializablePreprocessorBase._get_stats  s     tXr***r   statsc                     || _         dS )av  Restore computed statistics from deserialized data.

        This method should restore the preprocessor's computed statistics from
        the provided stats dictionary. These statistics are typically stored in
        the ``stats_`` attribute and contain learned parameters from fitting.

        Args:
            stats: Dictionary containing computed statistics
        N)r#   )r$   r   s     r   
_set_statsz'SerializablePreprocessorBase._set_stats  s     r   c                     | j         S )zGet the preprocessor class identifier for this preprocessor class.

        Returns:
            The preprocessor class identifier string used to identify this preprocessor
            type in serialized data.
        4_SerializablePreprocessorBase__PREPROCESSOR_CLASS_IDr   s    r   get_preprocessor_class_idz6SerializablePreprocessorBase.get_preprocessor_class_id'  s     **r   
identifierNc                     || _         dS )zSet the preprocessor class identifier for this preprocessor class.

        Args:
            identifier: The preprocessor class identifier string to use.
        Nr   )r   r   s     r   set_preprocessor_class_idz6SerializablePreprocessorBase.set_preprocessor_class_id1  s     '1###r   c                     | j         S )zGet the version number for this preprocessor class.

        Returns:
            The version number for this preprocessor's serialization format.
        &_SerializablePreprocessorBase__VERSIONr   s    r   get_versionz(SerializablePreprocessorBase.get_version:  s     }r   c                     || _         dS )zSet the version number for this preprocessor class.

        Args:
            version: The version number for this preprocessor's serialization format.
        Nr   )r   r   s     r   set_versionz(SerializablePreprocessorBase.set_versionC  s      r   c                    ddl m}m} |                                 |                                 |                                 |                                 | j        d}|                    |j	                  
                    |          S )u[  Serialize this preprocessor to a string or bytes.

        **⚠️ DO NOT OVERRIDE THIS METHOD IN SUBCLASSES ⚠️**

        This method is marked as ``@final`` in the concrete implementation and handles
        the complete serialization orchestration. Subclasses should implement the
        abstract methods instead: ``_get_serializable_fields()`` and ``_get_stats()``.

        **Serialization Process:**

        1. Extracts fields via ``_get_serializable_fields()``
        2. Extracts statistics via ``_get_stats()``
        3. Packages data with metadata (type, version, format)
        4. Delegates to ``SerializationHandlerFactory`` for format-specific handling
        5. Returns serialized data with magic bytes for format identification

        **Supported Formats:**

        - **CloudPickle** (default):
        - **Pickle** (legacy): Backward compatibility for existing serialized data

        Returns:
            Serialized preprocessor data (bytes for CloudPickle, str for legacy Pickle)

        Raises:
            ValueError: If the serialization format is invalid or unsupported
        r   )HandlerFormatNameSerializationHandlerFactory)r   r   r   r   serializer_format_version)format_identifier)-ray.data.preprocessors.serialization_handlersr   r   r   r   r   r   SERIALIZER_FORMAT_VERSIONget_handlerr   r   )r$   r   r   r^   s       r   r   z&SerializablePreprocessorBase.serializeL  s    <	
 	
 	
 	
 	
 	
 	
 	
 2244''))3355__&& *.)G
 
 +66/; 7 
 

)D//	r   r   r   c                 N   ddl m}m} ddlm}m} 	 |                    |           }|                    |           }t          ||          r|S  ||d                   }|d         |j	        k    rt          d|d                    |                    |          }ddlm}	  |	            |_        |                    |d	         |d
                    |                    |d                    |S # |$ r  t"          $ r!}
t          d| dd          d          |
d}
~
ww xY w)u%  Deserialize a preprocessor from serialized data.

        **⚠️ DO NOT OVERRIDE THIS METHOD IN SUBCLASSES ⚠️**

        This method is marked as ``@final`` in the concrete implementation and handles
        the complete deserialization orchestration. Subclasses should implement the
        abstract methods instead: ``_set_serializable_fields()`` and ``_set_stats()``.

        **Deserialization Process:**

        1. Detects format from magic bytes in serialized data
        2. Delegates to ``SerializationHandlerFactory`` for format-specific parsing
        3. Extracts metadata (type, version, fields, stats)
        4. Looks up preprocessor class from registry
        5. Creates new instance and restores state via abstract methods
        6. Returns fully reconstructed preprocessor instance

        **Format Detection:**

        The method automatically detects the serialization format:
        - ``CPKL:`` → CloudPickle format
        - Base64 string → Legacy Pickle format

        **Error Handling:**

        Provides comprehensive error handling for:
        - Unknown serialization formats
        - Corrupted or invalid data
        - Missing preprocessor types
        - Version compatibility issues

        Args:
            serialized: Serialized preprocessor data (bytes or str)

        Returns:
            Reconstructed preprocessor instance

        Raises:
            ValueError: If the serialized data is corrupted or format is unrecognized
            UnknownPreprocessorError: If the preprocessor type is not registered
        r   )PickleSerializationHandlerr   )UnknownPreprocessorError_lookup_class)r^   r   r   z'Unsupported serializer format version: r   r   r   )r   r   r   )r   z2Failed to deserialize preprocessor. Data preview: N2   z...)r   r   r   &ray.data.preprocessors.version_supportr   r   r   r   r   r   rt   __new__r!   r    r"   r   r   	Exception)r   r   r   r   r   handlermetar   objr    es              r   r   z(SerializablePreprocessorBase.deserialize~  s   Z	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	

$	1==:=NNG&&z22D '#=>>   -V--C /0C4QQQ adC^>_aa   ++c""C IHHHHH(;(;(=(=C%((XY(XXXNNgN///J' 	 	 	 	 	 	YZPSQSPS_YYY 	s   <C4 B$C4 4D$DD$)r   r   r   r   r   r   r   MAGIC_CLOUDPICKLEr   r   abstractmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r
   r	   bytesr   r   r   r   r   r   r   r     sM       & &P     d   \ ! !
$sCx. 
 
 
 
 	 tCH~          D+DcN + + + +
S#X 
 
 
 
 +# + + + [+ 13 14 1 1 1 [1 C    [  #  $       [  .5e, . . . \ U.` Wc5j 1 Wn W W W \ \ UW W Wr   r   )&r   r   r   loggingr   rB   enumr   typingr   r   r   r   r   r	   r
   r~   r   ray.util.annotationsr   r   r|   r   r}   r   ray.air.data_batch_typer   ray.data.datasetr   	getLoggerr   loggerRuntimeErrorr   ABCr   r   r   r   r   r   <module>r      s   



               I I I I I I I I I I I I I I I I I I : : : : : : 8 8 8 8 8 8 8 8 )555555(((((( 
	8	$	$ V	 	 	 	 	\ 	 	 	 VI: I: I: I: I:37 I: I: I:X k k k k k< k k k\	 3F   r   