
    9i                         S r SSKrSSKrSSKrSSKrSSKr\R                  S   S:H  r\R                  S   S:H  r\(       a  \	4r
\4r\4r\	r\rS rS rS rg\4r
\\4r\\R.                  4r\r\	rS rS	 rS
 rg)zN
This module provides string converting tools and compatibility on py2 vs py3
    N      c                     [        U [        5      (       a  U R                  SS9$ [        U [        5      (       a  U $ [        U 5      R                  SS9$ 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    O/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/compat.pyconvert_to_bytesr   !   sN     eS!!<<<11u%%L u:$$g$66    c                     [        U 5      $ )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                     [        U [        5      (       a  U R                  SS9$ [        U [        5      (       a  U $ [        U 5      $ 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   =   s@     eU##<<<11s##L u:r   c                     [        U [        5      (       a  U R                  SS9$ [        U [        5      (       a  U $ [        U 5      $ r   )r
   unicoder   r   r   s    r   r   r   V   s@     eW%%<<<11s##L u:r   c                     [        U 5      $ )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                     [        U [        5      (       a  U R                  SS9$ [        U [        5      (       a  U $ [        U 5      R                  SS9$ r   )r
   r   r   r   r   s    r   r   r   p   sL     eS!!<<<11w''Lu:$$g$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 4LDM%KIK7$)& ;L$KM)KIK '7r   