
    @;?i                         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yefZ
eefZeej.                  fZeZe	Zd Zd	 Zd
 Zy)zN
This module provides string converting tools and compatibility on py2 vs py3
    N      c                     t        | t              r| j                  d      S t        | t              r| S t        |       j                  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    e/var/www/html/leadgen/airagagent/ocr_fallback/ocr_env/lib/python3.12/site-packages/baidubce/compat.pyconvert_to_bytesr   !   sH     eS!<<<11u%L u:$$g$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| j                  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   =   s:     eU#<<<11s#L u:r   c                     t        | t              r| j                  d      S t        | t              r| S t        |       S r   )r
   unicoder   r   r   s    r   r   r   V   s:     eW%<<<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| j                  d      S t        | t              r| S t        |       j                  d      S r   )r
   r   r   r   r   s    r   r   r   p   sF     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   