Repository URL to install this package:
|
Version:
0.1.10 ▾
|
odigos
/
etc
/
odigos-vmagent
/
instrumentations
/
python
/
google
/
protobuf
/
__pycache__
/
proto.cpython-311.pyc
|
|---|
§
{QÄg¬
ã óÞ d Z ddlZddlmZmZ ddlmZ ddlmZ ddlm Z edd¬ ¦ « Z
dd
e
dedefd
Z
dee
dede
fdZd
e
dej ddfdZdee
dej de
fdZdS )z,Contains the Nextgen Pythonic protobuf APIs.é N)ÚTypeÚTypeVar)Údecoder)Úencoder)ÚMessageÚ_MESSAGEr )ÚboundÚmessageÚ
deterministicÚreturnc ó. | |¬¦ « S )a Return the serialized proto.
Args:
message: The proto message to be serialized.
deterministic: If true, requests deterministic serialization
of the protobuf, with predictable ordering of map keys.
Returns:
A binary bytes representation of the message.
)r )ÚSerializeToString)r
r s ú</tmp/pip-target-ix0fus71/lib/python/google/protobuf/proto.pyÚ serializer s ð
× "Ò "°Ð "Ñ ?Ô ?Ð?ó Ú
message_classÚpayloadc óD | ¦ « }| |¦ « |S )zæGiven a serialized data in binary form, deserialize it into a Message.
Args:
message_class: The message meta class.
payload: A serialized bytes in binary form.
Returns:
A new message deserialized from payload.
)ÚParseFromString)r r Únew_messages r Úparser " s) ð
+Ø
×ÒgÑ&Ô&Ð&Ø Ðr Úoutputc óê | ¦ « } t j ¦ « |j |¦ « | t | ¦ « ¦ « }||k rt d||fz ¦ « dS )a¢ Writes the size of the message as a varint and the serialized message.
Writes the size of the message as a varint and then the serialized message.
This allows more data to be written to the output after the message. Use
parse_length_prefixed to parse messages written by this method.
The output stream must be buffered, e.g. using
https://docs.python.org/3/library/io.html#buffered-streams.
Example usage:
out = io.BytesIO()
for msg in message_list:
proto.serialize_length_prefixed(msg, out)
Args:
message: The protocol buffer message that should be serialized.
output: BytesIO or custom buffered IO that data should be written to.
z_Failed to write complete message (wrote: %d, expected: %d). Ensure output is using buffered IO.N)ÚByteSizer Ú_VarintEncoderÚwriter Ú TypeError)r
r ÚsizeÚout_sizes r Úserialize_length_prefixedr 1 s ð&