
    rj                         d Z ddlZddlZddlZddlZddlZej        d         dk    Zej        d         dk    Zere	fZ
efZefZe	ZeZd Zd Zd ZdS efZ
eefZeej        fZeZe	Zd Zd	 Zd
 ZdS )zN
This module provides string converting tools and compatibility on py2 vs py3
    N      c                     t          | t                    r|                     d          S t          | t                    r| S t          |                               d          S z
        convert source type idata to bytes string

        :type idata: any valid python type
        :param idata: source data
        :return : bytes string
        utf-8encoding)
isinstancestrencodebytesidatas    _/lsinfo/ai/hellotax_ai/data_center/backend/venv/lib/python3.11/site-packages/baidubce/compat.pyconvert_to_bytesr   !   s`     eS!! 	7<<<111u%% 	7L u::$$g$666    c                      t          |           S )z
        convert source data to str string on py3

        :type idata:any valid python type
        :param idata:source data
        :return :uniocde string on py3
        )convert_to_unicoder   s    r   convert_to_stringr   3   s     "%(((r   c                     t          | t                    r|                     d          S t          | t                    r| S t          |           S z
        convert source type idata to unicode string

        :type idata: any valid python type
        :param idata: source data
        :return : unicode  string
        r   r   )r
   r   decoder   r   s    r   r   r   =   sO     eU## 	<<<111s## 	L u::r   c                     t          | t                    r|                     d          S t          | t                    r| S t          |           S r   )r
   unicoder   r   r   s    r   r   r   V   sO     eW%% 	<<<111s## 	L u::r   c                      t          |           S )z
        convert source data to str string on py2

        :type idata:any valid python type
        :param idata:source data
        :return :bytes string on py2
        )r   r   s    r   r   r   f   s      &&&r   c                     t          | t                    r|                     d          S t          | t                    r| S t          |                               d          S r   )r
   r   r   r   r   s    r   r   r   p   s^     eS!! 	7<<<111w'' 	7Lu::$$g$666r   )__doc__	functools	itertoolsoperatorsystypesversion_infoPY2PY3r   string_typesintinteger_typestypeclass_types	text_typer   binary_typer   r   r   
basestringlong	ClassTyper    r   r   <module>r1      s(             



 	q1	q1  c74LDM%KIK7 7 7$) ) )    & ;L$KM)KIK   ' ' '7 7 7 7 7r   