
    (ph9                          S SK r  " S S5      rg)    Nc                   4    \ rS rSrSrSS.S\4S jjrS rSrg)		BytesRule   a_  A marshal between Python strings and protobuf bytes.

Note: this conversion is asymmetric because Python does have a bytes type.
It is sometimes necessary to convert proto bytes fields to strings, e.g. for
JSON encoding, marshalling a message to a dict. Because bytes fields can
represent arbitrary data, bytes fields are base64 encoded when they need to
be represented as strings.

It is necessary to have the conversion be bidirectional, i.e.
my_message == MyMessage(MyMessage.to_dict(my_message))

To accomplish this, we need to intercept assignments from strings and
base64 decode them back into bytes.
N)absentr   c                    U$ )N )selfvaluer   s      L/var/www/html/venv/lib/python3.13/site-packages/proto/marshal/rules/bytes.py	to_pythonBytesRule.to_python#   s        c                     [        U[        5      (       a>  UR                  S5      nUSS[        U5      S-  -
  -  -  n[        R
                  " U5      nU$ )Nzutf-8   =   )
isinstancestrencodelenbase64urlsafe_b64decode)r	   r
   s     r   to_protoBytesRule.to_proto&   sN    eS!!LL)ETQUa/00E,,U3Er   r   )	__name__
__module____qualname____firstlineno____doc__boolr   r   __static_attributes__r   r   r   r   r      s     26 $ r   r   )r   r   r   r   r   <module>r!      s      r   